public class Constants
extends java.lang.Object
A named constant in an expression is substituted by its associated value when the expression is evaluated. The constants are stored in a hash table, using their names as key. The value of each constant is wrapped in a data token.
PtParser
Red (liuxj) |
Red (liuxj) |
Modifier and Type | Method and Description |
---|---|
static void |
add(java.lang.String name,
Token value)
Add a constant with the given name and value to the table.
|
static RecordToken |
constants()
Return a record representation of the constants.
|
static Token |
get(java.lang.String name)
Look up the value of the constant with the given name.
|
static void |
remove(java.lang.String name)
Remove the constant with the given name from the table.
|
static java.util.TreeMap |
types()
Return a copy of the types.
|
public static void add(java.lang.String name, Token value)
name
- The name of the constant.value
- The value of the constant, wrapped in a data token.public static RecordToken constants()
public static Token get(java.lang.String name)
name
- The name of the constant.public static void remove(java.lang.String name)
name
- The name of the constant to be removed from the table.public static java.util.TreeMap types()