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
_count
protected int
_numCount
protected Numbers.MixedTypedNumber
_sum
static ContextFactory<SumCountContext>
FACTORY
-
Constructor Summary
Constructors Constructor Description SumCountContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Object item)
Add an item into the aggregation.int
getCount()
Retrieve COUNT, which includes the count of non-number objects.int
getNumberCount()
Retrieve NUMBER COUNT, which excludes the count of non-number objects.Number
getSum()
Retrieve SUM.void
merge(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:Context
Add an item into the aggregation.- Specified by:
add
in interfaceContext<SumCountContext>
-
merge
public void merge(SumCountContext ctx)
Description copied from interface:Context
Merge from another context of the same type.- Specified by:
merge
in 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.
-
-