org.drools.rule
Class RuleSet

java.lang.Object
  |
  +--org.drools.rule.RuleSet

public class RuleSet
extends java.lang.Object

Collection of related Rules.

Author:
bob mcwhirter
See Also:
Rule

Constructor Summary
RuleSet(java.lang.String name)
          Construct.
 
Method Summary
 void addRule(Rule rule)
          Add a Rule to this RuleSet.
 boolean containsRule(java.lang.String name)
          Determine if this RuleSet contains a Rule
 java.lang.String getName()
          Retrieve the name of this RuleSet.
 Rule getRule(java.lang.String name)
          Retrieve a Rule by name.
 java.util.Iterator getRuleIterator()
          Retrieve an Iterator of all Rules in this RuleSet.
 java.util.List getRules()
          Retrieve a List of all Rules in this RuleSet.
 void setName(java.lang.String name)
          Set the name of this RuleSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleSet

public RuleSet(java.lang.String name)
Construct.
Parameters:
name - The name of this RuleSet.
Method Detail

setName

public void setName(java.lang.String name)
Set the name of this RuleSet
Parameters:
name - The name of this RuleSet

getName

public java.lang.String getName()
Retrieve the name of this RuleSet.
Returns:
The name of this RuleSet.

addRule

public void addRule(Rule rule)
             throws DuplicateRuleNameException,
                    InvalidRuleException
Add a Rule to this RuleSet.
Parameters:
rule - The rule to add.
Throws:
DuplicateRuleNameException - If the Rule attempting to be added has the same name as another previously added Rule.
InvalidRuleException - If the Rule is not valid.

getRule

public Rule getRule(java.lang.String name)
Retrieve a Rule by name.
Parameters:
name - The name of the Rule to retrieve.
Returns:
The named Rule, or null if not such Rule has been added to this RuleSet.

containsRule

public boolean containsRule(java.lang.String name)
Determine if this RuleSet contains a Rule
Parameters:
name - The name of the Rule.
Returns:
true if this RuleSet contains a Rule with the specified name, else false.

getRules

public java.util.List getRules()
Retrieve a List of all Rules in this RuleSet.
Returns:
A List of all Rules in this RuleSet.

getRuleIterator

public java.util.Iterator getRuleIterator()
Retrieve an Iterator of all Rules in this RuleSet.
Returns:
A Iterator over all Rules in this RuleSet.


Copyright © 2001-2003 The Werken Company. All Rights Reserved.