|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface InferenceContext
Rule context
| Field Summary | |
|---|---|
static InferenceContext |
INSTANCE
Implementations set this constant to provide rules access to inference context in implementation-neutral way. |
| Method Summary | |
|---|---|
void |
addUndo(Runnable undoCommand)
When an object is removed from knowledge base, its conclusions are also removed. |
boolean |
consumeInput(int position,
boolean local)
Rules invoke this method from multi-fact (multi-parameter) inference methods to indicate that a fact passed in position parameter
shall not participate in further joins. |
boolean |
contains(Object fact)
|
Collection<?> |
getObjects()
|
Map<String,?> |
getProperties()
|
int[] |
parameterIndices()
This method shall be invoked only from accept methods. |
void |
post(Object... conclusions)
Posts conclusions to rules container. |
void |
put(Object fact)
Puts a fact to the knowledge base. |
void |
remove(Object fact)
Removes object from the knowledge base. |
Method |
targetMethod()
|
void |
update(Object fact)
Updates mutable fact. |
void |
update(Object originalFact,
Object newFact)
Updates immutable fact with a new value. |
| Field Detail |
|---|
static final InferenceContext INSTANCE
| Method Detail |
|---|
void post(Object... conclusions)
conclusion -
void put(Object fact)
throws ReasoningException
fact -
ReasoningException
boolean consumeInput(int position,
boolean local)
position parameter
shall not participate in further joins.
position - local - Rule may consume incoming fact to prevent it being handled to other rules
or to prevent its participation in further joins in multi-fact rules. If local is true,
the fact is removed from further rule joins, but it will be handled to other rules. If
false, the fact will not be handled to other rules, but it will be stored in rule's collection
of input facts to participate in further joins.
IllegalArgumentException - If local argument is true for single-parameter
rules.void addUndo(Runnable undoCommand)
fact - Fact to which the handler shall be attached.undoCommand - Command which is executed when any of rule inputs is removed from the knowledge base.int[] parameterIndices()
Method targetMethod()
infer() method.
boolean contains(Object fact)
throws ReasoningException
fact - Fact.
ReasoningException
Collection<?> getObjects()
throws ReasoningException
ReasoningException
Map<String,?> getProperties()
throws ReasoningException
ReasoningException
void remove(Object fact)
throws ReasoningException
fact -
ReasoningException
void update(Object fact)
throws ReasoningException
update(fact, fact)
fact -
ReasoningException
void update(Object originalFact,
Object newFact)
throws ReasoningException
originalFact - Original fact.newFact - New fact to replace the original fact.
ReasoningException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||