Package de.firemage.autograder.span
Record Class Position
java.lang.Object
java.lang.Record
de.firemage.autograder.span.Position
- Record Components:
line- the line number, starting at 0column- the column, starting at 0
- All Implemented Interfaces:
Comparable<Position>
Represents a position in a file.
-
Constructor Summary
ConstructorsConstructorDescriptionPosition(int line, int column) Creates an instance of aPositionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcolumn()Returns the value of thecolumnrecord component.intfinal booleanIndicates whether some other object is "equal to" this one.static PositionfromOffset(int offset, CharSequence string) final inthashCode()Returns a hash code value for this object.intline()Returns the value of thelinerecord component.intoffset(CharSequence string) toString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
fromOffset
-
offset
-
compareTo
- Specified by:
compareToin interfaceComparable<Position>
-
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 '=='. -
line
public int line()Returns the value of thelinerecord component.- Returns:
- the value of the
linerecord component
-
column
public int column()Returns the value of thecolumnrecord component.- Returns:
- the value of the
columnrecord component
-