Condition
Use extensions of this class to monitor a set of objects for potentially relevant objects.
A Condition uses one or more
ConditionTrigger extentions and a
Predicate extension. When the type of object that is assigned to a
ConditionTrigger
appears, the Condition evaluates the object using the Predicate. If the Predicate returns the value
true, the
ConditionTrigger
stops monitoring other objects, the Condition holds the object, and sets its
Satisfied property to
true.
If the Predicate returns the value false, the Condition sets its Satisfied property to false and continues monitoring the set of objects.
This class has CSOCondition as a subclass.
Example:
Condition<String> cnd = new Condition<String>();
cnd.setDesc("A string containing \"Cat\"");
LookupConditionTrigger<String> cndTrigger =
new LookupConditionTrigger<String>(String.class);
cnd.setTriggers(Collections.singleton(cndTrigger));
cnd.setPredicate(new Predicate<String>() {
@Override
public boolean evaluate(String string) {
if (string.contains("Cat")) {
return true;
}
return false;
}
});
Online API:
For coding specifics, see the Simcenter STAR-CCM+ Help menu: