jfun.parsec.tokens
Class TypedToken<Type>
java.lang.Object
jfun.parsec.tokens.NamedToken
jfun.parsec.tokens.TypedToken<Type>
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- TokenDecimal, TokenInteger, TokenReserved, TokenWord
public class TypedToken<Type>
- extends NamedToken
Represents a token associated with a token type.
- Since:
- version 1.1
- Author:
- Ben Yu
Apr 27, 2006 8:01:19 PM
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
TypedToken
public TypedToken(java.lang.String name,
Type type)
getText
public final java.lang.String getText()
- Get the text of the token. Equivalent to
NamedToken.getName()
.
- Since:
- version 0.6
getType
public Type getType()
- To get the data type of the token.
equals
public boolean equals(TypedToken other)
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class NamedToken
hashCode
public int hashCode()
- Overrides:
hashCode
in class NamedToken