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.PathMemSpec
pathMemSpec
protected org.drools.base.rule.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, org.drools.base.common.RuleBasePartitionId partitionId, boolean partitionsEnabled, 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 int
calculateHashCode()
PathMemory
createMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator)
LeftTuple
createPeer(LeftTuple original)
protected boolean
doRemove(RuleRemovalContext context, ReteooBuilder builder)
Removes the node from the network.boolean
equals(java.lang.Object object)
org.drools.base.rule.Declaration[]
getAllDeclarations()
org.drools.core.util.bitmask.BitMask
getDeclaredMask()
SegmentMemory.SegmentPrototype[]
getEagerSegmentPrototypes()
org.drools.core.util.bitmask.BitMask
getInferredMask()
org.drools.core.util.bitmask.BitMask
getLeftInferredMask()
LeftTupleSource
getLeftTupleSource()
org.drools.core.util.bitmask.BitMask
getNegativeMask()
LeftTupleSinkNode
getNextLeftTupleSinkNode()
Returns the next nodeint
getObjectCount()
ObjectTypeNode
getObjectTypeNode()
PathEndNode[]
getPathEndNodes()
int
getPathIndex()
PathEndNode.PathMemSpec
getPathMemSpec()
PathEndNode.PathMemSpec
getPathMemSpec(TerminalNode removingTN)
LeftTupleNode[]
getPathNodes()
static LeftTupleNode[]
getPathNodes(PathEndNode endNode)
LeftTupleSinkNode
getPreviousLeftTupleSinkNode()
Returns the previous nodeorg.drools.base.rule.Declaration[]
getRequiredDeclarations()
org.drools.base.definitions.rule.impl.RuleImpl
getRule()
SegmentMemory.SegmentPrototype[]
getSegmentPrototypes()
LeftTupleSinkPropagator
getSinkPropagator()
LeftTupleSource
getStartTupleSource()
org.drools.base.rule.GroupElement
getSubRule()
int
getSubruleIndex()
boolean
hasPathNode(LeftTupleNode node)
protected void
initDeclaredMask(BuildContext context)
void
initInferredMask()
static PathMemory
initPathMemory(PathEndNode pathEndNode, PathMemory pmem)
boolean
isInUse()
Returns true in case the current node is in use (is referenced by any other node)boolean
isLeftTupleMemoryEnabled()
void
networkUpdated(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 updatevoid
nullPathMemSpec()
void
resetPathMemSpec(TerminalNode removingTN)
void
setDeclaredMask(org.drools.core.util.bitmask.BitMask mask)
void
setEagerSegmentPrototypes(SegmentMemory.SegmentPrototype[] eagerSegmentPrototypes)
void
setInferredMask(org.drools.core.util.bitmask.BitMask mask)
void
setNegativeMask(org.drools.core.util.bitmask.BitMask mask)
void
setNextLeftTupleSinkNode(LeftTupleSinkNode next)
Sets the next nodevoid
setObjectCount(int count)
void
setPartitionIdWithSinks(org.drools.base.common.RuleBasePartitionId partitionId)
void
setPathEndNodes(PathEndNode[] pathEndNodes)
void
setPathMemSpec(PathEndNode.PathMemSpec pathMemSpec)
void
setPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)
Sets the previous nodevoid
setSegmentPrototypes(SegmentMemory.SegmentPrototype[] smems)
LeftTupleSource
unwrapTupleSource()
void
visitLeftTupleNodes(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, setPartitionsEnabled, 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, boolean partitionsEnabled, 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:
getPathMemSpec
in interfacePathEndNode
-
setPathMemSpec
public void setPathMemSpec(PathEndNode.PathMemSpec pathMemSpec)
- Specified by:
setPathMemSpec
in interfacePathEndNode
-
getPathMemSpec
public PathEndNode.PathMemSpec getPathMemSpec(TerminalNode removingTN)
- Specified by:
getPathMemSpec
in interfacePathEndNode
-
resetPathMemSpec
public void resetPathMemSpec(TerminalNode removingTN)
- Specified by:
resetPathMemSpec
in interfacePathEndNode
-
getRule
public org.drools.base.definitions.rule.impl.RuleImpl getRule()
- Specified by:
getRule
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getSubRule
public org.drools.base.rule.GroupElement getSubRule()
- Specified by:
getSubRule
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getSubruleIndex
public int getSubruleIndex()
- Specified by:
getSubruleIndex
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getAllDeclarations
public org.drools.base.rule.Declaration[] getAllDeclarations()
- Specified by:
getAllDeclarations
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getRequiredDeclarations
public org.drools.base.rule.Declaration[] getRequiredDeclarations()
- Specified by:
getRequiredDeclarations
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getStartTupleSource
public LeftTupleSource getStartTupleSource()
- Specified by:
getStartTupleSource
in interfacePathEndNode
-
nullPathMemSpec
public void nullPathMemSpec()
- Specified by:
nullPathMemSpec
in interfacePathEndNode
-
setPathEndNodes
public void setPathEndNodes(PathEndNode[] pathEndNodes)
- Specified by:
setPathEndNodes
in interfacePathEndNode
-
getPathEndNodes
public PathEndNode[] getPathEndNodes()
- Specified by:
getPathEndNodes
in interfacePathEndNode
-
setSegmentPrototypes
public void setSegmentPrototypes(SegmentMemory.SegmentPrototype[] smems)
- Specified by:
setSegmentPrototypes
in interfacePathEndNode
-
getSegmentPrototypes
public SegmentMemory.SegmentPrototype[] getSegmentPrototypes()
- Specified by:
getSegmentPrototypes
in interfacePathEndNode
-
getEagerSegmentPrototypes
public SegmentMemory.SegmentPrototype[] getEagerSegmentPrototypes()
- Specified by:
getEagerSegmentPrototypes
in interfacePathEndNode
-
setEagerSegmentPrototypes
public void setEagerSegmentPrototypes(SegmentMemory.SegmentPrototype[] eagerSegmentPrototypes)
- Specified by:
setEagerSegmentPrototypes
in interfacePathEndNode
-
getPathIndex
public int getPathIndex()
- Specified by:
getPathIndex
in interfaceLeftTupleNode
-
getObjectCount
public int getObjectCount()
- Specified by:
getObjectCount
in interfaceLeftTupleNode
-
setObjectCount
public void setObjectCount(int count)
- Specified by:
setObjectCount
in interfaceLeftTupleNode
-
initDeclaredMask
protected void initDeclaredMask(BuildContext context)
-
initInferredMask
public void initInferredMask()
- Specified by:
initInferredMask
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
unwrapTupleSource
public LeftTupleSource unwrapTupleSource()
- Specified by:
unwrapTupleSource
in interfaceTerminalNode
-
createMemory
public PathMemory createMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator)
- Specified by:
createMemory
in interfaceMemoryFactory<PathMemory>
-
initPathMemory
public static PathMemory initPathMemory(PathEndNode pathEndNode, PathMemory pmem)
-
createPeer
public LeftTuple createPeer(LeftTuple original)
- Specified by:
createPeer
in interfaceLeftTupleSink
-
doRemove
protected boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
Description copied from class:BaseNode
Removes the node from the network. Usually from the parentObjectSource
orTupleSource
-
getLeftTupleSource
public LeftTupleSource getLeftTupleSource()
- Specified by:
getLeftTupleSource
in interfaceLeftTupleNode
- Specified by:
getLeftTupleSource
in interfaceTerminalNode
-
getDeclaredMask
public org.drools.core.util.bitmask.BitMask getDeclaredMask()
- Specified by:
getDeclaredMask
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getInferredMask
public org.drools.core.util.bitmask.BitMask getInferredMask()
- Specified by:
getInferredMask
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getLeftInferredMask
public org.drools.core.util.bitmask.BitMask getLeftInferredMask()
- Specified by:
getLeftInferredMask
in interfaceLeftTupleSink
-
setDeclaredMask
public void setDeclaredMask(org.drools.core.util.bitmask.BitMask mask)
- Specified by:
setDeclaredMask
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
setInferredMask
public void setInferredMask(org.drools.core.util.bitmask.BitMask mask)
- Specified by:
setInferredMask
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
getNegativeMask
public org.drools.core.util.bitmask.BitMask getNegativeMask()
- Specified by:
getNegativeMask
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
setNegativeMask
public void setNegativeMask(org.drools.core.util.bitmask.BitMask mask)
- Specified by:
setNegativeMask
in interfaceorg.drools.base.reteoo.BaseTerminalNode
-
networkUpdated
public void networkUpdated(UpdateContext updateContext)
Description copied from class:BaseNode
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- Specified by:
networkUpdated
in classBaseNode
-
isInUse
public boolean isInUse()
Description copied from class:BaseNode
Returns true in case the current node is in use (is referenced by any other node)
-
isLeftTupleMemoryEnabled
public boolean isLeftTupleMemoryEnabled()
- Specified by:
isLeftTupleMemoryEnabled
in interfaceLeftTupleSink
-
getPathNodes
public static LeftTupleNode[] getPathNodes(PathEndNode endNode)
-
getPathNodes
public LeftTupleNode[] getPathNodes()
- Specified by:
getPathNodes
in interfacePathEndNode
-
hasPathNode
public final boolean hasPathNode(LeftTupleNode node)
- Specified by:
hasPathNode
in interfacePathEndNode
-
getSinkPropagator
public LeftTupleSinkPropagator getSinkPropagator()
- Specified by:
getSinkPropagator
in interfaceLeftTupleNode
-
setPartitionIdWithSinks
public final void setPartitionIdWithSinks(org.drools.base.common.RuleBasePartitionId partitionId)
- Specified by:
setPartitionIdWithSinks
in interfaceLeftTupleSink
-
getObjectTypeNode
public ObjectTypeNode getObjectTypeNode()
- Specified by:
getObjectTypeNode
in classBaseNode
-
getNextLeftTupleSinkNode
public LeftTupleSinkNode getNextLeftTupleSinkNode()
Returns the next node- Specified by:
getNextLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Returns:
- The next TupleSinkNode
-
setNextLeftTupleSinkNode
public void setNextLeftTupleSinkNode(LeftTupleSinkNode next)
Sets the next node- Specified by:
setNextLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Parameters:
next
- The next TupleSinkNode
-
getPreviousLeftTupleSinkNode
public LeftTupleSinkNode getPreviousLeftTupleSinkNode()
Returns the previous node- Specified by:
getPreviousLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Returns:
- The previous TupleSinkNode
-
setPreviousLeftTupleSinkNode
public void setPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)
Sets the previous node- Specified by:
setPreviousLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Parameters:
previous
- The previous TupleSinkNode
-
visitLeftTupleNodes
public void visitLeftTupleNodes(java.util.function.Consumer<LeftTupleNode> func)
- Specified by:
visitLeftTupleNodes
in interfaceTerminalNode
-
calculateHashCode
protected int calculateHashCode()
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
-