Record Class CharPos
java.lang.Object
java.lang.Record
com.jozufozu.flywheel.core.source.span.CharPos
A position in a file.
-
Constructor Summary
ConstructorsConstructorDescriptionCharPos(int pos, int line, int col) Creates an instance of aCharPosrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcol()Returns the value of thecolrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intline()Returns the value of thelinerecord component.intpos()Returns the value of theposrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CharPos
public CharPos(int pos, int line, int col) Creates an instance of aCharPosrecord class.- Parameters:
pos- the value for theposrecord componentline- the value for thelinerecord componentcol- the value for thecolrecord component
-
-
Method Details
-
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. -
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. -
equals
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 '=='. -
pos
public int pos()Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
line
public int line()Returns the value of thelinerecord component.- Returns:
- the value of the
linerecord component
-
col
public int col()Returns the value of thecolrecord component.- Returns:
- the value of the
colrecord component
-