Package com.ibm.icu.impl
Class Trie2.Trie2Iterator
- java.lang.Object
-
- com.ibm.icu.impl.Trie2.Trie2Iterator
-
- All Implemented Interfaces:
java.util.Iterator<Trie2.Range>
- Enclosing class:
- Trie2
class Trie2.Trie2Iterator extends java.lang.Object implements java.util.Iterator<Trie2.Range>
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
Fields Modifier and Type Field Description private boolean
doingCodePoints
private boolean
doLeadSurrogates
private int
limitCP
private Trie2.ValueMapper
mapper
private int
nextStart
private Trie2.Range
returnValue
-
Constructor Summary
Constructors Constructor Description Trie2Iterator(char leadSurrogate, Trie2.ValueMapper vm)
Trie2Iterator(Trie2.ValueMapper vm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Trie2.Range
next()
The main next() function for Trie2 iteratorsprivate int
rangeEndLS(char startingLS)
Find the last lead surrogate in a contiguous range with the same Trie2 value as the input character.void
remove()
-
-
-
Field Detail
-
mapper
private Trie2.ValueMapper mapper
-
returnValue
private Trie2.Range returnValue
-
nextStart
private int nextStart
-
limitCP
private int limitCP
-
doingCodePoints
private boolean doingCodePoints
-
doLeadSurrogates
private boolean doLeadSurrogates
-
-
Constructor Detail
-
Trie2Iterator
Trie2Iterator(Trie2.ValueMapper vm)
-
Trie2Iterator
Trie2Iterator(char leadSurrogate, Trie2.ValueMapper vm)
-
-
Method Detail
-
next
public Trie2.Range next()
The main next() function for Trie2 iterators- Specified by:
next
in interfacejava.util.Iterator<Trie2.Range>
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<Trie2.Range>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<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.
-
-