Class ConstraintEvaluator
- java.lang.Object
- 
- jadex.rules.rulesystem.rete.constraints.ConstraintEvaluator
 
- 
- All Implemented Interfaces:
- IConstraintEvaluator
 
 public class ConstraintEvaluator extends java.lang.Object implements IConstraintEvaluator A constraint evaluator is responsible for evaluating constraints. It operates on an operator and two extractors. It uses the extractors to fetch the values and invokes the operator subsequently with the values.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IValueExtractorextractor1The value extractor 1.protected IValueExtractorextractor2The value extractor 2.protected IOperatoroperatorThe operator.
 - 
Constructor SummaryConstructors Constructor Description ConstraintEvaluator(IOperator operator, IValueExtractor extractor1, IValueExtractor extractor2)Create a new constraint evaluator.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Test if the evaluator equals an object.booleanevaluate(java.lang.Object right, Tuple left, IOAVState state)Evaluate the constraints given the right object, left tuple (null for alpha nodes) and the state.IValueExtractorgetExtractor1()Get the first value extractor.IValueExtractorgetExtractor2()Get the second value extractor.AttributeSetgetIndirectAttributes()Get the set of indirect attribute types.IOperatorgetOperator()Get the operator.AttributeSetgetRelevantAttributes()Get the set of relevant attribute types.inthashCode()Get the hash code.booleanisAffected(int tupleindex, OAVAttributeType attr)Test if a constraint evaluator is affected from a change of a certain attribute.java.lang.StringtoString()Get the string representation.
 
- 
- 
- 
Field Detail- 
operatorprotected IOperator operator The operator.
 - 
extractor1protected IValueExtractor extractor1 The value extractor 1.
 - 
extractor2protected IValueExtractor extractor2 The value extractor 2.
 
- 
 - 
Constructor Detail- 
ConstraintEvaluatorpublic ConstraintEvaluator(IOperator operator, IValueExtractor extractor1, IValueExtractor extractor2) Create a new constraint evaluator.- Parameters:
- operator- The operator.
- extractor1- The first extractor.
- extractor2- The second extractor.
 
 
- 
 - 
Method Detail- 
evaluatepublic boolean evaluate(java.lang.Object right, Tuple left, IOAVState state)Evaluate the constraints given the right object, left tuple (null for alpha nodes) and the state.- Specified by:
- evaluatein interface- IConstraintEvaluator
- Parameters:
- right- The right input object.
- left- The left input tuple.
- state- The working memory.
 
 - 
isAffectedpublic boolean isAffected(int tupleindex, OAVAttributeType attr)Test if a constraint evaluator is affected from a change of a certain attribute.- Specified by:
- isAffectedin interface- IConstraintEvaluator
- Parameters:
- tupleindex- The tuple index.
- attr- The attribute.
- Returns:
- True, if affected.
 
 - 
getRelevantAttributespublic AttributeSet getRelevantAttributes() Get the set of relevant attribute types.- Specified by:
- getRelevantAttributesin interface- IConstraintEvaluator
 
 - 
getIndirectAttributespublic AttributeSet getIndirectAttributes() Get the set of indirect attribute types. I.e. attributes of objects, which are not part of an object conditions (e.g. for chained extractors)- Specified by:
- getIndirectAttributesin interface- IConstraintEvaluator
- Returns:
- The relevant attribute types.
 
 - 
toStringpublic java.lang.String toString() Get the string representation.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- The string representation.
 
 - 
getOperatorpublic IOperator getOperator() Get the operator.
 - 
getExtractor1public IValueExtractor getExtractor1() Get the first value extractor.
 - 
getExtractor2public IValueExtractor getExtractor2() Get the second value extractor.
 - 
hashCodepublic int hashCode() Get the hash code.- Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) Test if the evaluator equals an object.- Overrides:
- equalsin class- java.lang.Object
 
 
- 
 
-