Package ch.usi.si.seart.treesitter
Class Point
- java.lang.Object
-
- ch.usi.si.seart.treesitter.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 Summary
Constructors Constructor Description Point()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisOrigin()Checks if this point represents the origin, which is when both the row and the column are zero.StringtoString()Returns a string representation of this point in the format:
-
-
-
Method Detail
-
toString
public String toString()
Returns a string representation of this point in the format:row:column
-
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
-
-