Class BetaMemory.IndexedConstraintMemory
- java.lang.Object
- 
- jadex.rules.rulesystem.rete.nodes.BetaMemory.IndexedConstraintMemory
 
- 
- Enclosing class:
- BetaMemory
 
 public static class BetaMemory.IndexedConstraintMemory extends java.lang.ObjectA memory for an indexed constraint.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.MapobjectsThe map for (value -> objects).protected java.util.MapovaluesThe cached values (object -> value).protected java.util.MaptuplesThe map for (value -> tuples).protected java.util.MaptvaluesThe cached values (tuple -> value).
 - 
Constructor SummaryConstructors Constructor Description IndexedConstraintMemory(IOAVState state)Create a new constraint memory.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddObject(java.lang.Object value, java.lang.Object object)Add an object to the memory.voidaddTuple(java.lang.Object value, Tuple tuple)Add a tuple to the memory.java.util.SetgetObjects(java.lang.Object value)Get object for value.java.lang.ObjectgetObjectValue(java.lang.Object object)Get the value for an object.java.util.SetgetTuples(java.lang.Object value)Get the tuples for a value.java.lang.ObjectgetTupleValue(Tuple tuple)Get the value for a tuple.voidremoveObject(java.lang.Object object)Remove an object from the memory.voidremoveTuple(Tuple tuple)Remove a tuple from the memory.intsize()Get the size of the beta memory (including indexed memories).java.lang.StringtoString()Create a string representation.
 
- 
- 
- 
Field Detail- 
objectsprotected java.util.Map objects The map for (value -> objects).
 - 
tuplesprotected java.util.Map tuples The map for (value -> tuples).
 - 
ovaluesprotected java.util.Map ovalues The cached values (object -> value). Required, because objects can change and old value (for removal) can no longer be obtained.
 - 
tvaluesprotected java.util.Map tvalues The cached values (tuple -> value). Required, because objects can change and old value (for removal) can no longer be obtained.
 
- 
 - 
Constructor Detail- 
IndexedConstraintMemorypublic IndexedConstraintMemory(IOAVState state) Create a new constraint memory.
 
- 
 - 
Method Detail- 
getObjectspublic java.util.Set getObjects(java.lang.Object value) Get object for value.- Parameters:
- value- The value.
- Returns:
- The objects.
 
 - 
getTuplespublic java.util.Set getTuples(java.lang.Object value) Get the tuples for a value.- Parameters:
- value- The value.
- Returns:
- The tuples.
 
 - 
getObjectValuepublic java.lang.Object getObjectValue(java.lang.Object object) Get the value for an object.- Parameters:
- object- The object.
- Returns:
- The value.
 
 - 
getTupleValuepublic java.lang.Object getTupleValue(Tuple tuple) Get the value for a tuple.- Parameters:
- tuple- The tuple.
- Returns:
- The value.
 
 - 
addObjectpublic void addObject(java.lang.Object value, java.lang.Object object)Add an object to the memory.- Parameters:
- value- The index.
- object- The object.
 
 - 
removeObjectpublic void removeObject(java.lang.Object object) Remove an object from the memory.- Parameters:
- object- The object.
 
 - 
addTuplepublic void addTuple(java.lang.Object value, Tuple tuple)Add a tuple to the memory.- Parameters:
- value- The index.
- tuple- The object.
 
 - 
removeTuplepublic void removeTuple(Tuple tuple) Remove a tuple from the memory.- Parameters:
- tuple- The tuple.
 
 - 
sizepublic int size() Get the size of the beta memory (including indexed memories).- Returns:
- The size of the memory.
 
 - 
toStringpublic java.lang.String toString() Create a string representation.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- The string representation.
 
 
- 
 
-