|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.common.BaseNode
public abstract class BaseNode
The base class for all Rete nodes.
Field Summary | |
---|---|
protected Map<org.drools.definition.rule.Rule,RuleComponent> |
associations
|
protected int |
id
|
protected RuleBasePartitionId |
partitionId
|
protected boolean |
partitionsEnabled
|
Constructor Summary | |
---|---|
BaseNode()
|
|
BaseNode(int id,
RuleBasePartitionId partitionId,
boolean partitionsEnabled)
All nodes have a unique id, set in the constructor. |
Method Summary | |
---|---|
void |
addAssociation(org.drools.definition.rule.Rule rule,
RuleComponent component)
Creates an association between this node and the rule + rule component that caused the creation of this node. |
abstract void |
attach()
Attaches the node into the network. |
abstract void |
attach(InternalWorkingMemory[] workingMemories)
|
protected abstract void |
doRemove(RuleRemovalContext context,
ReteooBuilder builder,
BaseNode node,
InternalWorkingMemory[] workingMemories)
Removes the node from teh network. |
Map<org.drools.definition.rule.Rule,RuleComponent> |
getAssociations()
Returns the map of associations for this node |
int |
getId()
Returns the unique id that represents the node in the Rete network |
RuleBasePartitionId |
getPartitionId()
Returns the partition ID for which this node belongs to |
int |
hashCode()
The hashCode return is simply the unique id of the node. |
abstract boolean |
isInUse()
Returns true in case the current node is in use (is referenced by any other node) |
abstract void |
networkUpdated()
A method that is called for all nodes whose network below them changed, after the change is complete, providing them with an oportunity for state update |
void |
readExternal(ObjectInput in)
|
void |
remove(RuleRemovalContext context,
ReteooBuilder builder,
BaseNode node,
InternalWorkingMemory[] workingMemories)
|
void |
removeAssociation(org.drools.definition.rule.Rule rule)
Removes the association to the given rule from the associations map. |
void |
setPartitionId(RuleBasePartitionId partitionId)
Sets the partition this node belongs to |
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int id
protected RuleBasePartitionId partitionId
protected boolean partitionsEnabled
protected Map<org.drools.definition.rule.Rule,RuleComponent> associations
Constructor Detail |
---|
public BaseNode()
public BaseNode(int id, RuleBasePartitionId partitionId, boolean partitionsEnabled)
id
- The unique idMethod Detail |
---|
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public int getId()
NetworkNode
getId
in interface NetworkNode
public abstract void attach()
ObjectSource
or TupleSource
public abstract void attach(InternalWorkingMemory[] workingMemories)
public abstract void networkUpdated()
public void remove(RuleRemovalContext context, ReteooBuilder builder, BaseNode node, InternalWorkingMemory[] workingMemories)
protected abstract void doRemove(RuleRemovalContext context, ReteooBuilder builder, BaseNode node, InternalWorkingMemory[] workingMemories)
ObjectSource
or TupleSource
builder
- public abstract boolean isInUse()
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public RuleBasePartitionId getPartitionId()
getPartitionId
in interface NetworkNode
public void setPartitionId(RuleBasePartitionId partitionId)
partitionId
- public void addAssociation(org.drools.definition.rule.Rule rule, RuleComponent component)
rule
- The rule sourcecomponent
- public Map<org.drools.definition.rule.Rule,RuleComponent> getAssociations()
public void removeAssociation(org.drools.definition.rule.Rule rule)
rule
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |