|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.monad.homerun.base.DataObject
com.monad.homerun.rule.Rule
public class Rule
A Rule is an ordered list of Clauses, minimum one. When a rule is applied, each clause in turn is applied, in the fashion of: if (first clause) else if (second clause), etc
| Constructor Summary | |
|---|---|
Rule()
|
|
Rule(java.lang.String name,
java.lang.String category)
|
|
Rule(java.lang.String name,
java.lang.String category,
Rule rule)
|
|
| Method Summary | |
|---|---|
void |
addClause(Clause clause)
Adds a clause to the rule |
void |
apply(java.util.Map<java.lang.String,java.lang.Object> context)
Applies the rule in the current context |
java.util.List<java.lang.String> |
getBindingVariables()
Gets a list of any binding variables in Rule |
java.util.List<java.lang.String> |
getBindingVariables(java.util.Map<java.lang.String,java.lang.Object> context)
Gets a list of any binding variables in Rule |
Clause |
getClause(int index)
Returns the clause at the specified index |
int |
getNumClauses()
Returns the number of clauses in the rule |
boolean |
isAppliable()
Can the rule be applied (does it have any conditions), as opposed to just performed ? |
boolean |
isStartable(Invoker invoker)
Can the rule be started? (as opposed to just executed/run) |
void |
removeClause(int index)
Removes a clause from the rule at specified index |
boolean |
validate(java.util.Map<java.lang.String,java.lang.Object> context)
|
| Methods inherited from class com.monad.homerun.base.DataObject |
|---|
getCategory, getModificationTime, getName, getNote, setCategory, setModificationTime, setName, setNote |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Rule()
public Rule(java.lang.String name,
java.lang.String category)
public Rule(java.lang.String name,
java.lang.String category,
Rule rule)
| Method Detail |
|---|
public final void addClause(Clause clause)
clause - public void removeClause(int index)
index - public boolean isStartable(Invoker invoker)
public boolean isAppliable()
public boolean validate(java.util.Map<java.lang.String,java.lang.Object> context)
public void apply(java.util.Map<java.lang.String,java.lang.Object> context)
throws NoResourceException
context - the invocation context
NoResourceExceptionpublic int getNumClauses()
public Clause getClause(int index)
index - the index into the clause list
public java.util.List<java.lang.String> getBindingVariables()
public java.util.List<java.lang.String> getBindingVariables(java.util.Map<java.lang.String,java.lang.Object> context)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||