org.zkoss.pivot.impl.calc
Class SumCountContext

java.lang.Object
  extended by org.zkoss.pivot.impl.calc.SumCountContext
All Implemented Interfaces:
Context<SumCountContext>

public class SumCountContext
extends java.lang.Object
implements Context<SumCountContext>

The most commonly used context including SUM, COUNT and COUNT_NUMBER aggregation.

Author:
simonpai

Field Summary
protected  int _count
           
protected  int _numCount
           
protected  Numbers.MixedTypedNumber _sum
           
static ContextFactory<SumCountContext> FACTORY
           
 
Constructor Summary
SumCountContext()
           
 
Method Summary
 void add(java.lang.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.
 java.lang.Number getSum()
          Retrieve SUM.
 void merge(SumCountContext ctx)
          Merge from another context of the same type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sum

protected Numbers.MixedTypedNumber _sum

_numCount

protected int _numCount

_count

protected int _count

FACTORY

public static final ContextFactory<SumCountContext> FACTORY
Constructor Detail

SumCountContext

public SumCountContext()
Method Detail

add

public void add(java.lang.Object item)
Description copied from interface: Context
Add an item into the aggregation.

Specified by:
add in interface Context<SumCountContext>

merge

public void merge(SumCountContext ctx)
Description copied from interface: Context
Merge from another context of the same type.

Specified by:
merge in interface Context<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 java.lang.Number getSum()
Retrieve SUM.



Copyright © 2012. All Rights Reserved.