Class Position

java.lang.Object
com.aquima.interactions.expressions.Position
All Implemented Interfaces:
Serializable

public class Position extends Object implements Serializable
This class contains the position information of a parsed node.
Since:
6.0
Author:
F. van der Meer, O. Kerpershoek
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Position(int offset, int lineNumber, int column, String unitName)
    Constructs the position information with the required arguments.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    This method returns the column in the line of the parsed unit.
    int
    This method returns the line number of the parsed unit.
    int
    This method returns the global offset.
    This method returns a string containing all the position information.
    This method returns the name of the parsed unit.
     

    Methods inherited from class java.lang.Object

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

    • Position

      public Position(int offset, int lineNumber, int column, String unitName)
      Constructs the position information with the required arguments.
      Parameters:
      offset - The global offset of the parsed unit.
      lineNumber - The line number of the parsed unit.
      column - The column number in the line of the parsed unit.
      unitName - The name of the parsed unit.
  • Method Details

    • getOffset

      public int getOffset()
      This method returns the global offset. The global offset is the position from the start of the parsed unit.
      Returns:
      The global offset of the parsed unit.
    • getLineNumber

      public int getLineNumber()
      This method returns the line number of the parsed unit.
      Returns:
      the line number of the parsed unit.
    • getColumn

      public int getColumn()
      This method returns the column in the line of the parsed unit.
      Returns:
      the column in the line of the parsed unit.
    • getUnitName

      public String getUnitName()
      This method returns the name of the parsed unit. The unit name is usually the name of the parsed file or expression.
      Returns:
      the name of the parsed unit.
    • getString

      public String getString()
      This method returns a string containing all the position information.
      Returns:
      a string containing all the position information.
    • toString

      public String toString()
      Overrides:
      toString in class Object