Package org.drools.core.phreak
Class SegmentUtilities
- java.lang.Object
-
- org.drools.core.phreak.SegmentUtilities
-
public class SegmentUtilities extends Object
-
-
Constructor Summary
Constructors Constructor Description SegmentUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckEagerSegmentCreation(LeftTupleSource lt, InternalWorkingMemory wm, int nodeTypesInSegment)static SegmentMemorycreateChildSegment(InternalWorkingMemory wm, LeftTupleNode node)static SegmentMemorycreateChildSegmentForTerminalNode(LeftTupleNode node, Memory memory)static voidcreateChildSegments(InternalWorkingMemory wm, SegmentMemory smem, LeftTupleSinkPropagator sinkProp)static SegmentMemorygetOrCreateSegmentMemory(LeftTupleSource tupleSource, InternalWorkingMemory wm)Initialises the NodeSegment memory for all nodes in the segment.static SegmentMemorygetQuerySegmentMemory(InternalWorkingMemory wm, LeftTupleSource segmentRoot, QueryElementNode queryNode)static booleaninSubNetwork(RightInputAdapterNode riaNode, LeftTupleSource leftTupleSource)Is the LeftTupleSource a node in the sub network for the RightInputAdapterNode To be in the same network, it must be a node is after the two output of the parent and before the rianode.static booleanisNonTerminalTipNode(LeftTupleNode node, TerminalNode removingTN)static booleanisRootNode(LeftTupleNode node, TerminalNode removingTN)Returns whether the node is the root of a segment.static booleanisSet(int mask, int bit)static booleanisTipNode(LeftTupleNode node, TerminalNode removingTN)Returns whether the node is the tip of a segment.static longnextNodePosMask(long nodePosMask)static intupdateNodeTypesMask(NetworkNode node, int mask)
-
-
-
Method Detail
-
getOrCreateSegmentMemory
public static SegmentMemory getOrCreateSegmentMemory(LeftTupleSource tupleSource, InternalWorkingMemory wm)
Initialises the NodeSegment memory for all nodes in the segment.
-
nextNodePosMask
public static long nextNodePosMask(long nodePosMask)
-
getQuerySegmentMemory
public static SegmentMemory getQuerySegmentMemory(InternalWorkingMemory wm, LeftTupleSource segmentRoot, QueryElementNode queryNode)
-
createChildSegments
public static void createChildSegments(InternalWorkingMemory wm, SegmentMemory smem, LeftTupleSinkPropagator sinkProp)
-
createChildSegment
public static SegmentMemory createChildSegment(InternalWorkingMemory wm, LeftTupleNode node)
-
createChildSegmentForTerminalNode
public static SegmentMemory createChildSegmentForTerminalNode(LeftTupleNode node, Memory memory)
-
inSubNetwork
public static boolean inSubNetwork(RightInputAdapterNode riaNode, LeftTupleSource leftTupleSource)
Is the LeftTupleSource a node in the sub network for the RightInputAdapterNode To be in the same network, it must be a node is after the two output of the parent and before the rianode.
-
checkEagerSegmentCreation
public static void checkEagerSegmentCreation(LeftTupleSource lt, InternalWorkingMemory wm, int nodeTypesInSegment)
-
isRootNode
public static boolean isRootNode(LeftTupleNode node, TerminalNode removingTN)
Returns whether the node is the root of a segment. Lians are always the root of a segment. node cannot be null. The result should discount any removingRule. That means it gives you the result as if the rule had already been removed from the network.
-
isTipNode
public static boolean isTipNode(LeftTupleNode node, TerminalNode removingTN)
Returns whether the node is the tip of a segment. EndNodes (rtn and rian) are always the tip of a segment. node cannot be null. The result should discount any removingRule. That means it gives you the result as if the rule had already been removed from the network.
-
isNonTerminalTipNode
public static boolean isNonTerminalTipNode(LeftTupleNode node, TerminalNode removingTN)
-
updateNodeTypesMask
public static int updateNodeTypesMask(NetworkNode node, int mask)
-
isSet
public static boolean isSet(int mask, int bit)
-
-