java.lang.Object
java.lang.Record
org.kink_lang.kink.internal.program.lex.EotToken
- Record Components:
textLength
- the length of the program text.
- All Implemented Interfaces:
Token
A special token which indicates the end-of-text.
The token is always on the end of the program text, and is zero-width. Thus getTextLength, getStartPos, and getEndPos always the return equal value.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
endPos()
Returns the position index on which the token ends.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
startPos()
Returns the position index on which the token starts.int
Returns the value of thetextLength
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
EotToken
public EotToken(int textLength) Creates an instance of aEotToken
record class.- Parameters:
textLength
- the value for thetextLength
record component
-
-
Method Details
-
startPos
public int startPos()Description copied from interface:Token
Returns the position index on which the token starts. -
endPos
public int endPos()Description copied from interface:Token
Returns the position index on which the token ends. -
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 '=='. -
textLength
public int textLength()Returns the value of thetextLength
record component.- Returns:
- the value of the
textLength
record component
-