| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Test tokens for equality.
|
static TokenString |
get(java.lang.String value)
Create a token for the specified string.
|
static TokenString |
get(java.lang.String value,
java.util.Collection<ParserAttribute> attributes)
Create a token for the specified string (with attributes)
|
static TokenString |
get(java.lang.String value,
ParserAttribute attribute)
Create a token for the specified string (with an attribute)
|
java.lang.String |
getValue()
Get the string.
|
int |
hashCode()
Assure that equal tokens return the same hash code.
|
boolean |
matches(char input)
Does this toke match this character?
|
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, hasAttributepublic static TokenString get(java.lang.String value)
value - the stringpublic static TokenString get(java.lang.String value, ParserAttribute attribute)
value - the stringattribute - the attributepublic static TokenString get(java.lang.String value, java.util.Collection<ParserAttribute> attributes)
value - the stringattributes - the attributespublic java.lang.String getValue()
public boolean matches(Token input)
This token matches other token strings that have the same
underlying string. If this is a single character string, it will also match
TokenCharacters that are defined with the same character.
public boolean matches(char input)
input - the character.public boolean matches(java.lang.String input)
input - the string.public boolean equals(java.lang.Object obj)
Two tokens are equal if they represent the same string.
equals in class java.lang.Objectobj - An object.obj is equal to this terminal character.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object