public class CollectNode extends AbstractNode implements ITupleConsumerNode, ITupleSourceNode
Modifier and Type | Field and Description |
---|---|
protected IConstraintEvaluator[] |
evaluators
The constraint evaluator.
|
protected AttributeSet |
indirects
The set of indirect attributes.
|
protected AttributeSet |
relevants
The set of relevant attributes.
|
protected ITupleConsumerNode[] |
tconsumers
The tuple consumers.
|
protected ITupleSourceNode |
tsource
The tuple source.
|
protected int |
tupleindex
The tuple index to collect.
|
clones, nodeid
Constructor and Description |
---|
CollectNode(int nodeid,
int tupleindex,
IConstraintEvaluator[] evaluators)
Create a new beta node.
|
Modifier and Type | Method and Description |
---|---|
void |
addTuple(Tuple left,
IOAVState state,
ReteMemory mem,
AbstractAgenda agenda)
Send a tuple to this node.
|
void |
addTupleConsumer(ITupleConsumerNode node)
Add an tuple consumer node.
|
protected boolean |
checkConstraints(Tuple left,
IOAVState state)
Check the constraints with respect
to the object.
|
protected Tuple |
createIndexTuple(IOAVState state,
Tuple tuple,
ReteMemory mem)
Create an index tuple from a tuple.
|
java.lang.Object |
createNodeMemory(IOAVState state)
Create the node memory.
|
protected void |
doClone(java.lang.Object theclone)
Do clone makes a deep clone without regarding cycles.
|
IConstraintEvaluator[] |
getConstraintEvaluators()
Get the evaluators.
|
AttributeSet |
getIndirectAttributes()
Get the set of indirect attribute types.
|
java.util.Collection |
getNodeMemory(ReteMemory mem)
Get the memory for this node.
|
AttributeSet |
getRelevantAttributes()
Get the set of relevant attribute types.
|
ITupleConsumerNode[] |
getTupleConsumers()
Get all tuple consumer nodes.
|
int |
getTupleIndex()
Get the tuple index.
|
ITupleSourceNode |
getTupleSource()
Get the tuple source of this node.
|
boolean |
isAffected(OAVAttributeType attr)
Test if the node is affected from a modification.
|
void |
modifyIndirectObject(java.lang.Object object,
OAVAttributeType type,
java.lang.Object oldvalue,
java.lang.Object newvalue,
IOAVState state,
ReteMemory mem,
AbstractAgenda agenda)
Propagate an indirect object change to this node.
|
void |
modifyTuple(Tuple left,
int tupleindex,
OAVAttributeType type,
java.lang.Object oldvalue,
java.lang.Object newvalue,
IOAVState state,
ReteMemory mem,
AbstractAgenda agenda)
Modify a tuple in this node.
|
protected void |
propagateAdditionToTupleConsumers(Tuple tuple,
IOAVState state,
ReteMemory mem,
AbstractAgenda agenda)
Propagate a new tuple to all tuple consumers.
|
protected void |
propagateModificationToTupleConsumers(Tuple tuple,
OAVAttributeType type,
java.lang.Object oldvalue,
java.lang.Object newvalue,
IOAVState state,
ReteMemory mem,
AbstractAgenda agenda)
Propagate a modified object to all object consumers.
|
protected void |
propagateRemovalToTupleConsumers(Tuple tuple,
IOAVState state,
ReteMemory mem,
AbstractAgenda agenda)
Propagate a removed tuple to all tuple consumers.
|
void |
removeTuple(Tuple left,
IOAVState state,
ReteMemory mem,
AbstractAgenda agenda)
Remove a tuple from this node.
|
void |
removeTupleConsumer(ITupleConsumerNode node)
Remove an tuple consumer.
|
void |
setTupleSource(ITupleSourceNode node)
Set the tuple source of this node.
|
checkNodeConsistency, clone, equals, getNodeId, hashCode, toString, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
checkNodeConsistency, clone, getNodeId
protected ITupleConsumerNode[] tconsumers
protected ITupleSourceNode tsource
protected IConstraintEvaluator[] evaluators
protected volatile AttributeSet relevants
protected volatile AttributeSet indirects
protected int tupleindex
public CollectNode(int nodeid, int tupleindex, IConstraintEvaluator[] evaluators)
public void addTupleConsumer(ITupleConsumerNode node)
addTupleConsumer
in interface ITupleSourceNode
node
- A new consumer node.public void removeTupleConsumer(ITupleConsumerNode node)
removeTupleConsumer
in interface ITupleSourceNode
node
- The consumer node.public java.util.Collection getNodeMemory(ReteMemory mem)
getNodeMemory
in interface INode
getNodeMemory
in interface ITupleSourceNode
public ITupleConsumerNode[] getTupleConsumers()
getTupleConsumers
in interface ITupleSourceNode
public void addTuple(Tuple left, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
addTuple
in interface ITupleConsumerNode
tuple
- The tuple.public void removeTuple(Tuple left, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
removeTuple
in interface ITupleConsumerNode
tuple
- The tuple.public void modifyTuple(Tuple left, int tupleindex, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
modifyTuple
in interface ITupleConsumerNode
left
- The tuple.public void modifyIndirectObject(java.lang.Object object, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
modifyIndirectObject
in interface INode
object
- The changed object.public void setTupleSource(ITupleSourceNode node)
setTupleSource
in interface ITupleConsumerNode
node
- The tuple source node.public ITupleSourceNode getTupleSource()
getTupleSource
in interface ITupleConsumerNode
public java.lang.Object createNodeMemory(IOAVState state)
createNodeMemory
in interface INode
state
- The state.public IConstraintEvaluator[] getConstraintEvaluators()
public boolean isAffected(OAVAttributeType attr)
type
- The attribute type.public AttributeSet getRelevantAttributes()
getRelevantAttributes
in interface INode
public AttributeSet getIndirectAttributes()
getIndirectAttributes
in interface INode
public int getTupleIndex()
protected void doClone(java.lang.Object theclone)
doClone
in class AbstractNode
theclone
- The clone.protected boolean checkConstraints(Tuple left, IOAVState state)
protected Tuple createIndexTuple(IOAVState state, Tuple tuple, ReteMemory mem)
tuple
- The tuple.protected void propagateAdditionToTupleConsumers(Tuple tuple, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
object
- The new object.protected void propagateRemovalToTupleConsumers(Tuple tuple, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
object
- The new object.protected void propagateModificationToTupleConsumers(Tuple tuple, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
object
- The new object.