Package org.drools.core.reteoo
Class AbstractTerminalNode
- java.lang.Object
-
- org.drools.core.common.BaseNode
-
- org.drools.core.reteoo.AbstractTerminalNode
-
- All Implemented Interfaces:
MemoryFactory<PathMemory>,NetworkNode,LeftTupleNode,LeftTupleSink,LeftTupleSinkNode,PathEndNode,Sink,TerminalNode
- Direct Known Subclasses:
QueryTerminalNode,RuleTerminalNode
public abstract class AbstractTerminalNode extends BaseNode implements TerminalNode
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.drools.core.reteoo.PathEndNode
PathEndNode.PathMemSpec
-
-
Field Summary
Fields Modifier and Type Field Description protected PathEndNode.PathMemSpecpathMemSpecprotected Declaration[]requiredDeclarations-
Fields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId, partitionsEnabled
-
-
Constructor Summary
Constructors Constructor Description AbstractTerminalNode()AbstractTerminalNode(int id, RuleBasePartitionId partitionId, boolean partitionsEnabled, LeftTupleSource source, BuildContext context, RuleImpl rule, GroupElement subrule, int subruleIndex)
-
Method Summary
-
Methods inherited from class org.drools.core.common.BaseNode
addAssociatedTerminal, addAssociation, addAssociation, attach, doAttach, getAssociatedRules, getAssociatedTerminalsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hasAssociatedTerminal, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociatedTerminal, removeAssociation, setId, setPartitionId, setPartitionsEnabled, setStreamMode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.reteoo.LeftTupleSink
createLeftTuple, createLeftTuple, createLeftTuple, createLeftTuple, createLeftTuple, getLeftInputOtnId, setLeftInputOtnId
-
Methods inherited from interface org.drools.core.common.MemoryFactory
getMemoryId
-
Methods inherited from interface org.drools.core.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, getType, hasAssociatedTerminal, isAssociatedWith, removeAssociatedTerminal
-
Methods inherited from interface org.drools.core.reteoo.PathEndNode
calculatePathMemSpec
-
Methods inherited from interface org.drools.core.reteoo.TerminalNode
getSalienceDeclarations, isFireDirect
-
-
-
-
Field Detail
-
requiredDeclarations
protected Declaration[] requiredDeclarations
-
pathMemSpec
protected PathEndNode.PathMemSpec pathMemSpec
-
-
Constructor Detail
-
AbstractTerminalNode
public AbstractTerminalNode()
-
AbstractTerminalNode
public AbstractTerminalNode(int id, RuleBasePartitionId partitionId, boolean partitionsEnabled, LeftTupleSource source, BuildContext context, RuleImpl rule, GroupElement subrule, int subruleIndex)
-
-
Method Detail
-
getPathMemSpec
public PathEndNode.PathMemSpec getPathMemSpec()
- Specified by:
getPathMemSpecin interfacePathEndNode
-
getPathMemSpec
public PathEndNode.PathMemSpec getPathMemSpec(TerminalNode removingTN)
- Specified by:
getPathMemSpecin interfacePathEndNode
-
resetPathMemSpec
public void resetPathMemSpec(TerminalNode removingTN)
- Specified by:
resetPathMemSpecin interfacePathEndNode
-
getRule
public RuleImpl getRule()
- Specified by:
getRulein interfaceTerminalNode
-
getSubRule
public GroupElement getSubRule()
- Specified by:
getSubRulein interfaceTerminalNode
-
getSubruleIndex
public int getSubruleIndex()
- Specified by:
getSubruleIndexin interfaceTerminalNode
-
getAllDeclarations
public Declaration[] getAllDeclarations()
- Specified by:
getAllDeclarationsin interfaceTerminalNode
-
getRequiredDeclarations
public Declaration[] getRequiredDeclarations()
- Specified by:
getRequiredDeclarationsin interfaceTerminalNode
-
nullPathMemSpec
public void nullPathMemSpec()
- Specified by:
nullPathMemSpecin interfacePathEndNode
-
setPathEndNodes
public void setPathEndNodes(PathEndNode[] pathEndNodes)
- Specified by:
setPathEndNodesin interfacePathEndNode
-
getPathEndNodes
public PathEndNode[] getPathEndNodes()
- Specified by:
getPathEndNodesin interfacePathEndNode
-
setSegmentPrototypes
public void setSegmentPrototypes(SegmentMemory.SegmentPrototype[] smems)
- Specified by:
setSegmentPrototypesin interfacePathEndNode
-
getSegmentPrototypes
public SegmentMemory.SegmentPrototype[] getSegmentPrototypes()
- Specified by:
getSegmentPrototypesin interfacePathEndNode
-
getEagerSegmentPrototypes
public SegmentMemory.SegmentPrototype[] getEagerSegmentPrototypes()
- Specified by:
getEagerSegmentPrototypesin interfacePathEndNode
-
setEagerSegmentPrototypes
public void setEagerSegmentPrototypes(SegmentMemory.SegmentPrototype[] eagerSegmentPrototypes)
- Specified by:
setEagerSegmentPrototypesin interfacePathEndNode
-
getPathIndex
public int getPathIndex()
- Specified by:
getPathIndexin interfaceLeftTupleNode
-
getObjectCount
public int getObjectCount()
- Specified by:
getObjectCountin interfaceLeftTupleNode
-
setObjectCount
public void setObjectCount(int count)
- Specified by:
setObjectCountin interfaceLeftTupleNode
-
initDeclaredMask
protected void initDeclaredMask(BuildContext context)
-
initInferredMask
public void initInferredMask()
- Specified by:
initInferredMaskin interfaceTerminalNode
-
unwrapTupleSource
public LeftTupleSource unwrapTupleSource()
- Specified by:
unwrapTupleSourcein interfaceTerminalNode
-
createMemory
public PathMemory createMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator)
- Specified by:
createMemoryin interfaceMemoryFactory<PathMemory>
-
initPathMemory
public static PathMemory initPathMemory(PathEndNode pathEndNode, PathMemory pmem)
-
createPeer
public LeftTuple createPeer(LeftTuple original)
- Specified by:
createPeerin interfaceLeftTupleSink
-
doRemove
protected boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
Description copied from class:BaseNodeRemoves the node from the network. Usually from the parentObjectSourceorTupleSource
-
getLeftTupleSource
public LeftTupleSource getLeftTupleSource()
- Specified by:
getLeftTupleSourcein interfaceLeftTupleNode- Specified by:
getLeftTupleSourcein interfaceTerminalNode
-
getDeclaredMask
public BitMask getDeclaredMask()
- Specified by:
getDeclaredMaskin interfaceTerminalNode
-
getInferredMask
public BitMask getInferredMask()
- Specified by:
getInferredMaskin interfaceTerminalNode
-
getLeftInferredMask
public BitMask getLeftInferredMask()
- Specified by:
getLeftInferredMaskin interfaceLeftTupleSink
-
setDeclaredMask
public void setDeclaredMask(BitMask mask)
- Specified by:
setDeclaredMaskin interfaceTerminalNode
-
setInferredMask
public void setInferredMask(BitMask mask)
- Specified by:
setInferredMaskin interfaceTerminalNode
-
getNegativeMask
public BitMask getNegativeMask()
- Specified by:
getNegativeMaskin interfaceTerminalNode
-
setNegativeMask
public void setNegativeMask(BitMask mask)
- Specified by:
setNegativeMaskin interfaceTerminalNode
-
networkUpdated
public void networkUpdated(UpdateContext updateContext)
Description copied from class:BaseNodeA 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- Specified by:
networkUpdatedin classBaseNode
-
isInUse
public boolean isInUse()
Description copied from class:BaseNodeReturns true in case the current node is in use (is referenced by any other node)
-
isLeftTupleMemoryEnabled
public boolean isLeftTupleMemoryEnabled()
- Specified by:
isLeftTupleMemoryEnabledin interfaceLeftTupleSink
-
getPathNodes
public static LeftTupleNode[] getPathNodes(PathEndNode endNode)
-
getPathNodes
public LeftTupleNode[] getPathNodes()
- Specified by:
getPathNodesin interfacePathEndNode
-
hasPathNode
public final boolean hasPathNode(LeftTupleNode node)
- Specified by:
hasPathNodein interfacePathEndNode
-
isTerminalNodeOf
public final boolean isTerminalNodeOf(LeftTupleNode node)
- Specified by:
isTerminalNodeOfin interfaceTerminalNode
-
getSinkPropagator
public LeftTupleSinkPropagator getSinkPropagator()
- Specified by:
getSinkPropagatorin interfaceLeftTupleNode
-
setPartitionIdWithSinks
public final void setPartitionIdWithSinks(RuleBasePartitionId partitionId)
- Specified by:
setPartitionIdWithSinksin interfaceLeftTupleSink
-
getObjectTypeNode
public ObjectTypeNode getObjectTypeNode()
- Specified by:
getObjectTypeNodein classBaseNode
-
getNextLeftTupleSinkNode
public LeftTupleSinkNode getNextLeftTupleSinkNode()
Returns the next node- Specified by:
getNextLeftTupleSinkNodein interfaceLeftTupleSinkNode- Returns:
- The next TupleSinkNode
-
setNextLeftTupleSinkNode
public void setNextLeftTupleSinkNode(LeftTupleSinkNode next)
Sets the next node- Specified by:
setNextLeftTupleSinkNodein interfaceLeftTupleSinkNode- Parameters:
next- The next TupleSinkNode
-
getPreviousLeftTupleSinkNode
public LeftTupleSinkNode getPreviousLeftTupleSinkNode()
Returns the previous node- Specified by:
getPreviousLeftTupleSinkNodein interfaceLeftTupleSinkNode- Returns:
- The previous TupleSinkNode
-
setPreviousLeftTupleSinkNode
public void setPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)
Sets the previous node- Specified by:
setPreviousLeftTupleSinkNodein interfaceLeftTupleSinkNode- Parameters:
previous- The previous TupleSinkNode
-
visitLeftTupleNodes
public void visitLeftTupleNodes(java.util.function.Consumer<LeftTupleNode> func)
- Specified by:
visitLeftTupleNodesin interfaceTerminalNode
-
calculateHashCode
protected int calculateHashCode()
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
-