org.xlattice.corexml.expr
Class Symbol

java.lang.Object
  extended by org.xlattice.corexml.expr.Symbol
All Implemented Interfaces:
Token

public class Symbol
extends java.lang.Object
implements Token

These are a subset of what rule [28] calls ExprToken but with the addition of left and right curly brackets (braces), the colon, the dollar sign, and possibly other symbols.

Author:
Jim Dixon

Field Summary
static java.lang.String ALL_ONE_CHAR_SYMBOLS
          all 1-char symbols, including those which start other symbols
static int AT
           
static int COLON
           
static int COMMA
           
static int DCOLON
           
static int DDOT
           
static int DOLLAR
           
static int DOT
           
static int LBRACE
           
static int LBRACKET
           
static int LPAREN
           
static int RBRACE
           
static int RBRACKET
           
static int RPAREN
           
static java.lang.String SINGLE_CHAR_SYMBOLS
          those symbols which only appear in one form
static int STAR
           
static java.lang.String[] SYMBOLS
          list of the symbols in string form in the same order
 
Constructor Summary
Symbol(char c)
          Create a Symbol from its one-character form.
Symbol(java.lang.String sym)
          Create a Symbol given its String form.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getIndex()
           
 int hashCode()
           
static boolean isSingleCharSymbol(char c)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LPAREN

public static final int LPAREN
See Also:
Constant Field Values

RPAREN

public static final int RPAREN
See Also:
Constant Field Values

LBRACKET

public static final int LBRACKET
See Also:
Constant Field Values

RBRACKET

public static final int RBRACKET
See Also:
Constant Field Values

LBRACE

public static final int LBRACE
See Also:
Constant Field Values

RBRACE

public static final int RBRACE
See Also:
Constant Field Values

AT

public static final int AT
See Also:
Constant Field Values

COMMA

public static final int COMMA
See Also:
Constant Field Values

DOLLAR

public static final int DOLLAR
See Also:
Constant Field Values

STAR

public static final int STAR
See Also:
Constant Field Values

DOT

public static final int DOT
See Also:
Constant Field Values

COLON

public static final int COLON
See Also:
Constant Field Values

DDOT

public static final int DDOT
See Also:
Constant Field Values

DCOLON

public static final int DCOLON
See Also:
Constant Field Values

SYMBOLS

public static final java.lang.String[] SYMBOLS
list of the symbols in string form in the same order


SINGLE_CHAR_SYMBOLS

public static final java.lang.String SINGLE_CHAR_SYMBOLS
those symbols which only appear in one form

See Also:
Constant Field Values

ALL_ONE_CHAR_SYMBOLS

public static final java.lang.String ALL_ONE_CHAR_SYMBOLS
all 1-char symbols, including those which start other symbols

See Also:
Constant Field Values
Constructor Detail

Symbol

public Symbol(char c)
Create a Symbol from its one-character form.

Throws:
java.lang.IllegalStateException - if it isn't a valid symbol.

Symbol

public Symbol(java.lang.String sym)
Create a Symbol given its String form.

Method Detail

isSingleCharSymbol

public static boolean isSingleCharSymbol(char c)
Returns:
true if the character is a symbol and does not start a multi-character symbol

getIndex

public int getIndex()
Returns:
the index of this symbol

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object