Package org.drools.core.phreak
Class BuildtimeSegmentUtilities
- java.lang.Object
-
- org.drools.core.phreak.BuildtimeSegmentUtilities
-
public class BuildtimeSegmentUtilities extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
CONDITIONAL_BRANCH_BIT
static int
JOIN_NODE_BIT
static int
NOT_NODE_BIT
static int
PASSIVE_EXISTS_NODE_BIT
static int
REACTIVE_EXISTS_NODE_BIT
-
Constructor Summary
Constructors Constructor Description BuildtimeSegmentUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
canBeDisabled(BetaNode betaNode)
static SegmentMemory.SegmentPrototype[]
createLeftTupleNodeProtoMemories(LeftTupleNode lts, TerminalNode removingTn, InternalRuleBase rbase)
static SegmentMemory.SegmentPrototype[]
createPathProtoMemories(TerminalNode tn, TerminalNode removingTn, InternalRuleBase rbase)
static SegmentMemory.SegmentPrototype
createSegmentMemory(LeftTupleNode segmentRoot, LeftTupleNode segmentTip, int recordBefore, TerminalNode removingTn, InternalRuleBase rbase)
Initialises the NodeSegment memory for all nodes in the segment.static LeftTupleNode
findSegmentRoot(LeftTupleNode tupleSource)
static LeftTupleNode
findSegmentRoot(LeftTupleNode tupleSource, TerminalNode ignoreTn)
static long
getPathAllLinkedMaskTest(SegmentMemory.SegmentPrototype[] smems, PathEndNode endNode)
static boolean
isAssociatedWith(org.drools.base.common.NetworkNode node, TerminalNode tn)
static boolean
isNonTerminalTipNode(LeftTupleNode node, TerminalNode removingTN)
static boolean
isRootNode(LeftTupleNode node, TerminalNode ignoreTn)
Returns whether the node is the root of a segment.static boolean
isSet(int mask, int bit)
static boolean
isTipNode(LeftTupleNode node, TerminalNode removingTN)
Returns whether the node is the tip of a segment.static long
nextNodePosMask(long posMask)
static boolean
requiresAnEagerSegment(int nodeTypesInSegment)
static boolean
sinkNotExclusivelyAssociatedWithTerminal(TerminalNode removingTN, LeftTupleNode sink)
static int
updateNodeTypesMask(org.drools.base.common.NetworkNode node, int mask)
static void
updateSegmentEndNodes(PathEndNode endNode)
-
-
-
Field Detail
-
NOT_NODE_BIT
public static final int NOT_NODE_BIT
- See Also:
- Constant Field Values
-
JOIN_NODE_BIT
public static final int JOIN_NODE_BIT
- See Also:
- Constant Field Values
-
REACTIVE_EXISTS_NODE_BIT
public static final int REACTIVE_EXISTS_NODE_BIT
- See Also:
- Constant Field Values
-
PASSIVE_EXISTS_NODE_BIT
public static final int PASSIVE_EXISTS_NODE_BIT
- See Also:
- Constant Field Values
-
CONDITIONAL_BRANCH_BIT
public static final int CONDITIONAL_BRANCH_BIT
- See Also:
- Constant Field Values
-
-
Method Detail
-
updateSegmentEndNodes
public static void updateSegmentEndNodes(PathEndNode endNode)
-
getPathAllLinkedMaskTest
public static long getPathAllLinkedMaskTest(SegmentMemory.SegmentPrototype[] smems, PathEndNode endNode)
-
createPathProtoMemories
public static SegmentMemory.SegmentPrototype[] createPathProtoMemories(TerminalNode tn, TerminalNode removingTn, InternalRuleBase rbase)
-
createLeftTupleNodeProtoMemories
public static SegmentMemory.SegmentPrototype[] createLeftTupleNodeProtoMemories(LeftTupleNode lts, TerminalNode removingTn, InternalRuleBase rbase)
-
createSegmentMemory
public static SegmentMemory.SegmentPrototype createSegmentMemory(LeftTupleNode segmentRoot, LeftTupleNode segmentTip, int recordBefore, TerminalNode removingTn, InternalRuleBase rbase)
Initialises the NodeSegment memory for all nodes in the segment.
-
requiresAnEagerSegment
public static boolean requiresAnEagerSegment(int nodeTypesInSegment)
-
nextNodePosMask
public static long nextNodePosMask(long posMask)
-
canBeDisabled
public static boolean canBeDisabled(BetaNode betaNode)
-
isRootNode
public static boolean isRootNode(LeftTupleNode node, TerminalNode ignoreTn)
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)
-
sinkNotExclusivelyAssociatedWithTerminal
public static boolean sinkNotExclusivelyAssociatedWithTerminal(TerminalNode removingTN, LeftTupleNode sink)
-
updateNodeTypesMask
public static int updateNodeTypesMask(org.drools.base.common.NetworkNode node, int mask)
-
isSet
public static boolean isSet(int mask, int bit)
-
findSegmentRoot
public static LeftTupleNode findSegmentRoot(LeftTupleNode tupleSource)
-
findSegmentRoot
public static LeftTupleNode findSegmentRoot(LeftTupleNode tupleSource, TerminalNode ignoreTn)
-
isAssociatedWith
public static boolean isAssociatedWith(org.drools.base.common.NetworkNode node, TerminalNode tn)
-
-