Record Class CypherToken
java.lang.Object
java.lang.Record
org.impulsegraph.compiler.cypher.CypherToken
public record CypherToken(CypherTokenType type, String lexeme, int startPos, int line, int column)
extends Record
Immutable token with source location and lexeme text.
-
Constructor Summary
ConstructorsConstructorDescriptionCypherToken(CypherTokenType type, String lexeme, int startPos, int line, int column) Creates an instance of aCypherTokenrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcolumn()Returns the value of thecolumnrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.lexeme()Returns the value of thelexemerecord component.intline()Returns the value of thelinerecord component.static CypherTokenof(CypherTokenType type, String lexeme, int startPos, int line, int column) intstartPos()Returns the value of thestartPosrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
CypherToken
Creates an instance of aCypherTokenrecord class.- Parameters:
type- the value for thetyperecord componentlexeme- the value for thelexemerecord componentstartPos- the value for thestartPosrecord componentline- the value for thelinerecord componentcolumn- the value for thecolumnrecord component
-
-
Method Details
-
of
public static CypherToken of(CypherTokenType type, String lexeme, int startPos, int line, int column) -
toString
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
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
-
startPos
public int startPos()Returns the value of thestartPosrecord component.- Returns:
- the value of the
startPosrecord component
-
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
-