org.kie.api.runtime.rule

## Interface AccumulateFunction

- All Superinterfaces:
    Externalizable, Serializable

      public interface AccumulateFunction
      extends Externalizable

  An interface for accumulate external function implementations

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `accumulate(Serializable context, Object value)` Executes the accumulation action
    `Serializable` | `createContext()` Creates and returns a new context object
    `Object` | `getResult(Serializable context)` Returns the current value in this accumulation session
    `Class<?>` | `getResultType()` Returns the class type of the result of this function
    `void` | `init(Serializable context)` Initializes the accumulator
    `void` | `reverse(Serializable context, Object value)` Reverses the accumulation action
    `boolean` | `supportsReverse()` True if the function supports reverse.

    - ### Methods inherited from interface java.io.Externalizable

      `readExternal, writeExternal`

- - ### Method Detail

    - #### createContext

          Serializable createContext()

      Creates and returns a new context object
      Returns:

    - #### init

          void init(Serializable context)
                    throws Exception

      Initializes the accumulator
      Parameters:
        `context` -
      Throws:
        `Exception`

    - #### accumulate

          void accumulate(Serializable context,
                        Object value)

      Executes the accumulation action
      Parameters:
        `context` -
        `value` -

    - #### reverse

          void reverse(Serializable context,
                     Object value)
                       throws Exception

      Reverses the accumulation action
      Parameters:
        `context` -
        `value` -
      Throws:
        `Exception`

    - #### getResult

          Object getResult(Serializable context)
                           throws Exception

      Returns the current value in this accumulation session
      Parameters:
        `context` -
      Returns:
      Throws:
        `Exception`

    - #### supportsReverse

          boolean supportsReverse()

      True if the function supports reverse. False otherwise.
      Returns:

    - #### getResultType

          Class<?> getResultType()

      Returns the class type of the result of this function
      Returns:

Copyright © 2001–2015 JBoss by Red Hat. All rights reserved.