civquest.parser.condition
Class ComplexConditionParser
java.lang.Object
civquest.parser.condition.ConditionParser
civquest.parser.condition.ComplexConditionParser
- public class ComplexConditionParser
- extends ConditionParser
A ComplexConditionParser can parse condition expressions with
an arbitrary number of variables. This flexibility comes at
the cost of a slightly slower evaluation process.
Field Summary |
protected java.util.Hashtable |
env
|
Fields inherited from class civquest.parser.condition.ConditionParser |
current, err, expr, OP_AND, OP_EQ, OP_GE, OP_GT, OP_LE, OP_LT, OP_OR, tokenizer, tree |
Method Summary |
void |
bind(java.lang.String name,
int val)
Binds a value to a variable name. |
int |
getBinding(java.lang.String name)
Gets the value for a bound variable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
env
protected java.util.Hashtable env
ComplexConditionParser
public ComplexConditionParser(java.lang.String expr)
bind
public void bind(java.lang.String name,
int val)
- Description copied from class:
ConditionParser
- Binds a value to a variable name. Note that a concrete ConditionParser
may have other preferred means for this.
- Specified by:
bind
in class ConditionParser
- Parameters:
name
- The name of the variable to be boundval
- The value to bind to the name
getBinding
public int getBinding(java.lang.String name)
- Description copied from class:
ConditionParser
- Gets the value for a bound variable. Note that a concrete ConditionParser
may have other preferred means for this.
- Specified by:
getBinding
in class ConditionParser
- Parameters:
name
- The name of the variable
- Returns:
- the current value for the variable