org.drools.base.accumulators
Class SumAccumulateFunction

java.lang.Object
  extended by org.drools.base.accumulators.SumAccumulateFunction
All Implemented Interfaces:
Externalizable, Serializable, org.drools.runtime.rule.AccumulateFunction, org.drools.runtime.rule.TypedAccumulateFunction

public class SumAccumulateFunction
extends Object
implements AccumulateFunction

An implementation of an accumulator capable of calculating sum of values

See Also:
Serialized Form

Nested Class Summary
protected static class SumAccumulateFunction.SumData
           
 
Constructor Summary
SumAccumulateFunction()
           
 
Method Summary
 void accumulate(Serializable context, Object value)
           
 Serializable createContext()
           
 Object getResult(Serializable context)
           
 Class<?> getResultType()
          
 void init(Serializable context)
           
 void readExternal(ObjectInput in)
           
 void reverse(Serializable context, Object value)
           
 boolean supportsReverse()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SumAccumulateFunction

public SumAccumulateFunction()
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

createContext

public Serializable createContext()
Specified by:
createContext in interface org.drools.runtime.rule.AccumulateFunction

init

public void init(Serializable context)
          throws Exception
Specified by:
init in interface org.drools.runtime.rule.AccumulateFunction
Throws:
Exception

accumulate

public void accumulate(Serializable context,
                       Object value)
Specified by:
accumulate in interface org.drools.runtime.rule.AccumulateFunction

reverse

public void reverse(Serializable context,
                    Object value)
             throws Exception
Specified by:
reverse in interface org.drools.runtime.rule.AccumulateFunction
Throws:
Exception

getResult

public Object getResult(Serializable context)
                 throws Exception
Specified by:
getResult in interface org.drools.runtime.rule.AccumulateFunction
Throws:
Exception

supportsReverse

public boolean supportsReverse()
Specified by:
supportsReverse in interface org.drools.runtime.rule.AccumulateFunction

getResultType

public Class<?> getResultType()

Specified by:
getResultType in interface org.drools.runtime.rule.TypedAccumulateFunction


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.