org.drools.reteoo.builder
Class BuildContext

java.lang.Object
  extended by org.drools.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 getAlphaConstraints()
           
 List<Behavior> getBehaviors()
           
 List getBetaconstraints()
           
 LinkedList<RuleConditionElement> getBuildStack()
           
 EntryPoint getCurrentEntryPoint()
           
 int getCurrentPatternOffset()
           
 int getNextId()
          Returns an Id for the next node
 int getNextSequence(String groupName)
           
 List<BaseNode> getNodes()
           
 ObjectSource getObjectSource()
           
 LinkedList getObjectType()
           
 RuleBasePartitionId getPartitionId()
           
 ObjectTypeNode getRootObjectTypeNode()
           
 Rule getRule()
           
 InternalRuleBase getRuleBase()
          Returns context rulebase
 TemporalDependencyMatrix getTemporalDistance()
           
 LeftTupleSource getTupleSource()
           
 InternalWorkingMemory[] getWorkingMemories()
          Return the array of working memories associated with the given rulebase.
 void incrementCurrentPatternOffset()
           
 boolean isAlphaMemoryAllowed()
           
 boolean isObjectTypeNodeMemoryEnabled()
           
 boolean isQuery()
           
 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 alphaConstraints)
           
 void setAlphaNodeMemoryAllowed(boolean alphaMemoryAllowed)
           
 void setBehaviors(List<Behavior> behaviors)
           
 void setBetaconstraints(List betaconstraints)
           
 void setCurrentEntryPoint(EntryPoint currentEntryPoint)
           
 void setCurrentPatternOffset(int currentPatternIndex)
           
 void setNodes(List<BaseNode> nodes)
           
 void setObjectSource(ObjectSource objectSource)
           
 void setObjectType(LinkedList objectType)
           
 void setObjectTypeNodeMemoryEnabled(boolean hasObjectTypeMemory)
           
 void setPartitionId(RuleBasePartitionId partitionId)
           
 void setRootObjectTypeNode(ObjectTypeNode source)
           
 void setRule(Rule rule)
           
 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

getCurrentPatternOffset

public int getCurrentPatternOffset()
Returns:
the currentPatternOffset

setCurrentPatternOffset

public void setCurrentPatternOffset(int currentPatternIndex)
Parameters:
currentPatternOffset - 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 getObjectType()
Returns:
the objectType

setObjectType

public void setObjectType(LinkedList 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 getBetaconstraints()
Returns:
the betaconstraints

setBetaconstraints

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

getNextSequence

public int getNextSequence(String groupName)

getAlphaConstraints

public List getAlphaConstraints()
Returns:

setAlphaConstraints

public void setAlphaConstraints(List alphaConstraints)

isTupleMemoryEnabled

public boolean isTupleMemoryEnabled()

setTupleMemoryEnabled

public void setTupleMemoryEnabled(boolean hasLeftMemory)

isObjectTypeNodeMemoryEnabled

public boolean isObjectTypeNodeMemoryEnabled()

setObjectTypeNodeMemoryEnabled

public void setObjectTypeNodeMemoryEnabled(boolean hasObjectTypeMemory)

setAlphaNodeMemoryAllowed

public void setAlphaNodeMemoryAllowed(boolean alphaMemoryAllowed)

isAlphaMemoryAllowed

public boolean isAlphaMemoryAllowed()

isQuery

public boolean isQuery()

getCurrentEntryPoint

public EntryPoint getCurrentEntryPoint()
Returns:
the currentEntryPoint

setCurrentEntryPoint

public void setCurrentEntryPoint(EntryPoint currentEntryPoint)
Parameters:
currentEntryPoint - the currentEntryPoint to set

getBehaviors

public List<Behavior> getBehaviors()
Returns:
the behaviours

setBehaviors

public void setBehaviors(List<Behavior> behaviors)
Parameters:
behaviors - the behaviours 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

setTemporalDistance

public void setTemporalDistance(TemporalDependencyMatrix temporal)

getTemporalDistance

public TemporalDependencyMatrix getTemporalDistance()

getBuildStack

public LinkedList<RuleConditionElement> getBuildStack()

getRule

public Rule getRule()

setRule

public void setRule(Rule rule)

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.


setRootObjectTypeNode

public void setRootObjectTypeNode(ObjectTypeNode source)

getRootObjectTypeNode

public ObjectTypeNode getRootObjectTypeNode()


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