morfologik.fsa
Class FSAFinalStatesIterator

java.lang.Object
  extended by morfologik.fsa.FSAFinalStatesIterator
All Implemented Interfaces:
java.util.Iterator<java.nio.ByteBuffer>

public final class FSAFinalStatesIterator
extends java.lang.Object
implements java.util.Iterator<java.nio.ByteBuffer>

An iterator that traverses the right language of a given node (all sequences reachable from a given node).


Constructor Summary
FSAFinalStatesIterator(FSA fsa, int node)
          Create an instance of the iterator for a given node.
 
Method Summary
 boolean hasNext()
          Returns true if there are still elements in this iterator.
 java.nio.ByteBuffer next()
           
 void remove()
          Not implemented in this iterator.
 void restartFrom(int node)
          Restart walking from node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSAFinalStatesIterator

public FSAFinalStatesIterator(FSA fsa,
                              int node)
Create an instance of the iterator for a given node.

Method Detail

restartFrom

public void restartFrom(int node)
Restart walking from node. Allows iterator reuse.


hasNext

public boolean hasNext()
Returns true if there are still elements in this iterator.

Specified by:
hasNext in interface java.util.Iterator<java.nio.ByteBuffer>

next

public java.nio.ByteBuffer next()
Specified by:
next in interface java.util.Iterator<java.nio.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 interface java.util.Iterator<java.nio.ByteBuffer>