Package org.zkoss.pivot.impl.calc
Class SumCountContext
- java.lang.Object
-
- org.zkoss.pivot.impl.calc.SumCountContext
-
- All Implemented Interfaces:
Context<SumCountContext>
public class SumCountContext extends Object implements Context<SumCountContext>
The most commonly used context including SUM, COUNT and COUNT_NUMBER aggregation.- Author:
- simonpai
-
-
Field Summary
Fields Modifier and Type Field Description protected int_countprotected int_numCountprotected Numbers.MixedTypedNumber_sumstatic ContextFactory<SumCountContext>FACTORY
-
Constructor Summary
Constructors Constructor Description SumCountContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Object item)Add an item into the aggregation.intgetCount()Retrieve COUNT, which includes the count of non-number objects.intgetNumberCount()Retrieve NUMBER COUNT, which excludes the count of non-number objects.NumbergetSum()Retrieve SUM.voidmerge(SumCountContext ctx)Merge from another context of the same type.
-
-
-
Field Detail
-
_sum
protected Numbers.MixedTypedNumber _sum
-
_numCount
protected int _numCount
-
_count
protected int _count
-
FACTORY
public static final ContextFactory<SumCountContext> FACTORY
-
-
Method Detail
-
add
public void add(Object item)
Description copied from interface:ContextAdd an item into the aggregation.- Specified by:
addin interfaceContext<SumCountContext>
-
merge
public void merge(SumCountContext ctx)
Description copied from interface:ContextMerge from another context of the same type.- Specified by:
mergein interfaceContext<SumCountContext>
-
getCount
public int getCount()
Retrieve COUNT, which includes the count of non-number objects.
-
getNumberCount
public int getNumberCount()
Retrieve NUMBER COUNT, which excludes the count of non-number objects.
-
getSum
public Number getSum()
Retrieve SUM.
-
-