Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Test tokens for equality.
|
static TokenCharacter |
get(int ch)
Create a token for the specified character.
|
static TokenCharacter |
get(int ch,
java.util.Collection<ParserAttribute> attributes)
Create a token for the specified character.
|
static TokenCharacter |
get(int ch,
ParserAttribute attribute)
Create a token for the specified character.
|
int |
getCodepoint()
Return the codepoint value of this token (its character codepoint)
|
java.lang.String |
getValue()
Return the value of this token (its character).
|
int |
hashCode()
Assure that equal tokens return the same hash code.
|
boolean |
matches(java.lang.String input)
Does this token match this string?
|
boolean |
matches(Token input)
Does this token match the input?
|
java.lang.String |
toString()
Pretty print a token.
|
addAttribute, addAttributes, getAttribute, getAttributes, getAttributesMap, getAttributeValue, hasAttribute
public static TokenCharacter get(int ch)
ch
- the characterpublic static TokenCharacter get(int ch, ParserAttribute attribute)
ch
- the characterattribute
- the attributepublic static TokenCharacter get(int ch, java.util.Collection<ParserAttribute> attributes)
ch
- the characterattributes
- the attributespublic java.lang.String getValue()
public int getCodepoint()
public boolean matches(Token input)
This token matches other token characters
that have the same
character as well as TokenStrings
that are one character long and
contain the same character.
public boolean matches(java.lang.String input)
input
- the input string.public boolean equals(java.lang.Object obj)
Two tokens are equal if they represent the same character.
equals
in class java.lang.Object
obj
- An object.obj
is equal to this terminal character.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object