Class FilePosition

java.lang.Object
org.variantsync.boosting.position.Position
org.variantsync.boosting.position.FilePosition
All Implemented Interfaces:
Serializable

public class FilePosition extends Position
Represents the location of a file.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new FilePosition object with the specified file path.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the column number associated with the FilePosition object.
    boolean
    Compares this FilePosition object with the specified object for equality.
    Returns the file path as a Path object.
    int
    Returns the hash code value for the FilePosition object.
    int
    Returns the line number associated with the FilePosition object.
    Returns a serialized representation of the FilePosition object.

    Methods inherited from class org.variantsync.boosting.position.Position

    fromSerializedPosition

    Methods inherited from class java.lang.Object

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

    • FilePosition

      public FilePosition(String path)
      Constructs a new FilePosition object with the specified file path.
      Parameters:
      path - The path of the file
  • Method Details

    • equals

      public boolean equals(Object o)
      Compares this FilePosition object with the specified object for equality.
      Specified by:
      equals in class Position
      Parameters:
      o - The object to compare with
      Returns:
      true if the objects are equal, false otherwise
    • serializedPosition

      public String[] serializedPosition()
      Returns a serialized representation of the FilePosition object.
      Specified by:
      serializedPosition in class Position
      Returns:
      An array containing the type "FILE" and the file path
    • filePath

      public Path filePath()
      Returns the file path as a Path object.
      Specified by:
      filePath in class Position
      Returns:
      The file path as a Path object
    • lineNumber

      public int lineNumber()
      Returns the line number associated with the FilePosition object.
      Specified by:
      lineNumber in class Position
      Returns:
      -1 as line number is not applicable for file positions
    • columnNumber

      public int columnNumber()
      Returns the column number associated with the FilePosition object.
      Specified by:
      columnNumber in class Position
      Returns:
      -1 as column number is not applicable for file positions
    • hashCode

      public int hashCode()
      Returns the hash code value for the FilePosition object.
      Specified by:
      hashCode in class Position
      Returns:
      The hash code value for the object based on the file path