org.drools.rule
Class RuleSet

java.lang.Object
  extended byorg.drools.rule.RuleSet
All Implemented Interfaces:
java.io.Serializable

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

Collection of related Rules.

See Also:
Rule, Serialized Form
 

Field Summary
static RuleSet[] EMPTY_ARRAY
          Empty RuleSet array.
 
Constructor Summary
RuleSet(java.lang.String name)
          Construct.
RuleSet(java.lang.String name, RuleBaseContext ruleBaseContext)
          Construct.
 
Method Summary
 void addApplicationData(ApplicationData applicationData)
           
 void addFunctions(Functions functions)
           
 void addImport(ImportEntry importEntry)
           
 void addRule(Rule rule)
          Add a Rule to this RuleSet.
 boolean containsRule(java.lang.String name)
          Determine if this RuleSet contains a Rule
 java.util.Map getApplicationData()
           
 java.lang.String getDocumentation()
          Retrieve the documentation.
 Functions getFunctions(java.lang.String semantic)
           
 java.util.Set getImports()
           
 java.lang.String getName()
          Retrieve the name of this RuleSet.
 Rule getRule(java.lang.String name)
          Retrieve a Rule by name.
 RuleBaseContext getRuleBaseContext()
           
 Rule[] getRules()
          Retrieve all Rules in this RuleSet.
 void setDocumentation(java.lang.String documentation)
          Set the documentation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_ARRAY

public static final RuleSet[] EMPTY_ARRAY
Empty RuleSet array.

Constructor Detail

RuleSet

public RuleSet(java.lang.String name)
Construct.

Parameters:
name - The name of this RuleSet.

RuleSet

public RuleSet(java.lang.String name,
               RuleBaseContext ruleBaseContext)
Construct.

Parameters:
name - The name of this RuleSet.
ruleBaseContext -
Method Detail

getName

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

Returns:
The name of this RuleSet.

setDocumentation

public void setDocumentation(java.lang.String documentation)
Set the documentation.

Parameters:
documentation - The documentation.

getDocumentation

public java.lang.String getDocumentation()
Retrieve the documentation.

Returns:
The documentation or null if none.

addRule

public void addRule(Rule rule)
             throws DuplicateRuleNameException,
                    InvalidRuleException
Add a Rule to this RuleSet.

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.
Parameters:
rule - The rule to add.

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 Rule[] getRules()
Retrieve all Rules in this RuleSet.

Returns:
An array of all Rules in this RuleSet.

addImport

public void addImport(ImportEntry importEntry)

getImports

public java.util.Set getImports()

addApplicationData

public void addApplicationData(ApplicationData applicationData)

getApplicationData

public java.util.Map getApplicationData()

addFunctions

public void addFunctions(Functions functions)

getFunctions

public Functions getFunctions(java.lang.String semantic)

getRuleBaseContext

public RuleBaseContext getRuleBaseContext()