Record Class Point

java.lang.Object
java.lang.Record
io.github.treesitter.jtreesitter.Point
Record Components:
row - The zero-based row of the document.
column - The zero-based column of the document.
All Implemented Interfaces:
Comparable<Point>

public record Point(int row, int column) extends Record implements Comparable<Point>
A position in a text document in terms of rows and columns.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Point
    The maximum value a Point can have.
    static final Point
    The minimum value a Point can have.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Point(int row, int column)
    Creates an instance of a Point record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the column record component.
    int
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    row()
    Returns the value of the row record component.
    Returns a string representation of this record class.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • MIN

      public static final Point MIN
      The minimum value a Point can have.
    • MAX

      public static final Point MAX
      The maximum value a Point can have.
  • Constructor Details

    • Point

      public Point(@Unsigned int row, @Unsigned int column)
      Creates an instance of a Point record class.
      Parameters:
      row - the value for the row record component
      column - the value for the column record component
  • Method Details

    • compareTo

      public int compareTo(Point other)
      Specified by:
      compareTo in interface Comparable<Point>
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • row

      @Unsigned public int row()
      Returns the value of the row record component.
      Returns:
      the value of the row record component
    • column

      @Unsigned public int column()
      Returns the value of the column record component.
      Returns:
      the value of the column record component