Class ListTerminalStream

java.lang.Object
org.oristool.lello.parse.ListTerminalStream
All Implemented Interfaces:
TerminalStream

public class ListTerminalStream extends Object implements TerminalStream
An list-based implementation of TerminalStream.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes a stream of symbols based on a list; the symbols will be received from the stream in the same order they appear in the list.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the current symbol in the stream, without advancing the cursor.
    boolean
    Tells whether there is another symbol in the stream or not.
    void
    Advances the cursor to the next symbol in the stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ListTerminalStream

      public ListTerminalStream(List<Terminal> terminals)
      Initializes a stream of symbols based on a list; the symbols will be received from the stream in the same order they appear in the list.
      Parameters:
      terminals - The list of symbols.
  • Method Details

    • getCurrent

      public Terminal getCurrent()
      Description copied from interface: TerminalStream
      Retrieves the current symbol in the stream, without advancing the cursor.
      Specified by:
      getCurrent in interface TerminalStream
      Returns:
      The current symbol.
    • moveNext

      public void moveNext()
      Description copied from interface: TerminalStream
      Advances the cursor to the next symbol in the stream.
      Specified by:
      moveNext in interface TerminalStream
    • hasNext

      public boolean hasNext()
      Description copied from interface: TerminalStream
      Tells whether there is another symbol in the stream or not.
      Specified by:
      hasNext in interface TerminalStream
      Returns:
      true if there is another symbol, false if not.