Package org.drools.core.reteoo
Class AbstractTerminalNode
- java.lang.Object
-
- org.drools.core.common.BaseNode
-
- org.drools.core.reteoo.AbstractTerminalNode
-
- All Implemented Interfaces:
java.io.Serializable,org.drools.base.common.NetworkNode,org.drools.base.reteoo.BaseTerminalNode,MemoryFactory<PathMemory>,LeftTupleNode,LeftTupleSink,LeftTupleSinkNode,PathEndNode,Sink,TerminalNode
- Direct Known Subclasses:
QueryTerminalNode,RuleTerminalNode
public abstract class AbstractTerminalNode extends BaseNode implements TerminalNode
- See Also:
- Serialized Form
-
-
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 org.drools.base.rule.Declaration[]requiredDeclarations-
Fields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId
-
-
Constructor Summary
Constructors Constructor Description AbstractTerminalNode()AbstractTerminalNode(int id, org.drools.base.common.RuleBasePartitionId partitionId, LeftTupleSource source, BuildContext context, org.drools.base.definitions.rule.impl.RuleImpl rule, org.drools.base.rule.GroupElement subrule, int subruleIndex)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcalculateHashCode()PathMemorycreateMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator)LeftTuplecreatePeer(LeftTuple original)protected booleandoRemove(RuleRemovalContext context, ReteooBuilder builder)Removes the node from the network.booleanequals(java.lang.Object object)org.drools.base.rule.Declaration[]getAllDeclarations()org.drools.util.bitmask.BitMaskgetDeclaredMask()SegmentMemory.SegmentPrototype[]getEagerSegmentPrototypes()org.drools.util.bitmask.BitMaskgetInferredMask()org.drools.util.bitmask.BitMaskgetLeftInferredMask()LeftTupleSourcegetLeftTupleSource()org.drools.util.bitmask.BitMaskgetNegativeMask()LeftTupleSinkNodegetNextLeftTupleSinkNode()Returns the next nodeintgetObjectCount()ObjectTypeNodegetObjectTypeNode()PathEndNode[]getPathEndNodes()intgetPathIndex()PathEndNode.PathMemSpecgetPathMemSpec()PathEndNode.PathMemSpecgetPathMemSpec(TerminalNode removingTN)LeftTupleNode[]getPathNodes()static LeftTupleNode[]getPathNodes(PathEndNode endNode)LeftTupleSinkNodegetPreviousLeftTupleSinkNode()Returns the previous nodeorg.drools.base.rule.Declaration[]getRequiredDeclarations()org.drools.base.definitions.rule.impl.RuleImplgetRule()SegmentMemory.SegmentPrototype[]getSegmentPrototypes()LeftTupleSinkPropagatorgetSinkPropagator()LeftTupleSourcegetStartTupleSource()org.drools.base.rule.GroupElementgetSubRule()intgetSubruleIndex()booleanhasPathNode(LeftTupleNode node)protected voidinitDeclaredMask(BuildContext context)voidinitInferredMask()static PathMemoryinitPathMemory(PathEndNode pathEndNode, PathMemory pmem)booleanisInUse()Returns true in case the current node is in use (is referenced by any other node)booleanisLeftTupleMemoryEnabled()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 updatevoidnullPathMemSpec()voidresetPathMemSpec(TerminalNode removingTN)voidsetDeclaredMask(org.drools.util.bitmask.BitMask mask)voidsetEagerSegmentPrototypes(SegmentMemory.SegmentPrototype[] eagerSegmentPrototypes)voidsetInferredMask(org.drools.util.bitmask.BitMask mask)voidsetNegativeMask(org.drools.util.bitmask.BitMask mask)voidsetNextLeftTupleSinkNode(LeftTupleSinkNode next)Sets the next nodevoidsetObjectCount(int count)voidsetPartitionIdWithSinks(org.drools.base.common.RuleBasePartitionId partitionId)voidsetPathEndNodes(PathEndNode[] pathEndNodes)voidsetPathMemSpec(PathEndNode.PathMemSpec pathMemSpec)voidsetPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)Sets the previous nodevoidsetSegmentPrototypes(SegmentMemory.SegmentPrototype[] smems)LeftTupleSourceunwrapTupleSource()voidvisitLeftTupleNodes(java.util.function.Consumer<LeftTupleNode> func)-
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, setStreamMode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.base.reteoo.BaseTerminalNode
getSalienceDeclarations, isFireDirect
-
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.base.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, getType, hasAssociatedTerminal, isAssociatedWith, isRightInputIsRiaNode, removeAssociatedTerminal
-
Methods inherited from interface org.drools.core.reteoo.PathEndNode
calculatePathMemSpec
-
-
-
-
Field Detail
-
requiredDeclarations
protected org.drools.base.rule.Declaration[] requiredDeclarations
-
pathMemSpec
protected PathEndNode.PathMemSpec pathMemSpec
-
-
Constructor Detail
-
AbstractTerminalNode
public AbstractTerminalNode()
-
AbstractTerminalNode
public AbstractTerminalNode(int id, org.drools.base.common.RuleBasePartitionId partitionId, LeftTupleSource source, BuildContext context, org.drools.base.definitions.rule.impl.RuleImpl rule, org.drools.base.rule.GroupElement subrule, int subruleIndex)
-
-
Method Detail
-
getPathMemSpec
public PathEndNode.PathMemSpec getPathMemSpec()
- Specified by:
getPathMemSpecin interfacePathEndNode
-
setPathMemSpec
public void setPathMemSpec(PathEndNode.PathMemSpec pathMemSpec)
- Specified by:
setPathMemSpecin interfacePathEndNode
-
getPathMemSpec
public PathEndNode.PathMemSpec getPathMemSpec(TerminalNode removingTN)
- Specified by:
getPathMemSpecin interfacePathEndNode
-
resetPathMemSpec
public void resetPathMemSpec(TerminalNode removingTN)
- Specified by:
resetPathMemSpecin interfacePathEndNode
-
getRule
public org.drools.base.definitions.rule.impl.RuleImpl getRule()
- Specified by:
getRulein interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getSubRule
public org.drools.base.rule.GroupElement getSubRule()
- Specified by:
getSubRulein interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getSubruleIndex
public int getSubruleIndex()
- Specified by:
getSubruleIndexin interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getAllDeclarations
public org.drools.base.rule.Declaration[] getAllDeclarations()
- Specified by:
getAllDeclarationsin interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getRequiredDeclarations
public org.drools.base.rule.Declaration[] getRequiredDeclarations()
- Specified by:
getRequiredDeclarationsin interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getStartTupleSource
public LeftTupleSource getStartTupleSource()
- Specified by:
getStartTupleSourcein interfacePathEndNode
-
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 interfaceorg.drools.base.reteoo.BaseTerminalNode
-
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 org.drools.util.bitmask.BitMask getDeclaredMask()
- Specified by:
getDeclaredMaskin interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getInferredMask
public org.drools.util.bitmask.BitMask getInferredMask()
- Specified by:
getInferredMaskin interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getLeftInferredMask
public org.drools.util.bitmask.BitMask getLeftInferredMask()
- Specified by:
getLeftInferredMaskin interfaceLeftTupleSink
-
setDeclaredMask
public void setDeclaredMask(org.drools.util.bitmask.BitMask mask)
- Specified by:
setDeclaredMaskin interfaceorg.drools.base.reteoo.BaseTerminalNode
-
setInferredMask
public void setInferredMask(org.drools.util.bitmask.BitMask mask)
- Specified by:
setInferredMaskin interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getNegativeMask
public org.drools.util.bitmask.BitMask getNegativeMask()
- Specified by:
getNegativeMaskin interfaceorg.drools.base.reteoo.BaseTerminalNode
-
setNegativeMask
public void setNegativeMask(org.drools.util.bitmask.BitMask mask)
- Specified by:
setNegativeMaskin interfaceorg.drools.base.reteoo.BaseTerminalNode
-
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
-
getSinkPropagator
public LeftTupleSinkPropagator getSinkPropagator()
- Specified by:
getSinkPropagatorin interfaceLeftTupleNode
-
setPartitionIdWithSinks
public final void setPartitionIdWithSinks(org.drools.base.common.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
-
-