Drools :: Core 6.0.0.Beta5

org.drools.core.reteoo.builder
Class BuildContext

java.lang.Object
  extended by org.drools.core.reteoo.builder.BuildContext

public class BuildContext
extends Object

A build context for Reteoo Builder


Constructor Summary
BuildContext(InternalRuleBase rulebase, ReteooBuilder.IdGenerator idGenerator)
           
 
Method Summary
 void decrementCurrentPatternOffset()
           
 List<AlphaNodeFieldConstraint> getAlphaConstraints()
           
 List<BetaNodeFieldConstraint> getBetaconstraints()
           
 LinkedList<RuleConditionElement> getBuildStack()
           
 ReteooComponentFactory getComponentFactory()
           
 EntryPoint getCurrentEntryPoint()
           
 int getCurrentPatternOffset()
           
 Pattern[] getLastBuiltPatterns()
           
 int getNextId()
          Returns an Id for the next node
 List<BaseNode> getNodes()
           
 ObjectSource getObjectSource()
           
 LinkedList<Pattern> getObjectType()
           
 RuleBasePartitionId getPartitionId()
           
 ObjectTypeNode getRootObjectTypeNode()
           
 Rule getRule()
           
 InternalRuleBase getRuleBase()
          Returns context rulebase
 GroupElement getSubRule()
           
 TemporalDependencyMatrix getTemporalDistance()
           
 LeftTupleSource getTupleSource()
           
 InternalWorkingMemory[] getWorkingMemories()
          Return the array of working memories associated with the given rulebase.
 void incrementCurrentPatternOffset()
           
 boolean isAttachPQN()
           
 boolean isEmptyForAllBetaConstraints()
           
 boolean isObjectTypeNodeMemoryEnabled()
           
 boolean isQuery()
           
 boolean isStreamMode()
           
 boolean isTupleMemoryEnabled()
           
 RuleConditionElement peek()
          Returns the top stack element without removing it
 RuleComponent peekRuleComponent()
          Peeks at the top element from the rule component stack.
 RuleConditionElement pop()
          Removes the top stack element
 RuleComponent popRuleComponent()
          Removes the top element from the rule component stack.
 void push(RuleConditionElement rce)
          Adds the rce to the build stack
 void pushRuleComponent(RuleComponent ruleComponent)
          Adds the ruleComponent to the top of the rule component stack.
 void releaseId(int id)
          Method used to undo previous id assignment
 void setAlphaConstraints(List<AlphaNodeFieldConstraint> alphaConstraints)
           
 void setAttachPQN(boolean attachPQN)
           
 void setBetaconstraints(List<BetaNodeFieldConstraint> betaconstraints)
           
 void setComponentFactory(ReteooComponentFactory componentFactory)
           
 void setCurrentEntryPoint(EntryPoint currentEntryPoint)
           
 void setCurrentPatternOffset(int currentPatternIndex)
           
 void setEmptyForAllBetaConstraints(boolean emptyForAllBetaConstraints)
           
 void setLastBuiltPattern(Pattern lastBuiltPattern)
           
 void setNodes(List<BaseNode> nodes)
           
 void setObjectSource(ObjectSource objectSource)
           
 void setObjectType(LinkedList<Pattern> objectType)
           
 void setObjectTypeNodeMemoryEnabled(boolean hasObjectTypeMemory)
           
 void setPartitionId(RuleBasePartitionId partitionId)
           
 void setRootObjectTypeNode(ObjectTypeNode source)
           
 void setRule(Rule rule)
           
 void setSubRule(GroupElement subRule)
           
 void setTemporalDistance(TemporalDependencyMatrix temporal)
           
 void setTupleMemoryEnabled(boolean hasLeftMemory)
           
 void setTupleSource(LeftTupleSource tupleSource)
           
 ListIterator<RuleConditionElement> stackIterator()
          Returns a list iterator to iterate over the stacked elements
 void syncObjectTypesWithPatternOffset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildContext

public BuildContext(InternalRuleBase rulebase,
                    ReteooBuilder.IdGenerator idGenerator)
Method Detail

isEmptyForAllBetaConstraints

public boolean isEmptyForAllBetaConstraints()

setEmptyForAllBetaConstraints

public void setEmptyForAllBetaConstraints(boolean emptyForAllBetaConstraints)

getCurrentPatternOffset

public int getCurrentPatternOffset()
Returns:
the currentPatternOffset

setCurrentPatternOffset

public void setCurrentPatternOffset(int currentPatternIndex)
Parameters:
currentPatternIndex - the currentPatternOffset to set

syncObjectTypesWithPatternOffset

public void syncObjectTypesWithPatternOffset()

getObjectSource

public ObjectSource getObjectSource()
Returns:
the objectSource

setObjectSource

public void setObjectSource(ObjectSource objectSource)
Parameters:
objectSource - the objectSource to set

getObjectType

public LinkedList<Pattern> getObjectType()
Returns:
the objectType

setObjectType

public void setObjectType(LinkedList<Pattern> objectType)
Parameters:
objectType - the objectType to set

getTupleSource

public LeftTupleSource getTupleSource()
Returns:
the tupleSource

setTupleSource

public void setTupleSource(LeftTupleSource tupleSource)
Parameters:
tupleSource - the tupleSource to set

incrementCurrentPatternOffset

public void incrementCurrentPatternOffset()

decrementCurrentPatternOffset

public void decrementCurrentPatternOffset()

getRuleBase

public InternalRuleBase getRuleBase()
Returns context rulebase

Returns:

getWorkingMemories

public InternalWorkingMemory[] getWorkingMemories()
Return the array of working memories associated with the given rulebase.

Returns:

getNextId

public int getNextId()
Returns an Id for the next node

Returns:

releaseId

public void releaseId(int id)
Method used to undo previous id assignment


push

public void push(RuleConditionElement rce)
Adds the rce to the build stack

Parameters:
rce -

pop

public RuleConditionElement pop()
Removes the top stack element

Returns:

peek

public RuleConditionElement peek()
Returns the top stack element without removing it

Returns:

stackIterator

public ListIterator<RuleConditionElement> stackIterator()
Returns a list iterator to iterate over the stacked elements

Returns:

getBetaconstraints

public List<BetaNodeFieldConstraint> getBetaconstraints()
Returns:
the betaconstraints

setBetaconstraints

public void setBetaconstraints(List<BetaNodeFieldConstraint> betaconstraints)
Parameters:
betaconstraints - the betaconstraints to set

getAlphaConstraints

public List<AlphaNodeFieldConstraint> getAlphaConstraints()
Returns:

setAlphaConstraints

public void setAlphaConstraints(List<AlphaNodeFieldConstraint> alphaConstraints)

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 EntryPoint getCurrentEntryPoint()
Returns:
the currentEntryPoint

setCurrentEntryPoint

public void setCurrentEntryPoint(EntryPoint 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()

getTemporalDistance

public TemporalDependencyMatrix getTemporalDistance()

setTemporalDistance

public void setTemporalDistance(TemporalDependencyMatrix temporal)

getBuildStack

public LinkedList<RuleConditionElement> getBuildStack()

getRule

public Rule getRule()

setRule

public void setRule(Rule rule)

getSubRule

public GroupElement getSubRule()

setSubRule

public void setSubRule(GroupElement subRule)

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.

Returns:

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.

Returns:

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)

isAttachPQN

public boolean isAttachPQN()

setAttachPQN

public void setAttachPQN(boolean attachPQN)

getComponentFactory

public ReteooComponentFactory getComponentFactory()

setComponentFactory

public void setComponentFactory(ReteooComponentFactory componentFactory)

Drools :: Core 6.0.0.Beta5

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.