Package com.ibm.icu.impl
Class Trie2.Trie2Iterator
java.lang.Object
com.ibm.icu.impl.Trie2.Trie2Iterator
- All Implemented Interfaces:
Iterator<Trie2.Range>
- Enclosing class:
Trie2
Implementation class for an iterator over a Trie2.
Iteration over a Trie2 first returns all of the ranges that are indexed by code points,
then returns the special alternate values for the lead surrogates
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate intprivate Trie2.ValueMapperprivate intprivate Trie2.Range -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()next()The main next() function for Trie2 iteratorsprivate intrangeEndLS(char startingLS) Find the last lead surrogate in a contiguous range with the same Trie2 value as the input character.voidremove()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
mapper
-
returnValue
-
nextStart
private int nextStart -
limitCP
private int limitCP -
doingCodePoints
private boolean doingCodePoints -
doLeadSurrogates
private boolean doLeadSurrogates
-
-
Constructor Details
-
Trie2Iterator
Trie2Iterator(Trie2.ValueMapper vm) -
Trie2Iterator
Trie2Iterator(char leadSurrogate, Trie2.ValueMapper vm)
-
-
Method Details
-
next
The main next() function for Trie2 iterators- Specified by:
nextin interfaceIterator<Trie2.Range>
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator<Trie2.Range>
-
remove
public void remove()- Specified by:
removein interfaceIterator<Trie2.Range>
-
rangeEndLS
private int rangeEndLS(char startingLS) Find the last lead surrogate in a contiguous range with the same Trie2 value as the input character. Use the alternate Lead Surrogate values from the Trie2, not the code-point values. Note: Trie2_16 and Trie2_32 override this implementation with optimized versions, meaning that the implementation here is only being used with Trie2Writable. The code here is logically correct with any type of Trie2, however.- Parameters:
c- The character to begin with.- Returns:
- The last contiguous character with the same value.
-