org.zkoss.pivot.impl
Class AbstractCalculator

java.lang.Object
  extended by org.zkoss.pivot.impl.AbstractCalculator
All Implemented Interfaces:
Calculator
Direct Known Subclasses:
NumericBinaryCalculator

public abstract class AbstractCalculator
extends java.lang.Object
implements Calculator

The minimal implemenation of Calculator

Author:
simonpai

Constructor Summary
AbstractCalculator(java.lang.String type)
           
 
Method Summary
abstract  java.lang.Number calculate(java.util.Collection<java.lang.Object> data)
          Returns a calculated number for each data cell.
 java.lang.String getType()
          This is the key to identify whether two Calculator carry the same behavior so they can be cascaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCalculator

public AbstractCalculator(java.lang.String type)
Method Detail

calculate

public abstract java.lang.Number calculate(java.util.Collection<java.lang.Object> data)
Description copied from interface: Calculator
Returns a calculated number for each data cell.

Specified by:
calculate in interface Calculator

getType

public java.lang.String getType()
Description copied from interface: Calculator
This is the key to identify whether two Calculator carry the same behavior so they can be cascaded. For example, suppose there is a Sum Calculator on a column field and a Count Calculator on a row field. The intersecting cell of their subtotal ranks should be empty, as Sum of Count or Count of Sum does not really make sense (they are of different type).

Specified by:
getType in interface Calculator


Copyright © 2012. All Rights Reserved.