org.knime.base.node.preproc.pivot
Class PivotAggregationMethod

java.lang.Object
  extended by org.knime.base.node.preproc.pivot.PivotAggregationMethod

abstract class PivotAggregationMethod
extends Object

Factory holding a set of aggregation functions, such as COUNT, SUM, MEAN, MAX, MIN, VARIANCE, and STD DEVIATION methods. The computation of these values is done by an array reference (init() which in modify by next value (compute(Double[], DataCell) of one group, and is finally committed (done(Double[]). Each element within the array reference can be used as a place holder for one value, e.g. sum and number of elements.

Author:
Thomas Gabriel, University of Konstanz

Field Summary
(package private) static PivotAggregationMethod COUNT
          Method only counts the number of non-empty and non-missing occurrences.
(package private) static PivotAggregationMethod MAX
          Method returns the maximum value over all values.
(package private) static PivotAggregationMethod MEAN
          Method computes the mean over all values.
(package private) static Map<String,PivotAggregationMethod> METHODS
          Set of methods used to compute the aggregation value for one column.
(package private) static PivotAggregationMethod MIN
          Method returns the minimum over all values.
(package private) static PivotAggregationMethod STDDEV
          Method computes the variance over all values.
(package private) static PivotAggregationMethod SUM
          Method computes the sum over all values.
(package private) static PivotAggregationMethod VARIANCE
          Method computes the variance over all values.
 
Constructor Summary
PivotAggregationMethod()
           
 
Method Summary
(package private) abstract  void compute(Double[] agg, DataCell value)
          Uses the array returned by init() to compute the next value.
(package private) abstract  DataCell done(Double[] agg)
          Finally commits the aggregation value and computes the final output.
(package private) abstract  Double[] init()
          Inits the array used for aggregation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COUNT

static final PivotAggregationMethod COUNT
Method only counts the number of non-empty and non-missing occurrences.


SUM

static final PivotAggregationMethod SUM
Method computes the sum over all values.


MEAN

static final PivotAggregationMethod MEAN
Method computes the mean over all values.


MAX

static final PivotAggregationMethod MAX
Method returns the maximum value over all values.


MIN

static final PivotAggregationMethod MIN
Method returns the minimum over all values.


VARIANCE

static final PivotAggregationMethod VARIANCE
Method computes the variance over all values.


STDDEV

static final PivotAggregationMethod STDDEV
Method computes the variance over all values.


METHODS

static final Map<String,PivotAggregationMethod> METHODS
Set of methods used to compute the aggregation value for one column.

Constructor Detail

PivotAggregationMethod

PivotAggregationMethod()
Method Detail

init

abstract Double[] init()
Inits the array used for aggregation.

Returns:
a new array with length needed for aggregation value computation

compute

abstract void compute(Double[] agg,
                      DataCell value)
Uses the array returned by init() to compute the next value.

Parameters:
agg - the array to be modified by this call
value - the value to apply

done

abstract DataCell done(Double[] agg)
Finally commits the aggregation value and computes the final output.

Parameters:
agg - the array used for value computation
Returns:
the final aggregation value


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.