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 Details

    • 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 the FSA.getRootNode()).
  • Method Details

    • restartFrom

      public ByteSequenceIterator restartFrom(int node)
      Restart walking from node. Allows iterator reuse.
      Parameters:
      node - Restart the iterator from node.
      Returns:
      Returns this for call chaining.
    • hasNext

      public boolean hasNext()
      Returns true if there are still elements in this iterator.
      Specified by:
      hasNext in interface Iterator<ByteBuffer>
    • next

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