Class CollectMemory
- java.lang.Object
-
- jadex.rules.rulesystem.rete.nodes.CollectMemory
-
public class CollectMemory extends java.lang.Object
Memory for the collect node.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set
resultmem
The result memory.protected java.util.Map
workingmem
The working memory (index tuple -> result tuple).
-
Constructor Summary
Constructors Constructor Description CollectMemory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addResultTuple(Tuple tuple)
Add a tuple to the result.java.util.Collection
getResultMemory()
Get the result memory.java.util.Map
getWorkingMemory()
Get the result memory.Tuple
getWorkingTuple(Tuple key)
Add a tuple to the result.void
putWorkingTuple(Tuple key, Tuple result)
Add a tuple to the result.boolean
removeResultTuple(Tuple tuple)
Remove from the result.void
removeWorkingTuple(Tuple key)
Remove from the result.boolean
resultMemoryContains(Tuple tuple)
Test if tuple is contained in result memory.int
size()
Get the size of the beta memory (including indexed memories).java.lang.String
toString()
Get the string representation.
-
-
-
Method Detail
-
addResultTuple
public boolean addResultTuple(Tuple tuple)
Add a tuple to the result.- Parameters:
tuple
- The result node.- Returns:
- True, if could be added.
-
removeResultTuple
public boolean removeResultTuple(Tuple tuple)
Remove from the result.- Parameters:
tuple
- The tuple.- Returns:
- True, if could be removed.
-
resultMemoryContains
public boolean resultMemoryContains(Tuple tuple)
Test if tuple is contained in result memory.- Parameters:
tuple
- The tuple.- Returns:
- True, if contained.
-
getResultMemory
public java.util.Collection getResultMemory()
Get the result memory.- Returns:
- The result memory.
-
putWorkingTuple
public void putWorkingTuple(Tuple key, Tuple result)
Add a tuple to the result.- Parameters:
tuple
- The result node.
-
getWorkingTuple
public Tuple getWorkingTuple(Tuple key)
Add a tuple to the result.- Parameters:
tuple
- The result node.- Returns:
- True, if could be added.
-
removeWorkingTuple
public void removeWorkingTuple(Tuple key)
Remove from the result.- Parameters:
tuple
- The tuple.
-
getWorkingMemory
public java.util.Map getWorkingMemory()
Get the result memory.- Returns:
- The result memory.
-
size
public int size()
Get the size of the beta memory (including indexed memories).- Returns:
- The size of the memory.
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The string representation.
-
-