Package dev.omnist.schema
Record Class OsdLexer.Token
java.lang.Object
java.lang.Record
dev.omnist.schema.OsdLexer.Token
- Record Components:
type- the token categorytext- the raw source text matched, or the unescaped string content for STRING tokensline- 1-based source line number at the start of this tokencol- 1-based source column number at the start of this token
- Enclosing class:
OsdLexer
public static record OsdLexer.Token(OsdLexer.TokenType type, String text, int line, int col)
extends Record
An individual token produced by
OsdLexer.-
Constructor Summary
ConstructorsConstructorDescriptionToken(OsdLexer.TokenType type, String text, int line, int col) Creates an instance of aTokenrecord 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.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord 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
-