Package morfologik.fsa
Class ByteSequenceIterator
- java.lang.Object
-
- morfologik.fsa.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(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Returnstrue
if there are still elements in this iterator.ByteBuffer
next()
void
remove()
Not implemented in this iterator.ByteSequenceIterator
restartFrom(int node)
Restart walking fromnode
.
-
-
-
Constructor Detail
-
ByteSequenceIterator
public ByteSequenceIterator(FSA fsa)
Create an instance of the iterator iterating over all automaton sequences.- Parameters:
fsa
- The automaton to iterate over.
-
ByteSequenceIterator
public ByteSequenceIterator(FSA fsa, int node)
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 Detail
-
restartFrom
public ByteSequenceIterator restartFrom(int node)
Restart walking fromnode
. Allows iterator reuse.- Parameters:
node
- Restart the iterator fromnode
.- Returns:
- Returns
this
for call chaining.
-
hasNext
public boolean hasNext()
Returnstrue
if there are still elements in this iterator.- Specified by:
hasNext
in interfaceIterator<ByteBuffer>
-
next
public ByteBuffer next()
- Specified by:
next
in interfaceIterator<ByteBuffer>
- Returns:
- Returns a
ByteBuffer
with the sequence corresponding to the next final state in the automaton.
-
remove
public void remove()
Not implemented in this iterator.- Specified by:
remove
in interfaceIterator<ByteBuffer>
-
-