Class ByteSequenceIterator
java.lang.Object
morfologik.fsa.ByteSequenceIterator
- All Implemented Interfaces:
Iterator<ByteBuffer>
An iterator that traverses the right language of a given node (all sequences
reachable from a given node).
-
Constructor Summary
ConstructorsConstructorDescriptionByteSequenceIterator(FSA fsa) Create an instance of the iterator iterating over all automaton sequences.ByteSequenceIterator(FSA fsa, int node) Create an instance of the iterator for a given node. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()Returnstrueif there are still elements in this iterator.next()voidremove()Not implemented in this iterator.restartFrom(int node) Restart walking fromnode.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining
-
Constructor Details
-
ByteSequenceIterator
Create an instance of the iterator iterating over all automaton sequences.- Parameters:
fsa- The automaton to iterate over.
-
ByteSequenceIterator
Create an instance of the iterator for a given node.- Parameters:
fsa- The automaton to iterate over.node- The starting node's identifier (can be theFSA.getRootNode()).
-
-
Method Details
-
restartFrom
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
- 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>
-