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

      • 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>
      • remove

        public void remove()
        Not implemented in this iterator.
        Specified by:
        remove in interface Iterator<ByteBuffer>