|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.engine.IlrPackage
public class IlrPackage
This class models the packages in the IRL language. The ruleset contains packages. Each package may contain rules, functions, tasks and variables. Each ruleset contains at least one package, the default package, whose name is the empty string.
Constructor Summary | |
---|---|
IlrPackage(ilog.rules.factory.IlrReflectClass contextClass,
IlrRuleset ruleset,
String name)
|
Method Summary | |
---|---|
boolean |
containsRule(IlrRule rule)
Tests whether the package contains a rule. |
IlrFunction[] |
getAllFunctions()
Returns all the functions in the package. |
IlrRule[] |
getAllRules()
Returns all the rules in the package. |
IlrTask[] |
getAllTasks()
Returns all the tasks in the package. |
IlrFunction |
getFunction(String name,
Class[] argumentTypes)
Returns the function in the ruleset whose name is name and whose argument types are those passed as
parameters. |
IlrFunction |
getFunction(String name,
IlrType[] argumentTypes)
Returns the function in the ruleset whose name is name and whose argument types are those passed as
parameters. |
String |
getName()
Returns the name of the package. |
IlrRule |
getRule(String ruleName)
Returns the rule whose name is given as the parameter. |
Iterator |
getRuleIterator()
Returns an iterator on the rules contained in the package. |
int |
getRuleNumber()
Returns the number of rules in this package. |
IlrRuleset |
getRuleset()
Returns the ruleset that contains this package. |
IlrTask |
getTask(String name)
Returns the task defined in the package and whose name is the one passed as the parameter. |
IlrRulesetParameter[] |
getVariables()
Returns the variables defined in this package. |
boolean |
isDefaultPackage()
Returns a boolean telling whether the package is the default package or not. |
IlrPackageFactory |
makeFactory()
Builds a factory object to represent this package. |
IlrPackageFactory |
makeFactory(IlrRulesetFactory rulesetF)
Builds a factory object to represent this package. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IlrPackage(ilog.rules.factory.IlrReflectClass contextClass, IlrRuleset ruleset, String name)
Method Detail |
---|
public boolean isDefaultPackage()
true
if the package is the default package, else returns false
.public String getName()
public IlrRuleset getRuleset()
this
package.
public final int getRuleNumber()
public final IlrRule getRule(String ruleName)
ruleName
- The name of the rule.
IlrRule
whose name is provided as the parameter, if this rule exists. Otherwise,
null
is returned.public final Iterator getRuleIterator()
remove
method of this iterator will
throw an UnsupportedOperationException
.
IlrRule
instances.public final boolean containsRule(IlrRule rule)
rule
- A rule.
true
if the package contains the rule. Otherwise, it returns false
.public final IlrRule[] getAllRules()
IlrRule
. The length of the array can be 0.public final IlrFunction[] getAllFunctions()
IlrFunction[]
. The length of the array can be 0.public final IlrFunction getFunction(String name, IlrType[] argumentTypes)
name
and whose argument types are those passed as
parameters.
name
- The name of the function.argumentTypes
- The array of argument types that correspond to the signature of the function we are looking
for.
public final IlrFunction getFunction(String name, Class[] argumentTypes)
name
and whose argument types are those passed as
parameters.
name
- The name of the function.argumentTypes
- The array of argument types, as Class
, that correspond to the signature of the
function we are looking for.
public IlrTask getTask(String name)
null
if no such task exists.
name
- The name of a task to return.
name
.public final IlrTask[] getAllTasks()
IlrTask[]
. The length of the array can be 0.public IlrRulesetParameter[] getVariables()
IlrRulesetParameter
, each
of them containing the type as an IlrClass
and the name of the variable.
IlrRulesetParameter
public final IlrPackageFactory makeFactory()
public final IlrPackageFactory makeFactory(IlrRulesetFactory rulesetF)
rulesetF
- An IlrRulesetFactory
.
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |