Class CodePointMap.StringIterator
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.util.CodePointMap.StringIterator
- Enclosing class:
CodePointMap
Iterates over code points of a string and fetches map values.
This does not implement java.util.Iterator.
void onString(CodePointMap map, CharSequence s, int start) {
CodePointMap.StringIterator iter = map.stringIterator(s, start);
while (iter.next()) {
int end = iter.getIndex(); // code point from between start and end
useValue(s, start, end, iter.getCodePoint(), iter.getValue());
start = end;
}
}
This class is not intended for public subclassing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intDeprecated.This API is ICU internal only.protected CharSequenceDeprecated.This API is ICU internal only.protected intDeprecated.This API is ICU internal only.protected intDeprecated.This API is ICU internal only. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStringIterator(CharSequence s, int sIndex) Deprecated.This API is ICU internal only. -
Method Summary
Modifier and TypeMethodDescriptionfinal intfinal intgetIndex()final intgetValue()booleannext()Reads the next code point, post-increments the string index, and gets a value from the map.booleanprevious()Reads the previous code point, pre-decrements the string index, and gets a value from the map.voidreset(CharSequence s, int sIndex) Resets the iterator to a new string and/or a new string index.
-
Field Details
-
s
Deprecated.This API is ICU internal only. -
sIndex
Deprecated.This API is ICU internal only. -
c
Deprecated.This API is ICU internal only. -
value
Deprecated.This API is ICU internal only.
-
-
Constructor Details
-
StringIterator
Deprecated.This API is ICU internal only.
-
-
Method Details
-
reset
Resets the iterator to a new string and/or a new string index.- Parameters:
s- string to iterate oversIndex- string index where the iteration will start
-
next
public boolean next()Reads the next code point, post-increments the string index, and gets a value from the map. Sets an implementation-defined error value if the code point is an unpaired surrogate.- Returns:
- true if the string index was not yet at the end of the string; otherwise the iterator did not advance
-
previous
public boolean previous()Reads the previous code point, pre-decrements the string index, and gets a value from the map. Sets an implementation-defined error value if the code point is an unpaired surrogate.- Returns:
- true if the string index was not yet at the start of the string; otherwise the iterator did not advance
-
getIndex
public final int getIndex()- Returns:
- the string index
-
getCodePoint
public final int getCodePoint()- Returns:
- the code point
-
getValue
public final int getValue()- Returns:
- the map value, or an implementation-defined error value if the code point is an unpaired surrogate
-