Package org.evrete.api
Interface WorkingMemory
- All Known Subinterfaces:
RuleSession<S>,StatefulSession
public interface WorkingMemory
An interface that every rule session implements and that describes operations on facts that are available to developers.
-
Method Summary
Modifier and Type Method Description voiddelete(FactHandle handle)Deletes a fact from working memory.ObjectgetFact(FactHandle handle)Returns fact by its handle.FactHandleinsert(Object fact)Inserts a fact in working memory and returns a serializable fact handle.default voidinsert(Object... objects)Inserts an array of facts.FactHandleinsert(String type, Object fact)Inserts a fact and explicitly specifies itsTypename.default voidinsert(String type, Collection<?> objects)Inserts a collection of facts, marking them as being of a specific type.default voidinsert(Collection<?> objects)Inserts a collection of facts.voidupdate(FactHandle handle, Object newValue)Updates a fact that already exists in the working memory
-
Method Details
-
insert
Inserts a fact in working memory and returns a serializable fact handle.
- Parameters:
fact- object to insert- Returns:
- fact handle assigned to the fact
- Throws:
NullPointerException- if argument is null- See Also:
FactHandle
-
getFact
Returns fact by its handle.
- Parameters:
handle- fact handle- Returns:
- fact or
nullif fact is not found
-
insert
Inserts a fact and explicitly specifies its
Typename.- Parameters:
type- type namefact- fact to insert- Returns:
- fact handle assigned to the fact
- Throws:
NullPointerException- if argument is null
-
update
Updates a fact that already exists in the working memory
- Parameters:
handle- fact handle, previously assigned to original factnewValue- an updated version of the fact
-
delete
Deletes a fact from working memory.
- Parameters:
handle- fact handle
-
insert
Inserts a collection of facts, marking them as being of a specific type.
- Parameters:
type- type nameobjects- objects to insert- See Also:
insert(String, Object)
-
insert
Inserts a collection of facts.
- Parameters:
objects- objects to insert- See Also:
insert(Object)
-
insert
Inserts an array of facts.
- Parameters:
objects- objects to insert- See Also:
insert(Object)
-