org.knime.base.node.preproc.groupby.aggregation
Enum AggregationMethod

java.lang.Object
  extended by java.lang.Enum<AggregationMethod>
      extended by org.knime.base.node.preproc.groupby.aggregation.AggregationMethod
All Implemented Interfaces:
Serializable, Comparable<AggregationMethod>

public enum AggregationMethod
extends Enum<AggregationMethod>

Enumeration which lists all available aggregation methods including helper methods.

Author:
Tobias Koetter, University of Konstanz

Enum Constant Summary
CONCATENATE
          Concatenates all cell values.
COUNT
          Counts the number of group members.
FIRST
          Takes the first cell per group.
FIRST_VALUE
          Takes the first value per group.
LAST
          Takes the last cell per group.
LAST_VALUE
          Takes the last value per group.
LIST
          List collection.
MAX
          Maximum.
MEAN
          Average.
MIN
          Minimum.
MODE
          Takes the value which occurs most.
SET
          Set collection.
STD_DEVIATION
          Standard deviation.
SUM
          Sum.
UNIQUE_CONCATENATE
          Concatenates all distinct cell values.
UNIQUE_CONCATENATE_WITH_COUNT
          Concatenates all distinct cell values and counts the members.
UNIQUE_COUNT
          Counts the number of unique group members.
VARIANCE
          Variance.
 
Method Summary
 DataColumnSpec createColumnSpec(String colName, DataColumnSpec origSpec)
           
static AggregationMethod getAggregationMethod(DataColumnSpec colSpec, AggregationMethod numericColMethod, AggregationMethod nominalColMethod)
           
static List<AggregationMethod> getCompatibleMethods(DataColumnSpec colSpec)
           
static AggregationMethod getDefaultMethod(DataColumnSpec spec)
           
static AggregationMethod getDefaultNominalMethod()
           
static AggregationMethod getDefaultNumericMethod()
           
 String getLabel()
           
static AggregationMethod getMethod4Label(String label)
           
static AggregationMethod getMethod4SettingsModel(SettingsModelString model)
           
static List<String> getNoneNumericalMethodLabels()
           
static List<String> getNumericalMethodLabels()
           
 AggregationOperator getOperator(DataColumnSpec origColSpec, int maxUniqueValues)
           
 String getShortLabel()
           
 boolean isCompatible(DataColumnSpec colSpec)
           
 boolean isNumerical()
           
 boolean isUsesLimit()
           
static AggregationMethod valueOf(String name)
          Returns the enum constant of this type with the specified name.
static AggregationMethod[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MIN

public static final AggregationMethod MIN
Minimum.


MAX

public static final AggregationMethod MAX
Maximum.


MEAN

public static final AggregationMethod MEAN
Average.


SUM

public static final AggregationMethod SUM
Sum.


VARIANCE

public static final AggregationMethod VARIANCE
Variance.


STD_DEVIATION

public static final AggregationMethod STD_DEVIATION
Standard deviation.


FIRST

public static final AggregationMethod FIRST
Takes the first cell per group.


FIRST_VALUE

public static final AggregationMethod FIRST_VALUE
Takes the first value per group.


LAST

public static final AggregationMethod LAST
Takes the last cell per group.


LAST_VALUE

public static final AggregationMethod LAST_VALUE
Takes the last value per group.


MODE

public static final AggregationMethod MODE
Takes the value which occurs most.


CONCATENATE

public static final AggregationMethod CONCATENATE
Concatenates all cell values.


UNIQUE_CONCATENATE

public static final AggregationMethod UNIQUE_CONCATENATE
Concatenates all distinct cell values.


UNIQUE_CONCATENATE_WITH_COUNT

public static final AggregationMethod UNIQUE_CONCATENATE_WITH_COUNT
Concatenates all distinct cell values and counts the members.


UNIQUE_COUNT

public static final AggregationMethod UNIQUE_COUNT
Counts the number of unique group members.


COUNT

public static final AggregationMethod COUNT
Counts the number of group members.


LIST

public static final AggregationMethod LIST
List collection.


SET

public static final AggregationMethod SET
Set collection.

Method Detail

values

public static AggregationMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (AggregationMethod c : AggregationMethod.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static AggregationMethod valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getLabel

public String getLabel()
Returns:
the label

getShortLabel

public String getShortLabel()
Returns:
the short label which is used in the column name

isNumerical

public boolean isNumerical()
Returns:
true if only numerical columns are accepted

getOperator

public AggregationOperator getOperator(DataColumnSpec origColSpec,
                                       int maxUniqueValues)
Parameters:
origColSpec - the DataColumnSpec of the original column
maxUniqueValues - the maximum number of unique values
Returns:
the operator of this method

createColumnSpec

public DataColumnSpec createColumnSpec(String colName,
                                       DataColumnSpec origSpec)
Parameters:
colName - the name of the new column
origSpec - the original DataColumnSpec should be kept
Returns:
the new DataColumnSpecCreator for the aggregated column

isUsesLimit

public boolean isUsesLimit()
Returns:
true if this method checks the maximum unique values limit.

isCompatible

public boolean isCompatible(DataColumnSpec colSpec)
Parameters:
colSpec - the DataColumnSpec to test for compatibility to this AggregationMethod
Returns:
true if this method could be used to aggregation the column with the given specification

getAggregationMethod

public static AggregationMethod getAggregationMethod(DataColumnSpec colSpec,
                                                     AggregationMethod numericColMethod,
                                                     AggregationMethod nominalColMethod)
Parameters:
colSpec - the DataColumnSpec to check
numericColMethod - the AggregationMethod for numerical columns
nominalColMethod - the AggregationMethod for none numerical columns
Returns:
the AggregationMethod to use

getCompatibleMethods

public static List<AggregationMethod> getCompatibleMethods(DataColumnSpec colSpec)
Parameters:
colSpec - the DataColumnSpec to check
Returns:
all aggregation methods that are compatible with the given DataColumnSpec

getDefaultMethod

public static AggregationMethod getDefaultMethod(DataColumnSpec spec)
Parameters:
spec - the DataColumnSpec to get the default method for
Returns:
the default AggregationMethod for the given column spec

getDefaultNumericMethod

public static AggregationMethod getDefaultNumericMethod()
Returns:
the default method for numerical columns

getDefaultNominalMethod

public static AggregationMethod getDefaultNominalMethod()
Returns:
the default method for none numerical columns

getMethod4SettingsModel

public static AggregationMethod getMethod4SettingsModel(SettingsModelString model)
Parameters:
model - the SettingsModelString with the label of the AggregationMethod
Returns:
the AggregationMethod for the given label

getMethod4Label

public static AggregationMethod getMethod4Label(String label)
                                         throws IllegalArgumentException
Parameters:
label - the label to get the AggregationMethod for.
Returns:
the AggregationMethod with the given label
Throws:
IllegalArgumentException - if no AggregationMethod exists for the given label

getNumericalMethodLabels

public static List<String> getNumericalMethodLabels()
Returns:
a List with the labels of all numerical methods

getNoneNumericalMethodLabels

public static List<String> getNoneNumericalMethodLabels()
Returns:
a List with the labels of all none numerical methods


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.