Package org.eclipse.wst.xml.xpath2.processor.internal.utils
public class CodePointIterator extends
Field Summary | |
public static int | DONE Sentinel value returned from iterator when the end is reached. The value is -1 which will never be a valid codepoint. |
Method Summary | |
public java.lang.Object | clone() Create a copy of this code point iterator |
public int | current() Gets the code point at the current position (as returned by getIndex()). |
public int | first() Resets the position to 0 and returns the first code point. |
public int | getIndex() Returns the current index (as a codepoint, not a string index). |
public int | last() Sets the position to the last possible position (or 0 if the text is empty) and returns the code point at that position. |
public int | next() Increments the iterator's code point index by one and returns the code point at the new index. If the resulting index is at the end of the string, the index is not incremented, and DONE is returned. |
public int | previous() Decrements the iterator's index by one and returns the character at the new index. If the current index is 0, the index remains at 0 and a value of DONE is returned. |
Field Detail |
public static int DONE
Sentinel value returned from iterator when the end is reached. The value is -1 which will never be a valid codepoint. |
Methods Detail |
public java.lang.Object clone()
Create a copy of this code point iterator
java.lang.Object
- A copy of this
public int current()
Gets the code point at the current position (as returned by getIndex()).
int
- the code point at the current position or DONE if the current position is off the end of the text.
public int first()
Resets the position to 0 and returns the first code point.
int
- the first code point in the text, or DONE if the text is empty
public int getIndex()
Returns the current index (as a codepoint, not a string index).
int
- the current index.
public int last()
Sets the position to the last possible position (or 0 if the text is empty) and returns the code point at that position.
int
- the last code point in the text, or DONE if the text is empty
public int next()
Increments the iterator's code point index by one and returns the code point at the new index. If the resulting index is at the end of the string, the index is not incremented, and DONE is returned.
int
- the code point at the new position or DONE if the new position is after the text range.
public int previous()
Decrements the iterator's index by one and returns the character at the new index. If the current index is 0, the index remains at 0 and a value of DONE is returned.
int
- the code point at the new position (or DONE if the current position is 0)