Class BuildContext

java.lang.Object
org.drools.core.reteoo.builder.BuildContext
All Implemented Interfaces:
RuleBuildContext

public class BuildContext extends Object implements RuleBuildContext
A build context for Reteoo Builder
  • Constructor Details

  • Method Details

    • getTerminals

      public 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 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 InternalRuleBase getRuleBase()
      Returns context rulebase
    • getWorkingMemories

      public 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 Collection<RuleConditionElement> getBuildstack()
    • getBetaconstraints

      public List<BetaConstraint> getBetaconstraints()
    • setBetaconstraints

      public void setBetaconstraints(List<BetaConstraint> betaconstraints)
    • getAlphaConstraints

      public List<AlphaNodeFieldConstraint> getAlphaConstraints()
    • addPathEndNode

      public void addPathEndNode(PathEndNode node)
    • isTupleMemoryEnabled

      public boolean isTupleMemoryEnabled()
    • setTupleMemoryEnabled

      public void setTupleMemoryEnabled(boolean hasLeftMemory)
    • 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 List<BaseNode> getNodes()
      Returns:
      the nodes
    • setNodes

      public void setNodes(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()
      Specified by:
      getRule in interface RuleBuildContext
    • 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 String getConsequenceName()
    • setConsequenceName

      public void setConsequenceName(String consequenceName)
    • getSubRuleIndex

      public int getSubRuleIndex()
    • setSubRuleIndex

      public void setSubRuleIndex(int subRuleIndex)