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 Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `accumulate(C context, Object value)` Executes the accumulation action
    `C` | `createContext()` Creates and returns a new context object
    `Object` | `getResult(C context)`
    `Class<?>` | `getResultType()`
    `void` | `init(C context)` Initializes the accumulator
    `void` | `reverse(C context, Object value)` Reverses the accumulation action
    `boolean` | `supportsReverse()`

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

      `readExternal, writeExternal`

- - ### Method Detail

    - #### createContext

          C createContext()

      Creates and returns a new context object
      Returns:
        new context object

    - #### init

          void init(C context)
             throws Exception

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

    - #### accumulate

          void accumulate(C context,
                          Object value)

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

    - #### reverse

          void reverse(C context,
                       Object value)
                throws Exception

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

    - #### getResult

          Object getResult(C context)
                    throws Exception

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

    - #### supportsReverse

          boolean supportsReverse()

      Returns:
        true if the function supports reverse, otherwise false

    - #### getResultType

          Class<?> getResultType()

      Returns:
        the class type of the result of this function

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