Package org.kie.api.runtime.rule
Interface AccumulateFunction<C extends Serializable>
- 
- All Superinterfaces:
- Externalizable,- Serializable
 
 public interface AccumulateFunction<C extends Serializable> extends Externalizable An interface for accumulate external function implementations
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaccumulate(C context, Object value)Executes the accumulation actiondefault ObjectaccumulateValue(C context, Object value)Executes the accumulation action returning the accumulated object that will be passed back to the reverse method when this value will be eventually removed from acccumulation.CcreateContext()Creates and returns a new context objectObjectgetResult(C context)Class<?>getResultType()voidinit(C context)Initializes the accumulatordefault CinitContext(C context)Initializes the accumulator, possibly returning a new accumulation context instead of the original onevoidreverse(C context, Object value)Reverses the accumulation actionbooleansupportsReverse()default booleantryReverse(C context, Object value)Reverses the accumulation action- 
Methods inherited from interface java.io.ExternalizablereadExternal, writeExternal
 
- 
 
- 
- 
- 
Method Detail- 
createContextC createContext() Creates and returns a new context object- Returns:
- new context object
 
 - 
initvoid init(C context) throws Exception Initializes the accumulator- Parameters:
- context- never null
- Throws:
- Exception
 
 - 
initContextdefault C initContext(C context) Initializes the accumulator, possibly returning a new accumulation context instead of the original one- Parameters:
- context-
- Returns:
- new context object
 
 - 
accumulatevoid accumulate(C context, Object value) Executes the accumulation action- Parameters:
- context- never null
- value-
 
 - 
accumulateValuedefault Object accumulateValue(C context, Object value) Executes the accumulation action returning the accumulated object that will be passed back to the reverse method when this value will be eventually removed from acccumulation.- Parameters:
- context-
- value-
- Returns:
- the accumulated object
 
 - 
reversevoid reverse(C context, Object value) throws Exception Reverses the accumulation action- Parameters:
- context- never null
- value-
- Throws:
- Exception
 
 - 
getResultObject getResult(C context) throws Exception - Returns:
- the current value in this accumulation session
- Throws:
- Exception
 
 - 
supportsReverseboolean supportsReverse() - Returns:
- true if the function supports reverse, otherwise false
 
 - 
getResultTypeClass<?> getResultType() - Returns:
- the class type of the result of this function
 
 
- 
 
-