Class InitialFactNode
- java.lang.Object
-
- jadex.rules.rulesystem.rete.nodes.AbstractNode
-
- jadex.rules.rulesystem.rete.nodes.InitialFactNode
-
- All Implemented Interfaces:
INode,IObjectConsumerNode,ITupleSourceNode,java.lang.Cloneable
public class InitialFactNode extends AbstractNode implements ITupleSourceNode, IObjectConsumerNode
Dummy fact node for not conditions, which are no joins.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringINITIAL_FACTThe initial fact.protected java.util.Collectioninitial_fact_memThe initial fact memory.protected Tupleinitial_fact_tupleThe initial fact tuple.protected IObjectSourceNodeosourceThe object source.protected AttributeSetrelevantsThe set of relevant attributes.protected ITupleConsumerNode[]tconsumersThe tuple consumers.-
Fields inherited from class jadex.rules.rulesystem.rete.nodes.AbstractNode
clones, nodeid
-
-
Constructor Summary
Constructors Constructor Description InitialFactNode(int nodeid)Create a new node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddObject(java.lang.Object object, IOAVState state, ReteMemory mem, AbstractAgenda agenda)Send a new object to this node.voidaddTupleConsumer(ITupleConsumerNode node)Add an tuple consumer node.java.lang.ObjectcreateNodeMemory(IOAVState state)Create the node memory.protected voiddoClone(java.lang.Object theclone)Do clone makes a deep clone without regarding cycles.AttributeSetgetIndirectAttributes()Get the set of indirect attribute types.java.util.CollectiongetNodeMemory(ReteMemory mem)Get the memory for this node.IObjectSourceNodegetObjectSource()Get the object source of this node.AttributeSetgetRelevantAttributes()Get the set of relevant attribute types.ITupleConsumerNode[]getTupleConsumers()Get all tuple consumer nodes.voidinit(IOAVState state, ReteMemory mem, AbstractAgenda agenda)Initialize the pattern matcher.voidmodifyIndirectObject(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.voidmodifyObject(java.lang.Object object, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)Propagate an object change to this node.voidremoveObject(java.lang.Object object, IOAVState state, ReteMemory mem, AbstractAgenda agenda)Send a removed object to this node.voidremoveTupleConsumer(ITupleConsumerNode node)Remove an tuple consumer.voidsetObjectSource(IObjectSourceNode node)Set the object source of this node.-
Methods inherited from class jadex.rules.rulesystem.rete.nodes.AbstractNode
checkNodeConsistency, clone, equals, getNodeId, hashCode, toString, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jadex.rules.rulesystem.rete.nodes.INode
checkNodeConsistency, clone, getNodeId
-
-
-
-
Field Detail
-
INITIAL_FACT
public static final java.lang.String INITIAL_FACT
The initial fact.- See Also:
- Constant Field Values
-
tconsumers
protected ITupleConsumerNode[] tconsumers
The tuple consumers.
-
osource
protected IObjectSourceNode osource
The object source.
-
relevants
protected volatile AttributeSet relevants
The set of relevant attributes.
-
initial_fact_tuple
protected Tuple initial_fact_tuple
The initial fact tuple.
-
initial_fact_mem
protected java.util.Collection initial_fact_mem
The initial fact memory.
-
-
Method Detail
-
init
public void init(IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Initialize the pattern matcher. Called before the agenda is accessed to perform any initialization, if necessary.
-
addObject
public void addObject(java.lang.Object object, IOAVState state, ReteMemory mem, AbstractAgenda agenda)Send a new object to this node.- Specified by:
addObjectin interfaceIObjectConsumerNode- Parameters:
object- The object.
-
removeObject
public void removeObject(java.lang.Object object, IOAVState state, ReteMemory mem, AbstractAgenda agenda)Send a removed object to this node.- Specified by:
removeObjectin interfaceIObjectConsumerNode- Parameters:
object- The object.
-
modifyObject
public void modifyObject(java.lang.Object object, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)Propagate an object change to this node.- Specified by:
modifyObjectin interfaceIObjectConsumerNode- Parameters:
object- The new object.
-
modifyIndirectObject
public 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.- Specified by:
modifyIndirectObjectin interfaceINode- Parameters:
object- The changed object.
-
setObjectSource
public void setObjectSource(IObjectSourceNode node)
Set the object source of this node.- Specified by:
setObjectSourcein interfaceIObjectConsumerNode- Parameters:
node- The object source node.
-
getObjectSource
public IObjectSourceNode getObjectSource()
Get the object source of this node.- Specified by:
getObjectSourcein interfaceIObjectConsumerNode- Returns:
- The object source node.
-
addTupleConsumer
public void addTupleConsumer(ITupleConsumerNode node)
Add an tuple consumer node.- Specified by:
addTupleConsumerin interfaceITupleSourceNode- Parameters:
node- A new consumer node.
-
removeTupleConsumer
public void removeTupleConsumer(ITupleConsumerNode node)
Remove an tuple consumer.- Specified by:
removeTupleConsumerin interfaceITupleSourceNode- Parameters:
node- The consumer node.
-
getTupleConsumers
public ITupleConsumerNode[] getTupleConsumers()
Get all tuple consumer nodes.- Specified by:
getTupleConsumersin interfaceITupleSourceNode- Returns:
- All tuple consumer nodes.
-
getNodeMemory
public java.util.Collection getNodeMemory(ReteMemory mem)
Get the memory for this node.- Specified by:
getNodeMemoryin interfaceINode- Specified by:
getNodeMemoryin interfaceITupleSourceNode- Returns:
- The memory.
-
createNodeMemory
public java.lang.Object createNodeMemory(IOAVState state)
Create the node memory.- Specified by:
createNodeMemoryin interfaceINode- Parameters:
state- The state.- Returns:
- The node memory.
-
getRelevantAttributes
public AttributeSet getRelevantAttributes()
Get the set of relevant attribute types.- Specified by:
getRelevantAttributesin interfaceINode
-
getIndirectAttributes
public AttributeSet getIndirectAttributes()
Get the set of indirect attribute types. I.e. attributes of objects, which are not part of an object conditions (e.g. for chained extractors)- Specified by:
getIndirectAttributesin interfaceINode- Returns:
- The relevant attribute types.
-
doClone
protected void doClone(java.lang.Object theclone)
Do clone makes a deep clone without regarding cycles. Method is overridden by subclasses to actually incorporate their attributes.- Specified by:
doClonein classAbstractNode- Parameters:
theclone- The clone.
-
-