Class OrConstraintEvaluator
- java.lang.Object
-
- jadex.rules.rulesystem.rete.constraints.OrConstraintEvaluator
-
- All Implemented Interfaces:
IConstraintEvaluator
public class OrConstraintEvaluator extends java.lang.Object implements IConstraintEvaluator
A constraint evaluator for or-connected constraints.
-
-
Field Summary
Fields Modifier and Type Field Description protected IConstraintEvaluator[]
evaluators
The constraint evaluator.
-
Constructor Summary
Constructors Constructor Description OrConstraintEvaluator(IConstraintEvaluator[] evaluators)
Create an OR constraint evaluator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Test for equality.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.IConstraintEvaluator[]
getConstraintEvaluators()
Get the constraint evaluators.AttributeSet
getIndirectAttributes()
Get the set of indirect attribute types.AttributeSet
getRelevantAttributes()
Get the set of relevant attribute types.int
hashCode()
The hash code.boolean
isAffected(int tupleindex, OAVAttributeType attr)
Test if a constraint evaluator is affected from a change of a certain attribute.java.lang.String
toString()
Get the string representation.
-
-
-
Field Detail
-
evaluators
protected final IConstraintEvaluator[] evaluators
The constraint evaluator.
-
-
Constructor Detail
-
OrConstraintEvaluator
public OrConstraintEvaluator(IConstraintEvaluator[] evaluators)
Create an OR constraint evaluator.
-
-
Method Detail
-
evaluate
public 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:
evaluate
in interfaceIConstraintEvaluator
- Parameters:
right
- The right input object.left
- The left input tuple.state
- The working memory.
-
isAffected
public boolean isAffected(int tupleindex, OAVAttributeType attr)
Test if a constraint evaluator is affected from a change of a certain attribute.- Specified by:
isAffected
in interfaceIConstraintEvaluator
- Parameters:
tupleindex
- The tuple index.attr
- The attribute.- Returns:
- True, if affected.
-
getRelevantAttributes
public AttributeSet getRelevantAttributes()
Get the set of relevant attribute types.- Specified by:
getRelevantAttributes
in interfaceIConstraintEvaluator
-
getIndirectAttributes
public 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:
getIndirectAttributes
in interfaceIConstraintEvaluator
- Returns:
- The relevant attribute types.
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The string representation.
-
getConstraintEvaluators
public IConstraintEvaluator[] getConstraintEvaluators()
Get the constraint evaluators.
-
hashCode
public int hashCode()
The hash code.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash code.
-
equals
public boolean equals(java.lang.Object obj)
Test for equality.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- The object.- Returns:
- True, if equal.
-
-