Class Position

java.lang.Object
cruise.umple.parser.Position

public class Position
extends java.lang.Object
Used to indicate the coordinates of a position when parsing. This is done by keeping track of the filename, the line number and the corresponding offset on that line number.
  • Constructor Summary

    Constructors 
    Constructor Description
    Position​(int aLineNumber, int aCharacterOffset, int aOffset)  
    Position​(java.lang.String aFilename, int aLineNumber, int aCharacterOffset, int aOffset)  
  • Method Summary

    Modifier and Type Method Description
    Position add​(Position more)  
    Position copy()  
    void delete()  
    boolean equals​(java.lang.Object obj)  
    int getCharacterOffset()
    The character offset of the position.
    java.lang.String getFilename()
    The filename of the position.
    int getLineNum()
    extract the line number of the position
    int getLineNumber()
    The line number of the position.
    int getOffset()
    The offset of the position.
    int hashCode()  
    boolean setCharacterOffset​(int aCharacterOffset)  
    boolean setFilename​(java.lang.String aFilename)  
    boolean setLineNumber​(int aLineNumber)  
    boolean setOffset​(int aOffset)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

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

    • Position

      public Position​(java.lang.String aFilename, int aLineNumber, int aCharacterOffset, int aOffset)
    • Position

      public Position​(int aLineNumber, int aCharacterOffset, int aOffset)
  • Method Details

    • setFilename

      public boolean setFilename​(java.lang.String aFilename)
    • setLineNumber

      public boolean setLineNumber​(int aLineNumber)
    • setCharacterOffset

      public boolean setCharacterOffset​(int aCharacterOffset)
    • setOffset

      public boolean setOffset​(int aOffset)
    • getFilename

      public java.lang.String getFilename()
      The filename of the position.
    • getLineNumber

      public int getLineNumber()
      The line number of the position.
    • getCharacterOffset

      public int getCharacterOffset()
      The character offset of the position.
    • getOffset

      public int getOffset()
      The offset of the position.
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • delete

      public void delete()
    • copy

      public Position copy()
    • add

      public Position add​(Position more)
    • getLineNum

      public int getLineNum()
      extract the line number of the position
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object