Package org.drools.ruleunit.datasources
Class CursoredDataSource<T>
- java.lang.Object
-
- org.drools.ruleunit.datasources.CursoredDataSource<T>
-
- All Implemented Interfaces:
Iterable<T>
,DataSource<T>
,BindableDataProvider
,InternalDataSource<T>
public class CursoredDataSource<T> extends Object implements InternalDataSource<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.drools.ruleunit.DataSource
DataSource.DataSourceFactory
-
-
Constructor Summary
Constructors Constructor Description CursoredDataSource()
CursoredDataSource(org.drools.core.common.InternalWorkingMemory workingMemory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(RuleUnit unit, org.drools.core.WorkingMemoryEntryPoint ep)
void
delete(Object obj)
Deletes the given object from this DataSourcevoid
delete(org.kie.api.runtime.rule.FactHandle fh)
Deletes the fact for which the given FactHandle was assignedorg.kie.api.runtime.rule.FactHandle
getFactHandleForObject(Object object)
org.kie.api.runtime.rule.FactHandle
insert(T object)
Inserts a new fact into this DataSourceIterator<T>
iterator()
void
setWorkingMemory(org.drools.core.common.InternalWorkingMemory workingMemory)
void
unbind(RuleUnit unit)
void
update(org.kie.api.runtime.rule.FactHandle fh, Object obj, org.drools.core.util.bitmask.BitMask mask, Class<?> modifiedClass, org.drools.core.spi.Activation activation)
void
update(org.kie.api.runtime.rule.FactHandle handle, T object, String... modifiedProperties)
Updates the fact for which the given FactHandle was assigned with the new fact set as the second parameter in this method.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
setWorkingMemory
public void setWorkingMemory(org.drools.core.common.InternalWorkingMemory workingMemory)
- Specified by:
setWorkingMemory
in interfaceInternalDataSource<T>
-
getFactHandleForObject
public org.kie.api.runtime.rule.FactHandle getFactHandleForObject(Object object)
- Specified by:
getFactHandleForObject
in interfaceInternalDataSource<T>
-
insert
public org.kie.api.runtime.rule.FactHandle insert(T object)
Description copied from interface:DataSource
Inserts a new fact into this DataSource- Specified by:
insert
in interfaceDataSource<T>
- Parameters:
object
- the fact to be inserted- Returns:
- the fact handle created for the given fact
-
update
public void update(org.kie.api.runtime.rule.FactHandle handle, T object, String... modifiedProperties)
Description copied from interface:DataSource
Updates the fact for which the given FactHandle was assigned with the new fact set as the second parameter in this method. It is also possible to optionally specify the set of properties that have been modified.- Specified by:
update
in interfaceDataSource<T>
- Parameters:
handle
- the FactHandle for the fact to be updated.object
- the new value for the fact being updated.modifiedProperties
- the list of the names of the object's properties modified by this update.
-
update
public void update(org.kie.api.runtime.rule.FactHandle fh, Object obj, org.drools.core.util.bitmask.BitMask mask, Class<?> modifiedClass, org.drools.core.spi.Activation activation)
- Specified by:
update
in interfaceInternalDataSource<T>
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle fh)
Description copied from interface:DataSource
Deletes the fact for which the given FactHandle was assigned- Specified by:
delete
in interfaceDataSource<T>
- Parameters:
fh
- the handle whose fact is to be retracted.
-
delete
public void delete(Object obj)
Description copied from interface:DataSource
Deletes the given object from this DataSource- Specified by:
delete
in interfaceDataSource<T>
- Parameters:
obj
- the object to be deleted.
-
bind
public void bind(RuleUnit unit, org.drools.core.WorkingMemoryEntryPoint ep)
- Specified by:
bind
in interfaceBindableDataProvider
-
unbind
public void unbind(RuleUnit unit)
- Specified by:
unbind
in interfaceBindableDataProvider
-
-