java.lang.Object | |
↳ | sun.text.normalizer.RuleCharacterIterator |
An iterator that returns 32-bit code points. This class is deliberately not related to any of the JDK or ICU4J character iterator classes in order to minimize complexity.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DONE | Value returned when there are no more characters to iterate. | |||||||||
int | PARSE_ESCAPES | Bitmask option to enable parsing of escape sequences. | |||||||||
int | PARSE_VARIABLES | Bitmask option to enable parsing of variable names. | |||||||||
int | SKIP_WHITESPACE | Bitmask option to enable skipping of whitespace. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an iterator over the given text, starting at the given
position.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns true if this iterator has no more characters to return.
| |||||||||||
Returns an object which, when later passed to setPos(), will
restore this iterator's position.
| |||||||||||
Returns true if this iterator is currently within a variable expansion.
| |||||||||||
Returns true if the last character returned by next() was
escaped.
| |||||||||||
Advances the position by the given number of 16-bit code units.
| |||||||||||
Returns a string containing the remainder of the characters to be
returned by this iterator, without any option processing.
| |||||||||||
Returns the next character using the given options, or DONE if there
are no more characters, and advance the position to the next
character.
| |||||||||||
Restores this iterator to the position it had when getPos()
returned the given object.
| |||||||||||
Skips ahead past any ignored characters, as indicated by the given
options.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Value returned when there are no more characters to iterate.
Bitmask option to enable parsing of escape sequences. If (options & PARSE_ESCAPES) != 0, then an embedded escape sequence will be expanded to its value. Escapes are parsed using Utility.unescapeAt().
Bitmask option to enable parsing of variable names. If (options & PARSE_VARIABLES) != 0, then an embedded variable will be expanded to its value. Variables are parsed using the SymbolTable API.
Bitmask option to enable skipping of whitespace. If (options & SKIP_WHITESPACE) != 0, then whitespace characters will be silently skipped, as if they were not present in the input. Whitespace characters are defined by UCharacterProperty.isRuleWhiteSpace().
Constructs an iterator over the given text, starting at the given position.
text | the text to be iterated |
---|---|
sym | the symbol table, or null if there is none. If sym is null, then variables will not be deferenced, even if the PARSE_VARIABLES option is set. |
pos | upon input, the index of the next character to return. If a variable has been dereferenced, then pos will not increment as characters of the variable value are iterated. |
Returns true if this iterator has no more characters to return.
Returns an object which, when later passed to setPos(), will restore this iterator's position. Usage idiom: RuleCharacterIterator iterator = ...; Object pos = iterator.getPos(null); // allocate position object for (;;) { pos = iterator.getPos(pos); // reuse position object int c = iterator.next(...); ... } iterator.setPos(pos);
p | a position object previously returned by getPos(), or null. If not null, it will be updated and returned. If null, a new position object will be allocated and returned. |
---|
Returns true if this iterator is currently within a variable expansion.
Returns true if the last character returned by next() was escaped. This will only be the case if the option passed in to next() included PARSE_ESCAPED and the next character was an escape sequence.
Advances the position by the given number of 16-bit code units. This is useful in conjunction with the lookahead() method.
count | the number of 16-bit code units to jump over |
---|
Returns a string containing the remainder of the characters to be returned by this iterator, without any option processing. If the iterator is currently within a variable expansion, this will only extend to the end of the variable expansion. This method is provided so that iterators may interoperate with string-based APIs. The typical sequence of calls is to call skipIgnored(), then call lookahead(), then parse the string returned by lookahead(), then call jumpahead() to resynchronize the iterator.
Returns the next character using the given options, or DONE if there are no more characters, and advance the position to the next character.
options | one or more of the following options, bitwise-OR-ed together: PARSE_VARIABLES, PARSE_ESCAPES, SKIP_WHITESPACE. |
---|
Restores this iterator to the position it had when getPos() returned the given object.
p | a position object previously returned by getPos() |
---|
Skips ahead past any ignored characters, as indicated by the given options. This is useful in conjunction with the lookahead() method. Currently, this only has an effect for SKIP_WHITESPACE.
options | one or more of the following options, bitwise-OR-ed together: PARSE_VARIABLES, PARSE_ESCAPES, SKIP_WHITESPACE. |
---|