name.angoca.db2sa.core.lexical
Class Token

Package class diagram package Token
java.lang.Object
  extended by name.angoca.db2sa.core.lexical.Token

public class Token
extends Object

This is the representation of the decomposition of a phrase in several words or symbols. Each token is the product of dividing the given phrase and tokenize it in spaces, parenthesis and single and double quotation marks. TODO is reserved?
Control Version

Version:
1.0.0 2009-07-19
Author:
Andres Gomez Casanova (AngocA)

Constructor Summary
Token(String token)
          Constructor of a token, giving the value of it.
 
Method Summary
 boolean equals(Object object)
           
 String getToken()
          Returns the value that this token represents.
 int hashCode()
           
 String toString()
          Returns a string representation of a token.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Token

public Token(String token)
      throws InvalidTokenException
Constructor of a token, giving the value of it. A token cannot be a empty string.

Parameters:
token - Value to represent.
Throws:
InvalidTokenException - When trying to create an invalid token.
Method Detail

equals

public final boolean equals(Object object)
Overrides:
equals in class Object

getToken

public final String getToken()
Returns the value that this token represents.

Returns:
the value that this token represents.

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

toString

public final String toString()
Returns a string representation of a token. The representation is: T[token]

Overrides:
toString in class Object
Returns:
String representation of a token.
See Also:
Object.toString()


Andres Gomez Casanova (AngocA) Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.