Class ConstraintIndexer
- java.lang.Object
- 
- jadex.rules.rulesystem.rete.constraints.ConstraintIndexer
 
- 
 public class ConstraintIndexer extends java.lang.ObjectThe constraint indexer has the purpose to index equal constraints via the beta memory of the node, i.e. for each side a memory is kept that allows direct fetching of all matching values via the "indexed" attribute.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IValueExtractorextractor1The value extractor 1 (left).protected IValueExtractorextractor2The value extractor 2 (right).
 - 
Constructor SummaryConstructors Constructor Description ConstraintIndexer(IValueExtractor extractor1, IValueExtractor extractor2)Create a new indexed constraint evaluator.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddObject(java.lang.Object right, IOAVState state, BetaMemory bmem)Add an object to the memory.voidaddTuple(Tuple left, IOAVState state, BetaMemory bmem)Add a tuple to the memory.booleanequals(java.lang.Object obj)Test if the evaluator equals an object.java.util.SetfindObjects(Tuple left, BetaMemory bmem)Find all objects for a tuple.java.util.SetfindTuples(java.lang.Object right, BetaMemory bmem)Find all tuples for an object.AttributeSetgetIndirectAttributes()Get the set of indirect attribute types.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.booleanisLeftIndex(int tupleindex, OAVAttributeType type)Test if the indexer uses the given index and attribute type for left side indexing.booleanisRightIndex(OAVAttributeType type)Test if the indexer uses the given attribute type for right side indexing.voidremoveObject(java.lang.Object right, BetaMemory bmem)Remove an object from the memory.voidremoveTuple(Tuple left, BetaMemory bmem)Remove a tuple from the memory.java.lang.StringtoString()Create a string representation.
 
- 
- 
- 
Field Detail- 
extractor1protected IValueExtractor extractor1 The value extractor 1 (left).
 - 
extractor2protected IValueExtractor extractor2 The value extractor 2 (right).
 
- 
 - 
Constructor Detail- 
ConstraintIndexerpublic ConstraintIndexer(IValueExtractor extractor1, IValueExtractor extractor2) Create a new indexed constraint evaluator.
 
- 
 - 
Method Detail- 
findObjectspublic java.util.Set findObjects(Tuple left, BetaMemory bmem) Find all objects for a tuple.- Parameters:
- left- The tuple.
- bmem- The beta memory.
- Returns:
- The result collection.
 
 - 
findTuplespublic java.util.Set findTuples(java.lang.Object right, BetaMemory bmem)Find all tuples for an object.- Parameters:
- right- The object.
- bmem- The beta memory.
- Returns:
- The result collection.
 
 - 
addObjectpublic void addObject(java.lang.Object right, IOAVState state, BetaMemory bmem)Add an object to the memory.- Parameters:
- right- The object.
- state- The state.
- bmem- The beta memory.
 
 - 
addTuplepublic void addTuple(Tuple left, IOAVState state, BetaMemory bmem) Add a tuple to the memory.- Parameters:
- left- The tuple.
- state- The state.
- bmem- The beta memory.
 
 - 
removeObjectpublic void removeObject(java.lang.Object right, BetaMemory bmem)Remove an object from the memory.- Parameters:
- right- The object.
- bmem- The beta memory.
 
 - 
removeTuplepublic void removeTuple(Tuple left, BetaMemory bmem) Remove a tuple from the memory.- Parameters:
- left- The tuple.
- bmem- The beta memory.
 
 - 
isRightIndexpublic boolean isRightIndex(OAVAttributeType type) Test if the indexer uses the given attribute type for right side indexing.- Returns:
- True, if type is used for indexing.
 
 - 
isLeftIndexpublic boolean isLeftIndex(int tupleindex, OAVAttributeType type)Test if the indexer uses the given index and attribute type for left side indexing.- Returns:
- True, if combination is used for indexing.
 
 - 
isAffectedpublic boolean isAffected(int tupleindex, OAVAttributeType attr)Test if a constraint evaluator is affected from a change of a certain attribute.- Parameters:
- tupleindex- The tuple index.
- attr- The attribute.
- Returns:
- True, if affected.
 
 - 
getRelevantAttributespublic AttributeSet getRelevantAttributes() Get the set of relevant attribute types.
 - 
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)- Returns:
- The relevant attribute types.
 
 - 
toStringpublic java.lang.String toString() Create a string representation.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- The string representation.
 
 - 
equalspublic boolean equals(java.lang.Object obj) Test if the evaluator equals an object.- Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() Get the hash code.- Overrides:
- hashCodein class- java.lang.Object
 
 
- 
 
-