Package org.drools.core.reteoo.builder
Class BuildContext
- java.lang.Object
-
- org.drools.core.reteoo.builder.BuildContext
-
public class BuildContext extends java.lang.ObjectA build context for Reteoo Builder
-
-
Constructor Summary
Constructors Constructor Description BuildContext(RuleBase ruleBase, java.util.Collection<InternalWorkingMemory> workingMemories)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPathEndNode(PathEndNode node)voidaddPattern(Pattern pattern)java.util.List<AlphaNodeFieldConstraint>getAlphaConstraints()java.util.List<BetaNodeFieldConstraint>getBetaconstraints()java.util.Collection<RuleConditionElement>getBuildstack()java.lang.StringgetConsequenceName()EntryPointIdgetCurrentEntryPoint()longgetExpirationOffset(Pattern pattern)Pattern[]getLastBuiltPatterns()intgetNextMemoryId()intgetNextNodeId()Returns an Id for the next nodejava.util.List<BaseNode>getNodes()ObjectSourcegetObjectSource()RuleBasePartitionIdgetPartitionId()java.util.List<Pattern>getPatterns()ObjectTypeNodegetRootObjectTypeNode()RuleImplgetRule()RuleBasegetRuleBase()Returns context rulebaseGroupElementgetSubRule()intgetSubRuleIndex()java.util.List<TerminalNode>getTerminals()LeftTupleSourcegetTupleSource()java.util.Collection<InternalWorkingMemory>getWorkingMemories()Return the array of working memories associated with the given rulebase.booleanisEmptyForAllBetaConstraints()booleanisObjectTypeNodeMemoryEnabled()booleanisQuery()booleanisStreamMode()booleanisTupleMemoryEnabled()RuleConditionElementpeek()Returns the top stack element without removing itRuleComponentpeekRuleComponent()Peeks at the top element from the rule component stack.RuleConditionElementpop()Removes the top stack elementRuleComponentpopRuleComponent()Removes the top element from the rule component stack.voidpush(RuleConditionElement rce)Adds the rce to the build stackvoidpushRuleComponent(RuleComponent ruleComponent)Adds the ruleComponent to the top of the rule component stack.voidreleaseId(NetworkNode node)Method used to undo previous id assignmentvoidsetBetaconstraints(java.util.List<BetaNodeFieldConstraint> betaconstraints)voidsetConsequenceName(java.lang.String consequenceName)voidsetCurrentEntryPoint(EntryPointId currentEntryPoint)voidsetLastBuiltPattern(Pattern lastBuiltPattern)voidsetNodes(java.util.List<BaseNode> nodes)voidsetObjectSource(ObjectSource objectSource)voidsetObjectTypeNodeMemoryEnabled(boolean hasObjectTypeMemory)voidsetPartitionId(RuleBasePartitionId partitionId)voidsetRootObjectTypeNode(ObjectTypeNode source)voidsetRule(RuleImpl rule)voidsetSubRuleIndex(int subRuleIndex)voidsetTupleMemoryEnabled(boolean hasLeftMemory)voidsetTupleSource(LeftTupleSource tupleSource)voidsyncObjectTypesWithObjectCount()
-
-
-
Constructor Detail
-
BuildContext
public BuildContext(RuleBase ruleBase, java.util.Collection<InternalWorkingMemory> workingMemories)
-
-
Method Detail
-
getTerminals
public java.util.List<TerminalNode> getTerminals()
-
isEmptyForAllBetaConstraints
public boolean isEmptyForAllBetaConstraints()
-
syncObjectTypesWithObjectCount
public void syncObjectTypesWithObjectCount()
-
getObjectSource
public ObjectSource getObjectSource()
- Returns:
- the objectSource
-
setObjectSource
public void setObjectSource(ObjectSource objectSource)
- Parameters:
objectSource- the objectSource to set
-
getPatterns
public java.util.List<Pattern> getPatterns()
-
addPattern
public void addPattern(Pattern pattern)
-
getTupleSource
public LeftTupleSource getTupleSource()
- Returns:
- the tupleSource
-
setTupleSource
public void setTupleSource(LeftTupleSource tupleSource)
- Parameters:
tupleSource- the tupleSource to set
-
getRuleBase
public RuleBase getRuleBase()
Returns context rulebase
-
getWorkingMemories
public java.util.Collection<InternalWorkingMemory> getWorkingMemories()
Return the array of working memories associated with the given rulebase.
-
getNextNodeId
public int getNextNodeId()
Returns an Id for the next node
-
getNextMemoryId
public int getNextMemoryId()
-
releaseId
public void releaseId(NetworkNode node)
Method used to undo previous id assignment
-
push
public void push(RuleConditionElement rce)
Adds the rce to the build stack
-
pop
public RuleConditionElement pop()
Removes the top stack element
-
peek
public RuleConditionElement peek()
Returns the top stack element without removing it
-
getBuildstack
public java.util.Collection<RuleConditionElement> getBuildstack()
-
getBetaconstraints
public java.util.List<BetaNodeFieldConstraint> getBetaconstraints()
-
setBetaconstraints
public void setBetaconstraints(java.util.List<BetaNodeFieldConstraint> betaconstraints)
-
getAlphaConstraints
public java.util.List<AlphaNodeFieldConstraint> getAlphaConstraints()
-
addPathEndNode
public void addPathEndNode(PathEndNode node)
-
isTupleMemoryEnabled
public boolean isTupleMemoryEnabled()
-
setTupleMemoryEnabled
public void setTupleMemoryEnabled(boolean hasLeftMemory)
-
isObjectTypeNodeMemoryEnabled
public boolean isObjectTypeNodeMemoryEnabled()
-
setObjectTypeNodeMemoryEnabled
public void setObjectTypeNodeMemoryEnabled(boolean hasObjectTypeMemory)
-
isQuery
public boolean isQuery()
-
getCurrentEntryPoint
public EntryPointId getCurrentEntryPoint()
- Returns:
- the currentEntryPoint
-
setCurrentEntryPoint
public void setCurrentEntryPoint(EntryPointId currentEntryPoint)
- Parameters:
currentEntryPoint- the currentEntryPoint to set
-
getNodes
public java.util.List<BaseNode> getNodes()
- Returns:
- the nodes
-
setNodes
public void setNodes(java.util.List<BaseNode> nodes)
- Parameters:
nodes- the nodes to set
-
getPartitionId
public RuleBasePartitionId getPartitionId()
- Returns:
- the partitionId
-
setPartitionId
public void setPartitionId(RuleBasePartitionId partitionId)
- Parameters:
partitionId- the partitionId to set
-
isStreamMode
public boolean isStreamMode()
-
getExpirationOffset
public long getExpirationOffset(Pattern pattern)
-
getRule
public RuleImpl getRule()
-
setRule
public void setRule(RuleImpl rule)
-
getSubRule
public GroupElement getSubRule()
-
popRuleComponent
public RuleComponent popRuleComponent()
Removes the top element from the rule component stack. The rule component stack is used to add trackability to the ReteOO nodes so that they can be linked to the rule components that originated them.
-
peekRuleComponent
public RuleComponent peekRuleComponent()
Peeks at the top element from the rule component stack. The rule component stack is used to add trackability to the ReteOO nodes so that they can be linked to the rule components that originated them.
-
pushRuleComponent
public void pushRuleComponent(RuleComponent ruleComponent)
Adds the ruleComponent to the top of the rule component stack. The rule component stack is used to add trackability to the ReteOO nodes so that they can be linked to the rule components that originated them.
-
getRootObjectTypeNode
public ObjectTypeNode getRootObjectTypeNode()
-
setRootObjectTypeNode
public void setRootObjectTypeNode(ObjectTypeNode source)
-
getLastBuiltPatterns
public Pattern[] getLastBuiltPatterns()
-
setLastBuiltPattern
public void setLastBuiltPattern(Pattern lastBuiltPattern)
-
getConsequenceName
public java.lang.String getConsequenceName()
-
setConsequenceName
public void setConsequenceName(java.lang.String consequenceName)
-
getSubRuleIndex
public int getSubRuleIndex()
-
setSubRuleIndex
public void setSubRuleIndex(int subRuleIndex)
-
-