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.String
INITIAL_FACT
The initial fact.protected java.util.Collection
initial_fact_mem
The initial fact memory.protected Tuple
initial_fact_tuple
The initial fact tuple.protected IObjectSourceNode
osource
The object source.protected AttributeSet
relevants
The set of relevant attributes.protected ITupleConsumerNode[]
tconsumers
The 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 void
addObject(java.lang.Object object, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Send a new object 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.AttributeSet
getIndirectAttributes()
Get the set of indirect attribute types.java.util.Collection
getNodeMemory(ReteMemory mem)
Get the memory for this node.IObjectSourceNode
getObjectSource()
Get the object source of this node.AttributeSet
getRelevantAttributes()
Get the set of relevant attribute types.ITupleConsumerNode[]
getTupleConsumers()
Get all tuple consumer nodes.void
init(IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Initialize the pattern matcher.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
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.void
removeObject(java.lang.Object object, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Send a removed object to this node.void
removeTupleConsumer(ITupleConsumerNode node)
Remove an tuple consumer.void
setObjectSource(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:
addObject
in 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:
removeObject
in 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:
modifyObject
in 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:
modifyIndirectObject
in interfaceINode
- Parameters:
object
- The changed object.
-
setObjectSource
public void setObjectSource(IObjectSourceNode node)
Set the object source of this node.- Specified by:
setObjectSource
in interfaceIObjectConsumerNode
- Parameters:
node
- The object source node.
-
getObjectSource
public IObjectSourceNode getObjectSource()
Get the object source of this node.- Specified by:
getObjectSource
in interfaceIObjectConsumerNode
- Returns:
- The object source node.
-
addTupleConsumer
public void addTupleConsumer(ITupleConsumerNode node)
Add an tuple consumer node.- Specified by:
addTupleConsumer
in interfaceITupleSourceNode
- Parameters:
node
- A new consumer node.
-
removeTupleConsumer
public void removeTupleConsumer(ITupleConsumerNode node)
Remove an tuple consumer.- Specified by:
removeTupleConsumer
in interfaceITupleSourceNode
- Parameters:
node
- The consumer node.
-
getTupleConsumers
public ITupleConsumerNode[] getTupleConsumers()
Get all tuple consumer nodes.- Specified by:
getTupleConsumers
in interfaceITupleSourceNode
- Returns:
- All tuple consumer nodes.
-
getNodeMemory
public java.util.Collection getNodeMemory(ReteMemory mem)
Get the memory for this node.- Specified by:
getNodeMemory
in interfaceINode
- Specified by:
getNodeMemory
in interfaceITupleSourceNode
- Returns:
- The memory.
-
createNodeMemory
public java.lang.Object createNodeMemory(IOAVState state)
Create the node memory.- Specified by:
createNodeMemory
in interfaceINode
- Parameters:
state
- The state.- Returns:
- The node memory.
-
getRelevantAttributes
public AttributeSet getRelevantAttributes()
Get the set of relevant attribute types.- Specified by:
getRelevantAttributes
in 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:
getIndirectAttributes
in 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:
doClone
in classAbstractNode
- Parameters:
theclone
- The clone.
-
-