Package io.jawk.intermediate
Class PositionTracker
java.lang.Object
io.jawk.intermediate.PositionTracker
Marks a position within the tuple list (queue).
- Author:
- Danny Daglas
-
Constructor Summary
ConstructorsConstructorDescriptionPositionTracker(List<Tuple> queue) Creates a tracker positioned at the first tuple in the queue. -
Method Summary
Modifier and TypeMethodDescriptioncurrent()Returns the current typed tuple.intReturns the current tuple index.booleanisEOF()Indicates whether the tracker has moved past the last tuple.voidjump(int index) Jumps directly to the tuple at the supplied queue index.voidJumps directly to the tuple identified by the supplied address.intReturns the source line number associated with the current tuple.voidnext()Advances to the next tuple in sequence.opcode()Returns the opcode of the current tuple.toString()
-
Constructor Details
-
PositionTracker
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:
truewhen no current tuple remains
-
next
public void next()Advances to the next tuple in sequence. -
jump
Jumps directly to the tuple identified by the supplied address.- Parameters:
address- Address to jump to
-
toString
-
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
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
-