Class PositionTracker

java.lang.Object
io.jawk.intermediate.PositionTracker

public class PositionTracker extends Object
Marks a position within the tuple list (queue).
Author:
Danny Daglas
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a tracker positioned at the first tuple in the queue.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the current typed tuple.
    int
    Returns the current tuple index.
    boolean
    Indicates whether the tracker has moved past the last tuple.
    void
    jump(int index)
    Jumps directly to the tuple at the supplied queue index.
    void
    jump(Address address)
    Jumps directly to the tuple identified by the supplied address.
    int
    Returns the source line number associated with the current tuple.
    void
    Advances to the next tuple in sequence.
    Returns the opcode of the current tuple.
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PositionTracker

      public PositionTracker(List<Tuple> queue)
      Creates a tracker positioned at the first tuple in the queue.
      Parameters:
      queue - Tuple stream to traverse
  • Method Details

    • isEOF

      public boolean isEOF()
      Indicates whether the tracker has moved past the last tuple.
      Returns:
      true when no current tuple remains
    • next

      public void next()
      Advances to the next tuple in sequence.
    • jump

      public void jump(Address address)
      Jumps directly to the tuple identified by the supplied address.
      Parameters:
      address - Address to jump to
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • opcode

      public Opcode opcode()
      Returns the opcode of the current tuple.
      Returns:
      Current opcode
    • lineNumber

      public int lineNumber()
      Returns the source line number associated with the current tuple.
      Returns:
      Tuple source line number
    • currentIndex

      public int currentIndex()
      Returns the current tuple index.
      Returns:
      Current queue index
    • current

      public Tuple current()
      Returns the current typed tuple.
      Returns:
      current tuple
    • jump

      public void jump(int index)
      Jumps directly to the tuple at the supplied queue index.
      Parameters:
      index - Tuple index to jump to