org.drools.reteoo.builder
Class BuildUtils

java.lang.Object
  extended by org.drools.reteoo.builder.BuildUtils

public class BuildUtils
extends Object

Utility functions for reteoo build


Constructor Summary
BuildUtils()
           
 
Method Summary
 void addBuilder(Class<?> target, ReteooComponentBuilder builder)
          Adds the given builder for the given target to the builders map
 BaseNode attachNode(BuildContext context, BaseNode candidate)
          Attaches a node into the network.
 TemporalDependencyMatrix calculateTemporalDistance(GroupElement groupElement)
          Calculates the temporal distance between all event patterns in the given subrule.
 void checkUnboundDeclarations(BuildContext context, Declaration[] declarations)
          Make sure the required declarations are previously bound
 BetaConstraints createBetaNodeConstraint(BuildContext context, List<BetaNodeFieldConstraint> list, boolean disableIndexing)
          Creates and returns a BetaConstraints object for the given list of constraints
 ReteooComponentBuilder getBuilderFor(RuleConditionElement target)
          Returns a builder for the given target from the builders map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildUtils

public BuildUtils()
Method Detail

addBuilder

public void addBuilder(Class<?> target,
                       ReteooComponentBuilder builder)
Adds the given builder for the given target to the builders map

Parameters:
target -
builder -

getBuilderFor

public ReteooComponentBuilder getBuilderFor(RuleConditionElement target)
Returns a builder for the given target from the builders map

Parameters:
target -
Returns:
returns null if not found

attachNode

public BaseNode attachNode(BuildContext context,
                           BaseNode candidate)
Attaches a node into the network. If a node already exists that could substitute, it is used instead.

Parameters:
context - The current build context
candidate - The node to attach.
Returns:
the actual attached node that may be the one given as parameter or eventually one that was already in the cache if sharing is enabled

createBetaNodeConstraint

public BetaConstraints createBetaNodeConstraint(BuildContext context,
                                                List<BetaNodeFieldConstraint> list,
                                                boolean disableIndexing)
Creates and returns a BetaConstraints object for the given list of constraints

Parameters:
context - the current build context
list - the list of constraints
Returns:

checkUnboundDeclarations

public void checkUnboundDeclarations(BuildContext context,
                                     Declaration[] declarations)
                              throws InvalidPatternException
Make sure the required declarations are previously bound

Parameters:
declarations -
Throws:
InvalidPatternException

calculateTemporalDistance

public TemporalDependencyMatrix calculateTemporalDistance(GroupElement groupElement)
Calculates the temporal distance between all event patterns in the given subrule.

Parameters:
groupElement - the root element of a subrule being added to the rulebase


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.