morfologik.fsa.core
Class FSAFinalStatesIterator

java.lang.Object
  extended by morfologik.fsa.core.FSAFinalStatesIterator
All Implemented Interfaces:
java.util.Iterator

public final class FSAFinalStatesIterator
extends java.lang.Object
implements java.util.Iterator

An iterator that traverses all final states reachable from a given FSA.Node and returns String objects corresponding to final states.


Method Summary
 boolean hasNext()
          Returns true if there are still elements in this iterator.
 java.lang.Object next()
          Overriden from Iterator.
 byte[] nextState()
          Returns the next available element.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasNext

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

Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Overriden from Iterator. Use nextState() if you can to avoid cast.

Specified by:
next in interface java.util.Iterator
Returns:
Returns byte[] with the next final state in the automaton.

nextState

public byte[] nextState()
Returns the next available element.

Throws:
java.util.NoSuchElementException - If this method is called after hasNext() returned false.

remove

public final void remove()
Specified by:
remove in interface java.util.Iterator