Package com.ibm.icu.util
Class BytesTrie.Iterator
java.lang.Object
com.ibm.icu.util.BytesTrie.Iterator
- All Implemented Interfaces:
Iterator<BytesTrie.Entry>
- Enclosing class:
BytesTrie
Iterator for all of the (byte sequence, value) pairs in a BytesTrie.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
private BytesTrie.Entry
private int
private int
private int
private int
private int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Iterator
(byte[] trieBytes, int offset, int remainingMatchLength, int maxStringLength) -
Method Summary
Modifier and TypeMethodDescriptionprivate int
branchNext
(int pos, int length) boolean
hasNext()
next()
Finds the next (byte sequence, value) pair if there is one.void
remove()
Iterator.remove() is not supported.reset()
Resets this iterator to its initial state.private BytesTrie.Entry
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
bytes_
private byte[] bytes_ -
pos_
private int pos_ -
initialPos_
private int initialPos_ -
remainingMatchLength_
private int remainingMatchLength_ -
initialRemainingMatchLength_
private int initialRemainingMatchLength_ -
maxLength_
private int maxLength_ -
entry_
-
stack_
-
-
Constructor Details
-
Iterator
private Iterator(byte[] trieBytes, int offset, int remainingMatchLength, int maxStringLength)
-
-
Method Details
-
reset
Resets this iterator to its initial state.- Returns:
- this
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<BytesTrie.Entry>
- Returns:
- true if there are more elements.
-
next
Finds the next (byte sequence, value) pair if there is one. If the byte sequence 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:
next
in interfaceIterator<BytesTrie.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:
remove
in interfaceIterator<BytesTrie.Entry>
- Throws:
UnsupportedOperationException
- (always)
-
truncateAndStop
-
branchNext
private int branchNext(int pos, int length)
-