Package org.drools.core.reteoo
Class AbstractTerminalNode
- java.lang.Object
-
- org.drools.core.common.BaseNode
-
- org.drools.core.reteoo.AbstractTerminalNode
-
- All Implemented Interfaces:
Externalizable
,Serializable
,MemoryFactory<PathMemory>
,NetworkNode
,LeftTupleNode
,LeftTupleSink
,LeftTupleSinkNode
,PathEndNode
,Sink
,TerminalNode
- Direct Known Subclasses:
QueryTerminalNode
,RuleTerminalNode
public abstract class AbstractTerminalNode extends BaseNode implements TerminalNode, Externalizable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.drools.core.reteoo.PathEndNode
PathEndNode.PathMemSpec
-
-
Field Summary
-
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)
-
Method Summary
-
Methods inherited from class org.drools.core.common.BaseNode
addAssociation, addAssociation, attach, doAttach, getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociation, setId, setPartitionId, setPartitionsEnabled, setStreamMode, toString
-
Methods inherited from class java.lang.Object
clone, equals, 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.reteoo.LeftTupleSinkNode
getNextLeftTupleSinkNode, getPreviousLeftTupleSinkNode, setNextLeftTupleSinkNode, setPreviousLeftTupleSinkNode
-
Methods inherited from interface org.drools.core.common.MemoryFactory
getMemoryId
-
Methods inherited from interface org.drools.core.common.NetworkNode
getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getPartitionId, getType, isAssociatedWith
-
Methods inherited from interface org.drools.core.reteoo.PathEndNode
calculatePathMemSpec, calculatePathMemSpec
-
Methods inherited from interface org.drools.core.reteoo.TerminalNode
getAllDeclarations, getRequiredDeclarations, getSalienceDeclarations, getSubRule, isFireDirect
-
-
-
-
Constructor Detail
-
AbstractTerminalNode
public AbstractTerminalNode()
-
AbstractTerminalNode
public AbstractTerminalNode(int id, RuleBasePartitionId partitionId, boolean partitionsEnabled, LeftTupleSource source, BuildContext context)
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classBaseNode
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classBaseNode
- Throws:
IOException
-
getPathMemSpec
public PathEndNode.PathMemSpec getPathMemSpec()
- Specified by:
getPathMemSpec
in interfacePathEndNode
-
resetPathMemSpec
public void resetPathMemSpec(TerminalNode removingTN)
- Specified by:
resetPathMemSpec
in interfacePathEndNode
-
setPathEndNodes
public void setPathEndNodes(PathEndNode[] pathEndNodes)
- Specified by:
setPathEndNodes
in interfacePathEndNode
-
getPathEndNodes
public PathEndNode[] getPathEndNodes()
- Specified by:
getPathEndNodes
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 interfaceTerminalNode
-
unwrapTupleSource
public LeftTupleSource unwrapTupleSource()
- Specified by:
unwrapTupleSource
in interfaceTerminalNode
-
getRule
public abstract RuleImpl getRule()
- Specified by:
getRule
in interfaceTerminalNode
-
createMemory
public PathMemory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm)
- 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 BitMask getDeclaredMask()
- Specified by:
getDeclaredMask
in interfaceTerminalNode
-
getInferredMask
public BitMask getInferredMask()
- Specified by:
getInferredMask
in interfaceTerminalNode
-
getLeftInferredMask
public BitMask getLeftInferredMask()
- Specified by:
getLeftInferredMask
in interfaceLeftTupleSink
-
setDeclaredMask
public void setDeclaredMask(BitMask mask)
- Specified by:
setDeclaredMask
in interfaceTerminalNode
-
setInferredMask
public void setInferredMask(BitMask mask)
- Specified by:
setInferredMask
in interfaceTerminalNode
-
getNegativeMask
public BitMask getNegativeMask()
- Specified by:
getNegativeMask
in interfaceTerminalNode
-
setNegativeMask
public void setNegativeMask(BitMask mask)
- Specified by:
setNegativeMask
in interfaceTerminalNode
-
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
-
setLeftTupleMemoryEnabled
public void setLeftTupleMemoryEnabled(boolean tupleMemoryEnabled)
- Specified by:
setLeftTupleMemoryEnabled
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
-
isTerminalNodeOf
public final boolean isTerminalNodeOf(LeftTupleNode node)
- Specified by:
isTerminalNodeOf
in interfaceTerminalNode
-
getSinkPropagator
public LeftTupleSinkPropagator getSinkPropagator()
- Specified by:
getSinkPropagator
in interfaceLeftTupleNode
-
setPartitionIdWithSinks
public final void setPartitionIdWithSinks(RuleBasePartitionId partitionId)
- Specified by:
setPartitionIdWithSinks
in interfaceLeftTupleSink
-
getObjectTypeNode
public ObjectTypeNode getObjectTypeNode()
- Specified by:
getObjectTypeNode
in classBaseNode
-
-