public class ExpressionMerit extends AbstractMerit
DTDConstants.INIT
section. Variables that are related to the target are identified by checking
their instance against TargetDependingParameter.| Modifier and Type | Field and Description |
|---|---|
private ExpressionEvaluator |
expression
The parsable double expression.
|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASS| Constructor and Description |
|---|
ExpressionMerit(Map prop)
Constructs a new expression merit.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getInitializer()
Returns the initializer of this merit.
|
double |
getMerit(GlobalGrouping set,
Appointable target,
Collection ignore,
long within)
Returns the actual merit.
|
void |
initMerit(Object node)
Initializes the double expression.
|
createMeritaugment, augment, augment, augment, augment, clone, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, initProperties, isNew, parseObject, parseObject, reload, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringprivate ExpressionEvaluator expression
public ExpressionMerit(Map prop)
AbstractMerit.createMerit(java.util.Map<java.lang.String, java.lang.String>)
method. This create method also takes care of proper parameter
overloading and initialization of the double node.public void initMerit(Object node)
getMerit(globals.GlobalGrouping, stella.Appointable, java.util.Collection, long) method. Proper parsing is only possible if the
argument follows the generic ExpressionEvaluator specification.initMerit in interface MeritinginitMerit in class AbstractMeritnode - A String expression.public Object getInitializer()
getInitializer in interface MeritinggetInitializer in class AbstractMeritpublic double getMerit(GlobalGrouping set, Appointable target, Collection ignore, long within)
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.set - Current observing conditions.target - The actual target.ignore - All targets, observable or not.within - The relevant time span in ms.