|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectstella.util.ExpressionEvaluator
public class ExpressionEvaluator
An arbitrary expression that is parseable to a single number or a boolean at
run-time. Variables that are related to the target are identified by
checking
their instance against TargetDependingParameter. Constants may
be specified in the basic properties of the evaluator.
| Field Summary | |
|---|---|
private ExpressionNode |
expression
The parsable double expression. |
private String |
root
The string used for parsing. |
| Constructor Summary | |
|---|---|
ExpressionEvaluator(String init)
Constructs a new expression evaluator. |
|
| Method Summary | |
|---|---|
Boolean |
calculateBoolean(ParameterClustering set)
Returns the actual value of the expression if the target is of no importance. |
Boolean |
calculateBoolean(ParameterClustering set,
TargetDefinition target,
Map<String,Object> base)
Returns the actual value of the expression. |
Number |
calculateNumber(ParameterClustering set)
Returns the actual value of the expression if the target is of no importance. |
Number |
calculateNumber(ParameterClustering set,
TargetDefinition target,
Map<String,Object> base)
Returns the actual value of the expression. |
private String |
fillExpression(ParameterClustering set,
TargetDefinition target,
Map<String,Object> base)
|
ExpressionNode |
getExpression()
Returns the initial expression. |
void |
initEvaluator(String node)
Initializes the expression. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private transient ExpressionNode expression
private String root
| Constructor Detail |
|---|
public ExpressionEvaluator(String init)
| Method Detail |
|---|
public void initEvaluator(String node)
#evaluate method. Proper parsing is only possible if the
argument follows the generic ExpressionNode specification.
node - A String expression.public Number calculateNumber(ParameterClustering set)
public Boolean calculateBoolean(ParameterClustering set)
public Number calculateNumber(ParameterClustering set,
TargetDefinition target,
Map<String,Object> base)
TargetDependingParameters are evaluted using the
target definition. Variable names must either be substitutable from the
parameter cluster handed over or specified as constants in the
DTDConstants.CONSTANT
section of the merit. The sequence of parameter
substitution first looks up the merit's constant. Only if the variable
is not a defined constant, it is evaluated using the parameter set.
public Boolean calculateBoolean(ParameterClustering set,
TargetDefinition target,
Map<String,Object> base)
TargetDependingParameters are evaluted using the
target definition. Variable names must either be substitutable from the
parameter cluster handed over or specified as constants in the
DTDConstants.CONSTANT
section of the merit. The sequence of parameter
substitution first looks up the merit's constant. Only if the variable
is not a defined constant, it is evaluated using the parameter set.
private String fillExpression(ParameterClustering set,
TargetDefinition target,
Map<String,Object> base)
public ExpressionNode getExpression()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||