|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.text.Segment
Safe:
Field Summary | |
char[] |
array
Suppressed: This is the array containing the text of interest. |
int |
count
Suppressed: This is the number of array elements that make up the text of interest. |
int |
offset
Suppressed: This is the offset into the array that the desired text begins. |
private boolean |
partialReturn
|
private int |
pos
|
Constructor Summary | |
Segment()
Enabled: Creates a new segment. |
|
Segment(char[] array,
int offset,
int count)
Enabled: Creates a new segment referring to an existing array. |
Method Summary | |
Object |
clone()
Suppressed: Creates a shallow copy. |
char |
current()
Enabled: Gets the character at the current position (as returned by getIndex()). |
char |
first()
Enabled: Sets the position to getBeginIndex() and returns the character at that position. |
int |
getBeginIndex()
Enabled: Returns the start index of the text. |
int |
getEndIndex()
Enabled: Returns the end index of the text. |
int |
getIndex()
Enabled: Returns the current index. |
boolean |
isPartialReturn()
Enabled: Flag to indicate that partial returns are valid. |
char |
last()
Enabled: Sets the position to getEndIndex()-1 (getEndIndex() if the text is empty) and returns the character at that position. |
char |
next()
Enabled: Increments the iterator's index by one and returns the character at the new index. |
char |
previous()
Enabled: Decrements the iterator's index by one and returns the character at the new index. |
char |
setIndex(int position)
Enabled: Sets the position to the specified position in the text and returns that character. |
void |
setPartialReturn(boolean p)
Enabled: Flag to indicate that partial returns are valid. |
String |
toString()
Suppressed: Converts a segment into a String. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public char[] array
public int offset
public int count
private boolean partialReturn
private int pos
Constructor Detail |
public Segment()
public Segment(char[] array, int offset, int count)
array
- the array to refer tooffset
- the offset into the arraycount
- the number of charactersMethod Detail |
public void setPartialReturn(boolean p)
p
- whether or not partial returns are valid.public boolean isPartialReturn()
public String toString()
toString
in class Object
public char first()
getBeginIndex()
public char last()
getEndIndex()
public char current()
getIndex()
public char next()
public char previous()
public char setIndex(int position)
position
- the position within the text. Valid values range from
getBeginIndex() to getEndIndex(). An IllegalArgumentException is thrown
if an invalid value is supplied.
public int getBeginIndex()
public int getEndIndex()
public int getIndex()
public Object clone()
clone
in class Object
java.lang.Cloneable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |