org.ourgrid.common.spec
Class CodesTable

java.lang.Object
  extended by org.ourgrid.common.spec.CodesTable

public class CodesTable
extends java.lang.Object

This entity is used to manage the correct use of the common.token package entities. More specifically it will manage the type of each "word" (better saying token) read from source.


Field Summary
static int LANGUAGETYPES
           
static int OPERATOR
           
static int PARENTHERIC
           
static int POINTING
           
static int RESERVED_WORD
           
static java.lang.String STRING
           
 
Method Summary
 int getCode(java.lang.String key)
          Executes a search at the table by the given symbol key.
static CodesTable getInstance()
          Gets an instace of the CodesTable entity.
 java.util.Map<java.lang.String,java.lang.Integer> getLanguageTypes()
          A collection with language types.
 java.util.Map<java.lang.String,java.lang.Integer> getOperators()
          A collection with all the Operator symbols.
 java.util.Map<java.lang.String,java.lang.Integer> getParenthetics()
          A collection with all the Parenthetic symbols.
 java.util.Map<java.lang.String,java.lang.Integer> getPointing()
          A collection with all the Punctuation symbols.
 java.util.Map<java.lang.String,java.lang.Integer> getReservedWords()
          A collection with all the Reserved words.
 int getType(java.lang.String key)
          Returns the type of the symbol received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING

public static final java.lang.String STRING
See Also:
Constant Field Values

RESERVED_WORD

public static final int RESERVED_WORD
See Also:
Constant Field Values

OPERATOR

public static final int OPERATOR
See Also:
Constant Field Values

PARENTHERIC

public static final int PARENTHERIC
See Also:
Constant Field Values

POINTING

public static final int POINTING
See Also:
Constant Field Values

LANGUAGETYPES

public static final int LANGUAGETYPES
See Also:
Constant Field Values
Method Detail

getInstance

public static CodesTable getInstance()
Gets an instace of the CodesTable entity.

Returns:
The codesTable object.

getReservedWords

public java.util.Map<java.lang.String,java.lang.Integer> getReservedWords()
A collection with all the Reserved words.

Returns:
A Map with the table reserved words.

getOperators

public java.util.Map<java.lang.String,java.lang.Integer> getOperators()
A collection with all the Operator symbols.

Returns:
A Map with the table operator symbols.

getParenthetics

public java.util.Map<java.lang.String,java.lang.Integer> getParenthetics()
A collection with all the Parenthetic symbols.

Returns:
A Map with the table parenthetic symbols.

getLanguageTypes

public java.util.Map<java.lang.String,java.lang.Integer> getLanguageTypes()
A collection with language types.

Returns:
A Map with the table language type symbols.

getPointing

public java.util.Map<java.lang.String,java.lang.Integer> getPointing()
A collection with all the Punctuation symbols.

Returns:
A Map with the table punctuation symbols.

getCode

public int getCode(java.lang.String key)
Executes a search at the table by the given symbol key.

Parameters:
key - The symbol where the code is wanted.
Returns:
The code of the symbol (key) or 0 if it was not found.

getType

public int getType(java.lang.String key)
Returns the type of the symbol received.

Returns:
An int representing a type specified in this class from RESERVED_WORD, OPERATOR, PARENTHERIC, POINTING, SPECIALS. If the key is not found it returns 0 (zero).