Package org.drools.core.common
Class BaseNode
java.lang.Object
org.drools.core.common.BaseNode
- All Implemented Interfaces:
Serializable,NetworkNode
- Direct Known Subclasses:
AbstractTerminalNode,LeftTupleSource,ObjectSource
The base class for all Rete nodes.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected intprotected RuleBasePartitionId -
Constructor Summary
ConstructorsConstructorDescriptionBaseNode()BaseNode(int id, RuleBasePartitionId partitionId) All nodes have a unique id, set in the constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAssociatedTerminal(BaseTerminalNode terminalNode) voidaddAssociation(BuildContext context, Rule rule) voidaddAssociation(Rule rule) Associates this node with the give rulevoidattach(BuildContext context) Attaches the node into the network.voiddoAttach(BuildContext context) protected abstract booleandoRemove(RuleRemovalContext context, ReteooBuilder builder) Removes the node from the network.Rule[]intintintgetId()intabstract ObjectTypeNodeReturns the partition ID for which this node belongs togetSinks()booleanhasAssociatedTerminal(BaseTerminalNode terminalNode) final inthashCode()protected voidinitMemoryId(BuildContext context) booleanisAssociatedWith(Rule rule) abstract booleanisInUse()Returns true in case the current node is in use (is referenced by any other node)booleanabstract voidnetworkUpdated(UpdateContext updateContext) A method that is called for all nodes whose network below them changed, after the change is complete, providing them with an opportunity for state updatebooleanremove(RuleRemovalContext context, ReteooBuilder builder) voidremoveAssociatedTerminal(BaseTerminalNode terminalNode) booleanremoveAssociation(Rule rule, RuleRemovalContext context) Removes the association to the given rule from the associations map.voidsetId(int id) voidsetPartitionId(BuildContext context, RuleBasePartitionId partitionId) Sets the partition this node belongs toprotected voidsetStreamMode(boolean streamMode) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.drools.base.common.NetworkNode
getType, isRightInputIsRiaNode
-
Field Details
-
id
protected int id -
memoryId
protected int memoryId -
partitionId
-
associations
-
hashcode
protected int hashcode
-
-
Constructor Details
-
BaseNode
public BaseNode() -
BaseNode
All nodes have a unique id, set in the constructor.- Parameters:
id- The unique id
-
-
Method Details
-
getId
public int getId()- Specified by:
getIdin interfaceNetworkNode
-
setId
public void setId(int id) -
getMemoryId
public int getMemoryId() -
initMemoryId
-
isStreamMode
public boolean isStreamMode() -
setStreamMode
protected void setStreamMode(boolean streamMode) -
attach
Attaches the node into the network. Usually to the parentObjectSourceorTupleSource -
doAttach
-
networkUpdated
A method that is called for all nodes whose network below them changed, after the change is complete, providing them with an opportunity for state update -
remove
-
doRemove
Removes the node from the network. Usually from the parentObjectSourceorTupleSource -
isInUse
public abstract boolean isInUse()Returns true in case the current node is in use (is referenced by any other node) -
getObjectTypeNode
-
toString
-
getPartitionId
Returns the partition ID for which this node belongs to- Specified by:
getPartitionIdin interfaceNetworkNode
-
setPartitionId
Sets the partition this node belongs to -
addAssociation
Associates this node with the give rule -
addAssociation
-
removeAssociation
Removes the association to the given rule from the associations map. -
getAssociationsSize
public int getAssociationsSize() -
getAssociatedRules
- Specified by:
getAssociatedRulesin interfaceNetworkNode
-
isAssociatedWith
- Specified by:
isAssociatedWithin interfaceNetworkNode
-
addAssociatedTerminal
- Specified by:
addAssociatedTerminalin interfaceNetworkNode
-
removeAssociatedTerminal
- Specified by:
removeAssociatedTerminalin interfaceNetworkNode
-
getAssociatedTerminalsSize
public int getAssociatedTerminalsSize()- Specified by:
getAssociatedTerminalsSizein interfaceNetworkNode
-
hasAssociatedTerminal
- Specified by:
hasAssociatedTerminalin interfaceNetworkNode
-
hashCode
public final int hashCode() -
getSinks
- Specified by:
getSinksin interfaceNetworkNode
-