Package jjparse.input

Class Input.Position

java.lang.Object
jjparse.input.Input.Position
Direct Known Subclasses:
CharacterInput.CodePointPosition
Enclosing class:
Input<T>

public abstract class Input.Position extends Object
Represents an offset within this Input. Since the unit of this offset depends on the element type of this Input, this class depends on the specific Input instance. Also note, that this offset may not reflect the Input<T>.Position as it is perceived by the user. This is, for example, the case for Inputs of Characters, where up to two Characters may form a single unicode code point. It is up to the implementation of the respective Input to interpret this offset accordingly.
Author:
Björn Lötters
See Also:
  • Field Details

    • input

      public final Input<T> input
      The Input to which this Input<T>.Position refers.
    • offset

      public final int offset
      The offset (i.e., the number of skipped elements) to which this Input<T>.Position points in this Input.
  • Constructor Details

    • Position

      public Position(int offset)
      Creates a new Input<T>.Position on basis of the provided offset.
      Parameters:
      offset - The offset of this Input<T>.Position. An offset is the number of elements that must be skipped in the underlying Input in order to reach this Input<T>.Position.
  • Method Details