rdr.core
Class Rule

java.lang.Object
  extended by rdr.core.Rule
All Implemented Interfaces:
java.io.Serializable

public class Rule
extends java.lang.Object
implements java.io.Serializable

A rule. Comprised of a set of rule Conditions. For RDR systems - If each rule Condition is satisfied, the rule is satisfied

See Also:
Serialized Form

Constructor Summary
Rule(int ruleID)
          Constructor.
Rule(int ruleID, common.datastructures.MyFastVector<Condition> conditions)
          Constructor.
Rule(common.datastructures.MyFastVector<Condition> conditions)
          Default constructor.
Rule(common.datastructures.MyFastVector<Condition> conditions, Case createdFor)
          Default constructor.
 
Method Summary
 common.datastructures.MyFastVector<Condition> getConditions()
           
 Case getCreatedFor()
           
 int getRuleID()
          Get the rule id
 void incrementRuleIDCount()
          Increment the ruleID count.
 boolean isSatisfied(Case c)
          Check to see is this rule satisfied by the case c?
 void setConditions(common.datastructures.MyFastVector<Condition> conditions)
          Set the conditions.
 void setCreatedFor(Case c)
           
 java.lang.String toString()
          Convert the rule to readable text.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule(common.datastructures.MyFastVector<Condition> conditions)
Default constructor. Used when you want to create a rule. There is a different version for creating a rule with a specific ruleID, and another one for creating a rule and NOT incrementing the ruleID count.

Parameters:
conditions -

Rule

public Rule(common.datastructures.MyFastVector<Condition> conditions,
            Case createdFor)
Default constructor. Used when you want to create a rule. There is a different version for creating a rule with a specific ruleID, and another one for creating a rule and NOT incrementing the ruleID count.

Parameters:
conditions -
createdFor - the case this rule was created for

Rule

public Rule(int ruleID)
Constructor. Typically used to create the root rule only

Parameters:
ruleID -

Rule

public Rule(int ruleID,
            common.datastructures.MyFastVector<Condition> conditions)
Constructor. Warning: if you set the ruleID manually using this constructor you could make rules with duplicate ruleID's!

Parameters:
ruleID -
conditions -
Method Detail

getConditions

public common.datastructures.MyFastVector<Condition> getConditions()
Returns:
the set of conditions that make up the rule

setConditions

public void setConditions(common.datastructures.MyFastVector<Condition> conditions)
Set the conditions.

Parameters:
conditions - the set of conditions that make up the rule

toString

public java.lang.String toString()
Convert the rule to readable text.

Overrides:
toString in class java.lang.Object

getRuleID

public int getRuleID()
Get the rule id

Returns:
the rule id

incrementRuleIDCount

public void incrementRuleIDCount()
Increment the ruleID count. This should be called only when a rule is added permanently


isSatisfied

public boolean isSatisfied(Case c)
Check to see is this rule satisfied by the case c?

Parameters:
c - the case to compare against

getCreatedFor

public Case getCreatedFor()

setCreatedFor

public void setCreatedFor(Case c)