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 voidbind(RuleUnit unit, org.drools.core.WorkingMemoryEntryPoint ep)voiddelete(Object obj)Deletes the given object from this DataSourcevoiddelete(org.kie.api.runtime.rule.FactHandle fh)Deletes the fact for which the given FactHandle was assignedorg.kie.api.runtime.rule.FactHandlegetFactHandleForObject(Object object)org.kie.api.runtime.rule.FactHandleinsert(T object)Inserts a new fact into this DataSourceIterator<T>iterator()voidsetWorkingMemory(org.drools.core.common.InternalWorkingMemory workingMemory)voidunbind(RuleUnit unit)voidupdate(org.kie.api.runtime.rule.FactHandle fh, Object obj, org.drools.core.util.bitmask.BitMask mask, Class<?> modifiedClass, org.drools.core.spi.Activation activation)voidupdate(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:
setWorkingMemoryin interfaceInternalDataSource<T>
-
getFactHandleForObject
public org.kie.api.runtime.rule.FactHandle getFactHandleForObject(Object object)
- Specified by:
getFactHandleForObjectin interfaceInternalDataSource<T>
-
insert
public org.kie.api.runtime.rule.FactHandle insert(T object)
Description copied from interface:DataSourceInserts a new fact into this DataSource- Specified by:
insertin 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:DataSourceUpdates 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:
updatein 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:
updatein interfaceInternalDataSource<T>
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle fh)
Description copied from interface:DataSourceDeletes the fact for which the given FactHandle was assigned- Specified by:
deletein interfaceDataSource<T>- Parameters:
fh- the handle whose fact is to be retracted.
-
delete
public void delete(Object obj)
Description copied from interface:DataSourceDeletes the given object from this DataSource- Specified by:
deletein interfaceDataSource<T>- Parameters:
obj- the object to be deleted.
-
bind
public void bind(RuleUnit unit, org.drools.core.WorkingMemoryEntryPoint ep)
- Specified by:
bindin interfaceBindableDataProvider
-
unbind
public void unbind(RuleUnit unit)
- Specified by:
unbindin interfaceBindableDataProvider
-
-