Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.yajre.reteoo
Class Builder  view Builder download Builder.java

java.lang.Object
  extended byorg.yajre.reteoo.Builder

public abstract class Builder
extends java.lang.Object

"AddRule" is used by org.yajre.RuleBase to build the Rete-OO network. It is the implementation of C.L. Forgy's Rete algorithm.


Constructor Summary
Builder()
           
 
Method Summary
static void AddRule(RootNode rootNode, org.yajre.spi.Rule rule)
          Add a org.yajre.spi.Rule to the network.
private static void BooleanConditions(java.util.Set filterConds, java.util.Set nodes)
          Create and attach org.yajre.spi.FilterConditions to the network.
private static TupleSource BooleanConditionsSource(org.yajre.spi.FilterCondition condition, java.util.Set sources)
          Locate a TupleSource suitable for attaching the FilterCondition.
private static boolean CanBeJoined(TupleSource left, TupleSource right)
          Determine if two TupleSources can be joined.
private static boolean ConsistentAssigns(java.util.Set assignmentConds, java.util.Set nodes)
          Create and attach org.yajre.spi.AssignmentConditions to the network.
private static TupleSource ConsistentAssignsSource(org.yajre.spi.AssignmentCondition condition, java.util.Set sources)
          Locate a TupleSource suitable for attaching the AssignmentCondition.
protected static boolean Join(java.util.Set nodes)
          Create and attach JoinNodes to the network.
private static java.util.Set Link(RootNode root, org.yajre.spi.Rule rule)
          Create the ParameterNodes for the Rule, and link into the network.
private static boolean Matches(org.yajre.spi.Condition condition, java.util.Set declarations)
          Determine if a set of Declarations match those required by a Condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Builder

public Builder()
Method Detail

AddRule

public static final void AddRule(RootNode rootNode,
                                 org.yajre.spi.Rule rule)
                          throws ReteConstructionException
Add a org.yajre.spi.Rule to the network.


Link

private static final java.util.Set Link(RootNode root,
                                        org.yajre.spi.Rule rule)
Create the ParameterNodes for the Rule, and link into the network.


BooleanConditions

private static final void BooleanConditions(java.util.Set filterConds,
                                            java.util.Set nodes)
Create and attach org.yajre.spi.FilterConditions to the network.

It may not be possible to satisfy all filder conditions on the first pass. This method removes satisfied conditions from the filterCond parameter, and leaves unsatisfied ones in the Set.


Join

protected static final boolean Join(java.util.Set nodes)
Create and attach JoinNodes to the network.

It may not be possible to join all nodes.

Any attachabeNodes member that particiates in a join is removed from the nodes collection, and replaced by the joining JoinNode.


CanBeJoined

private static final boolean CanBeJoined(TupleSource left,
                                         TupleSource right)
Determine if two TupleSources can be joined.


ConsistentAssigns

private static final boolean ConsistentAssigns(java.util.Set assignmentConds,
                                               java.util.Set nodes)
Create and attach org.yajre.spi.AssignmentConditions to the network.

It may not be possible to satisfy all assignmentConds, in which case, unsatisfied conditions will remain in the Set passed in as assignmentConds.


BooleanConditionsSource

private static final TupleSource BooleanConditionsSource(org.yajre.spi.FilterCondition condition,
                                                         java.util.Set sources)
Locate a TupleSource suitable for attaching the FilterCondition.


ConsistentAssignsSource

private static final TupleSource ConsistentAssignsSource(org.yajre.spi.AssignmentCondition condition,
                                                         java.util.Set sources)
Locate a TupleSource suitable for attaching the AssignmentCondition.


Matches

private static final boolean Matches(org.yajre.spi.Condition condition,
                                     java.util.Set declarations)
Determine if a set of Declarations match those required by a Condition.