Package com.ibm.icu.util
Class CharsTrie.Iterator
java.lang.Object
com.ibm.icu.util.CharsTrie.Iterator
- All Implemented Interfaces:
Iterator<CharsTrie.Entry>
- Enclosing class:
CharsTrie
Iterator for all of the (string, value) pairs in a CharsTrie.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CharSequenceprivate CharsTrie.Entryprivate intprivate intprivate intprivate intprivate intprivate booleanprivate StringBuilder -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateIterator(CharSequence trieChars, int offset, int remainingMatchLength, int maxStringLength) -
Method Summary
Modifier and TypeMethodDescriptionprivate intbranchNext(int pos, int length) booleanhasNext()next()Finds the next (string, value) pair if there is one.voidremove()Iterator.remove() is not supported.reset()Resets this iterator to its initial state.private CharsTrie.EntryMethods 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
-
chars_
-
pos_
private int pos_ -
initialPos_
private int initialPos_ -
remainingMatchLength_
private int remainingMatchLength_ -
initialRemainingMatchLength_
private int initialRemainingMatchLength_ -
skipValue_
private boolean skipValue_ -
str_
-
maxLength_
private int maxLength_ -
entry_
-
stack_
-
-
Constructor Details
-
Iterator
-
-
Method Details
-
reset
Resets this iterator to its initial state.- Returns:
- this
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator<CharsTrie.Entry>- Returns:
- true if there are more elements.
-
next
Finds the next (string, value) pair if there is one. If the string is truncated to the maximum length and does not have a real value, then the value is set to -1. In this case, this "not a real value" is indistinguishable from a real value of -1.- Specified by:
nextin interfaceIterator<CharsTrie.Entry>- Returns:
- An Entry with the string and value of the next element.
- Throws:
NoSuchElementException- - iteration has no more elements.
-
remove
public void remove()Iterator.remove() is not supported.- Specified by:
removein interfaceIterator<CharsTrie.Entry>- Throws:
UnsupportedOperationException- (always)
-
truncateAndStop
-
branchNext
private int branchNext(int pos, int length)
-