org.drools.base.accumulators
Interface AccumulateFunction

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AverageAccumulateFunction, CountAccumulateFunction, MaxAccumulateFunction, MinAccumulateFunction, SumAccumulateFunction

public interface AccumulateFunction
extends java.io.Serializable

An interface for accumulate external function implementations

Author:
etirelli

Method Summary
 void accumulate(java.lang.Object context, java.lang.Object value)
          Executes the accumulation action
 java.lang.Object createContext()
          Creates and returns a new context object
 java.lang.Object getResult(java.lang.Object context)
          Returns the current value in this accumulation session
 void init(java.lang.Object context)
          Initializes the accumulator
 void reverse(java.lang.Object context, java.lang.Object value)
          Reverses the accumulation action
 boolean supportsReverse()
          True if the function supports reverse.
 

Method Detail

createContext

java.lang.Object createContext()
Creates and returns a new context object

Returns:

init

void init(java.lang.Object context)
          throws java.lang.Exception
Initializes the accumulator

Parameters:
context -
Throws:
java.lang.Exception

accumulate

void accumulate(java.lang.Object context,
                java.lang.Object value)
Executes the accumulation action

Parameters:
context -
value -

reverse

void reverse(java.lang.Object context,
             java.lang.Object value)
             throws java.lang.Exception
Reverses the accumulation action

Parameters:
context -
value -
Throws:
java.lang.Exception

getResult

java.lang.Object getResult(java.lang.Object context)
                           throws java.lang.Exception
Returns the current value in this accumulation session

Parameters:
context -
Returns:
Throws:
java.lang.Exception

supportsReverse

boolean supportsReverse()
True if the function supports reverse. False otherwise.

Returns: