Record Class Token<T>
java.lang.Object
java.lang.Record
io.github.protasm.jvmud.compiler.token.Token<T>
-
Constructor Summary
ConstructorsConstructorDescriptionToken(TokenType type, String lexeme, T literal, SourceSpan span) Creates an instance of aTokenrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intlength()lexeme()Returns the value of thelexemerecord component.intline()literal()Returns the value of theliteralrecord component.span()Returns the value of thespanrecord component.toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Token
Creates an instance of aTokenrecord class.- Parameters:
type- the value for thetyperecord componentlexeme- the value for thelexemerecord componentliteral- the value for theliteralrecord componentspan- the value for thespanrecord component
-
-
Method Details
-
length
public int length() -
literalType
-
toString
-
line
public int line() -
hashCode
-
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 withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
lexeme
Returns the value of thelexemerecord component.- Returns:
- the value of the
lexemerecord component
-
literal
Returns the value of theliteralrecord component.- Returns:
- the value of the
literalrecord component
-
span
Returns the value of thespanrecord component.- Returns:
- the value of the
spanrecord component
-