Class ByteSequenceIterator
- java.lang.Object
-
- org.apache.pinot.segment.local.utils.nativefst.ByteSequenceIterator
-
- All Implemented Interfaces:
Iterator<ByteBuffer>
public final class ByteSequenceIterator extends Object implements Iterator<ByteBuffer>
An iterator that traverses the right language of a given node (all sequences reachable from a given node).
-
-
Constructor Summary
Constructors Constructor Description ByteSequenceIterator(FST fst, int node)Create an instance of the iterator for a given node.
-
Method Summary
Modifier and Type Method Description booleanhasNext()Returnstrueif there are still elements in this iterator.ByteBuffernext()voidremove()Not implemented in this iterator.ByteSequenceIteratorrestartFrom(int node)Restart walking fromnode.-
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
-
-
-
-
Constructor Detail
-
ByteSequenceIterator
public ByteSequenceIterator(FST fst, int node)
Create an instance of the iterator for a given node.- Parameters:
fst- The automaton to iterate over.node- The starting node's identifier (can be theFST.getRootNode()).
-
-
Method Detail
-
restartFrom
public ByteSequenceIterator restartFrom(int node)
Restart walking fromnode. Allows iterator reuse.- Parameters:
node- Restart the iterator fromnode.- Returns:
- Returns
thisfor call chaining.
-
hasNext
public boolean hasNext()
Returnstrueif there are still elements in this iterator.- Specified by:
hasNextin interfaceIterator<ByteBuffer>
-
next
public ByteBuffer next()
- Specified by:
nextin interfaceIterator<ByteBuffer>- Returns:
- Returns a
ByteBufferwith the sequence corresponding to the next final state in the automaton.
-
remove
public void remove()
Not implemented in this iterator.- Specified by:
removein interfaceIterator<ByteBuffer>
-
-