public class TestNode extends AbstractNode implements ITupleConsumerNode, ITupleSourceNode
Modifier and Type | Field and Description |
---|---|
protected IConstraintEvaluator |
evaluator
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.
|
clones, nodeid
Constructor and Description |
---|
TestNode(int nodeid,
IConstraintEvaluator evaluator)
Create a new test node.
|
Modifier and Type | Method and Description |
---|---|
void |
addTuple(Tuple tuple,
IOAVState state,
ReteMemory mem,
AbstractAgenda agenda)
Add a new tuple to this node.
|
void |
addTupleConsumer(ITupleConsumerNode node)
Add an tuple consumer node.
|
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 |
getConstraintEvaluator()
Get the evaluator.
|
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.
|
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 tuple,
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,
int tupleindex,
OAVAttributeType type,
java.lang.Object oldvalue,
java.lang.Object newvalue,
IOAVState state,
ReteMemory mem,
AbstractAgenda agenda)
Propagate a modified tuple to all tuple consumers.
|
protected void |
propagateRemovalToTupleConsumers(Tuple tuple,
IOAVState state,
ReteMemory mem,
AbstractAgenda agenda)
Propagate a removed tuple to all tuple consumers.
|
void |
removeTuple(Tuple tuple,
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 final IConstraintEvaluator evaluator
protected volatile AttributeSet relevants
protected volatile AttributeSet indirects
public TestNode(int nodeid, IConstraintEvaluator evaluator)
evaluator
- The evaluator.public void addTuple(Tuple tuple, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
addTuple
in interface ITupleConsumerNode
tuple
- The tuple.public void removeTuple(Tuple tuple, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
removeTuple
in interface ITupleConsumerNode
tuple
- The tuple.public void modifyTuple(Tuple tuple, int tupleindex, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
modifyTuple
in interface ITupleConsumerNode
tuple
- 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 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 AttributeSet getRelevantAttributes()
getRelevantAttributes
in interface INode
public AttributeSet getIndirectAttributes()
getIndirectAttributes
in interface INode
public java.lang.Object createNodeMemory(IOAVState state)
createNodeMemory
in interface INode
state
- The state.public boolean isAffected(OAVAttributeType attr)
type
- The attribute type.public IConstraintEvaluator getConstraintEvaluator()
protected void propagateAdditionToTupleConsumers(Tuple tuple, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
tuple
- The new tuple.protected void propagateRemovalToTupleConsumers(Tuple tuple, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
tuple
- The new tuple.protected void propagateModificationToTupleConsumers(Tuple tuple, int tupleindex, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
tuple
- The new tuple.protected void doClone(java.lang.Object theclone)
doClone
in class AbstractNode
theclone
- The clone.