Class BetaMemory
- java.lang.Object
- 
- jadex.rules.rulesystem.rete.nodes.BetaMemory
 
- 
- Direct Known Subclasses:
- NotMemory
 
 public class BetaMemory extends java.lang.ObjectMemory for a beta node. It consists of: - indexed memories for each equal constraint (optional for speed) - a result memory (collection)
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classBetaMemory.IndexedConstraintMemoryA memory for an indexed constraint.
 - 
Constructor SummaryConstructors Constructor Description BetaMemory(IOAVState state)Create a new beta memory.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddObject(java.lang.Object value, java.lang.Object object, ConstraintIndexer ci)Add an value -> object pair to the object index.booleanaddResultTuple(Tuple tuple)Add a tuple to the result.voidaddTuple(java.lang.Object value, Tuple tuple, ConstraintIndexer ci)Add an value -> object pair to the tuple index.protected BetaMemory.IndexedConstraintMemorygetIndexedMemory(ConstraintIndexer ci)Get the indexed memory per constraint indexer.java.util.SetgetObjects(Tuple tuple, ConstraintIndexer ci)Get the indexed objects per tuple.java.util.CollectiongetResultMemory()Get the result memory.java.util.SetgetTuples(java.lang.Object object, ConstraintIndexer ci)Get the indexed tuples per object.voidremoveObject(java.lang.Object object, ConstraintIndexer ci)Remove an object from the object index.booleanremoveResultTuple(Tuple tuple)Remove from the result.voidremoveTuple(Tuple tuple, ConstraintIndexer ci)Remove an value -> object pair from the tuple index.intsize()Get the size of the beta memory (including indexed memories).java.lang.StringtoString()Get the string representation.
 
- 
- 
- 
Field Detail- 
stateprotected IOAVState state The state.
 - 
xmemsprotected java.util.Map xmems The indexed memories (indexed constraint evaluator -> memory).
 - 
resultmemprotected java.util.Set resultmem The result memory.
 
- 
 - 
Constructor Detail- 
BetaMemorypublic BetaMemory(IOAVState state) Create a new beta memory.- Parameters:
- node- The beta node.
 
 
- 
 - 
Method Detail- 
addResultTuplepublic boolean addResultTuple(Tuple tuple) Add a tuple to the result.- Parameters:
- tuple- The result node.
- Returns:
- True, if could be added.
 
 - 
removeResultTuplepublic boolean removeResultTuple(Tuple tuple) Remove from the result.- Parameters:
- tuple- The tuple.
- Returns:
- True, if could be removed.
 
 - 
getResultMemorypublic java.util.Collection getResultMemory() Get the result memory.- Returns:
- The result memory.
 
 - 
getObjectspublic java.util.Set getObjects(Tuple tuple, ConstraintIndexer ci) Get the indexed objects per tuple.- Parameters:
- tuple- The indexed tuple.
- ci- The constraint indexer.
 
 - 
getTuplespublic java.util.Set getTuples(java.lang.Object object, ConstraintIndexer ci)Get the indexed tuples per object.- Parameters:
- object- The indexed object.
- ci- The constraint indexer.
 
 - 
addObjectpublic void addObject(java.lang.Object value, java.lang.Object object, ConstraintIndexer ci)Add an value -> object pair to the object index.- Parameters:
- value- The value.
- object- The object.
- ci- The constraint indexer.
 
 - 
removeObjectpublic void removeObject(java.lang.Object object, ConstraintIndexer ci)Remove an object from the object index.- Parameters:
- object- The object.
- ci- The constraint indexer.
 
 - 
addTuplepublic void addTuple(java.lang.Object value, Tuple tuple, ConstraintIndexer ci)Add an value -> object pair to the tuple index.- Parameters:
- value- The value.
- tuple- The tuple.
- ci- The constraint indexer.
 
 - 
removeTuplepublic void removeTuple(Tuple tuple, ConstraintIndexer ci) Remove an value -> object pair from the tuple index.- Parameters:
- object- The object.
- ci- The constraint indexer.
 
 - 
getIndexedMemoryprotected BetaMemory.IndexedConstraintMemory getIndexedMemory(ConstraintIndexer ci) Get the indexed memory per constraint indexer.- Parameters:
- ci- The constraint indexer.
 
 - 
sizepublic int size() Get the size of the beta memory (including indexed memories).- Returns:
- The size of the memory.
 
 - 
toStringpublic java.lang.String toString() Get the string representation.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- The string representation.
 
 
- 
 
-