Package org.drools.core.reteoo.builder
Class BuildUtils
- java.lang.Object
-
- org.drools.core.reteoo.builder.BuildUtils
-
public class BuildUtils extends java.lang.ObjectUtility functions for reteoo build
-
-
Constructor Summary
Constructors Constructor Description BuildUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBuilder(java.lang.Class<?> target, ReteooComponentBuilder builder)Adds the given builder for the given target to the builders map<T extends BaseNode>
TattachNode(BuildContext context, T candidate)Attaches a node into the network.TemporalDependencyMatrixcalculateTemporalDistance(GroupElement groupElement)Calculates the temporal distance between all event patterns in the given subrule.BetaConstraintscreateBetaNodeConstraint(BuildContext context, java.util.List<BetaNodeFieldConstraint> list, boolean disableIndexing)Creates and returns a BetaConstraints object for the given list of constraintsReteooComponentBuildergetBuilderFor(java.lang.Class cls)ReteooComponentBuildergetBuilderFor(RuleConditionElement target)Returns a builder for the given target from the builders map
-
-
-
Method Detail
-
addBuilder
public void addBuilder(java.lang.Class<?> target, ReteooComponentBuilder builder)Adds the given builder for the given target to the builders map
-
getBuilderFor
public ReteooComponentBuilder getBuilderFor(RuleConditionElement target)
Returns a builder for the given target from the builders map
-
getBuilderFor
public ReteooComponentBuilder getBuilderFor(java.lang.Class cls)
-
attachNode
public <T extends BaseNode> T attachNode(BuildContext context, T candidate)
Attaches a node into the network. If a node already exists that could substitute, it is used instead.- Parameters:
context- The current build contextcandidate- 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, java.util.List<BetaNodeFieldConstraint> list, boolean disableIndexing)
Creates and returns a BetaConstraints object for the given list of constraints- Parameters:
context- the current build contextlist- the list of constraints
-
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
-
-