Class Position

java.lang.Object
org.variantsync.boosting.position.Position
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FilePosition, LinePosition, RootPosition, UnspecifiedPosition

public abstract class Position extends Object implements Serializable
Represents a position in a file, line, or root. This abstract class provides methods for creating a Position object from a serialized string, as well as methods for getting the hash code, checking equality, serializing the position, getting the file path, line number, and column number.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract int
    Returns the column number of the Position object.
    abstract boolean
    Checks if the Position object is equal to another object.
    abstract Path
    Returns the file path of the Position object.
    static Position
    fromSerializedPosition(String[] serializedPosition)
    Creates a Position object from a serialized string.
    abstract int
    Returns the hash code of the Position object.
    abstract int
    Returns the line number of the Position object.
    abstract String[]
    Serializes the Position object into an array of strings.

    Methods inherited from class java.lang.Object

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

    • Position

      public Position()
  • Method Details

    • fromSerializedPosition

      public static Position fromSerializedPosition(String[] serializedPosition)
      Creates a Position object from a serialized string.
      Parameters:
      serializedPosition - an array of strings representing the serialized position
      Returns:
      a Position object based on the serialized string
      Throws:
      IllegalArgumentException - if the type in the serialized string is not recognized
    • hashCode

      public abstract int hashCode()
      Returns the hash code of the Position object. Must be implemented by subclass.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code of the Position object
    • equals

      public abstract boolean equals(Object obj)
      Checks if the Position object is equal to another object. Must be implemented by subclass.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare with
      Returns:
      true if the objects are equal, false otherwise
    • serializedPosition

      public abstract String[] serializedPosition()
      Serializes the Position object into an array of strings.
      Returns:
      an array of strings representing the serialized position
    • filePath

      public abstract Path filePath()
      Returns the file path of the Position object.
      Returns:
      the file path of the Position object
    • lineNumber

      public abstract int lineNumber()
      Returns the line number of the Position object.
      Returns:
      the line number of the Position object
    • columnNumber

      public abstract int columnNumber()
      Returns the column number of the Position object.
      Returns:
      the column number of the Position object