Class Point


  • public class Point
    extends Object
    Represents a two-dimensional point with row and column coordinates. Points are an alternative to byte ranges, and as such are used to represent more human-friendly positions of tree nodes within source code. Although node positions within files should never be negative, instances of this class can be created with negative row and column values for other purposes, such as denoting repositioning offsets.
    Since:
    1.0.0
    Author:
    Ozren Dabić
    • Constructor Detail

      • Point

        public Point()
    • Method Detail

      • toString

        public String toString()
        Returns a string representation of this point in the format:
        
              row:column
         
        Overrides:
        toString in class Object
        Returns:
        A string representation of this point
      • isOrigin

        public boolean isOrigin()
        Checks if this point represents the origin, which is when both the row and the column are zero. In byte range terms, this point also corresponds to zero.
        Returns:
        true if this is an origin point, false otherwise