fun segment(index: Long): javax.swing.text.Segment? { assertOpen() if (currentSegment != null && currentSegment.validIndex(index)) return currentSegment val segment: Map.Entry<Long, javax.swing.text.Segment> = segments.floorEntry(index) return if (segment != null) segment.value else null }
Returns the segment for the given index .