com.raelity.text
Class TextUtil.MySegment
java.lang.Object
javax.swing.text.Segment
com.raelity.text.TextUtil.MySegment
- All Implemented Interfaces:
- CharSequence, Cloneable, CharacterIterator
- Enclosing class:
- TextUtil
public static class TextUtil.MySegment
- extends Segment
- implements CharSequence
To support jdk1.5, need a segment that isa CharSequence.
Also keep "docOffset" which is the offset in the document
of the start of the segment; -1 implies not known.
Methods inherited from class javax.swing.text.Segment |
clone, current, first, getBeginIndex, getEndIndex, getIndex, isPartialReturn, last, next, previous, setIndex, setPartialReturn, toString |
docOffset
public int docOffset
TextUtil.MySegment
public TextUtil.MySegment()
TextUtil.MySegment
public TextUtil.MySegment(TextUtil.MySegment seg)
TextUtil.MySegment
public TextUtil.MySegment(char[] array,
int offset,
int count,
int docOffset)
charAt
public char charAt(int index)
- Specified by:
charAt
in interface CharSequence
length
public int length()
- Specified by:
length
in interface CharSequence
subSequence
public CharSequence subSequence(int start,
int end)
- Specified by:
subSequence
in interface CharSequence