org.knime.base.data.aggregation
Class ColumnAggregator

java.lang.Object
  extended by org.knime.base.data.aggregation.ColumnAggregator

public class ColumnAggregator
extends Object

Class that defines the AggregationMethod for a column.

Author:
Tobias Koetter, University of Konstanz

Constructor Summary
ColumnAggregator(DataColumnSpec origColSpec, AggregationMethod method, boolean inclMissingCells)
          Constructor for class ColumnAggregator.
 
Method Summary
 ColumnAggregator clone()
          
 AggregationMethod getMethodTemplate()
           
 AggregationOperator getOperator(GlobalSettings globalSettings)
          Creates only ones an AggregationOperator that is always returned by this method.
 String getOperatorColName()
           
 String getOriginalColName()
           
 DataColumnSpec getOriginalColSpec()
           
 DataType getOriginalDataType()
           
 boolean inclMissingCells()
           
 boolean isCompatible(Class<? extends DataValue> type)
           
static List<ColumnAggregator> loadColumnAggregators(NodeSettingsRO settings)
          Creates a List with all ColumnAggregators that were stored in the settings.
 void reset()
          Removes any cached operators.
static void saveColumnAggregators(NodeSettingsWO settings, List<ColumnAggregator> cols)
           
 void setinclMissingCells(boolean inclMissingCells)
           
 boolean supportsMissingValueOption()
           
 String toString()
          
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColumnAggregator

public ColumnAggregator(DataColumnSpec origColSpec,
                        AggregationMethod method,
                        boolean inclMissingCells)
Constructor for class ColumnAggregator.

Parameters:
origColSpec - the DataColumnSpec of the original column
method - the AggregationMethod to use for the given column
inclMissingCells - true if missing cells should be considered during aggregation
Method Detail

clone

public ColumnAggregator clone()

Overrides:
clone in class Object

getOriginalColName

public String getOriginalColName()
Returns:
the colName of the original column

getOriginalColSpec

public DataColumnSpec getOriginalColSpec()
Returns:
the DataColumnSpec of the original column

getOriginalDataType

public DataType getOriginalDataType()
Returns:
the DataType of the original column

isCompatible

public boolean isCompatible(Class<? extends DataValue> type)
Parameters:
type - the type to check for
Returns:
true if the column is compatible to the given type

getMethodTemplate

public AggregationMethod getMethodTemplate()
Returns:
the AggregationMethods to use

supportsMissingValueOption

public boolean supportsMissingValueOption()
Returns:
true if the operator supports the alteration of the missing value option

inclMissingCells

public boolean inclMissingCells()
Returns:
true if missing cells should be considered during aggregation

setinclMissingCells

public void setinclMissingCells(boolean inclMissingCells)
Parameters:
inclMissingCells - true if missing cells should be considered during aggregation

getOperator

public AggregationOperator getOperator(GlobalSettings globalSettings)
Creates only ones an AggregationOperator that is always returned by this method. In order to remove the created AggregationOperator call the reset() method.

Parameters:
globalSettings - the maximum number of unique values
Returns:
the operator for this column

reset

public void reset()
Removes any cached operators.


getOperatorColName

public String getOperatorColName()
Returns:
the column name that should be used for the operator

toString

public String toString()

Overrides:
toString in class Object

loadColumnAggregators

public static List<ColumnAggregator> loadColumnAggregators(NodeSettingsRO settings)
                                                    throws InvalidSettingsException
Creates a List with all ColumnAggregators that were stored in the settings.

Parameters:
settings - the settings object to read from
Returns:
List with the ColumnAggregators
Throws:
InvalidSettingsException - if the settings are invalid

saveColumnAggregators

public static void saveColumnAggregators(NodeSettingsWO settings,
                                         List<ColumnAggregator> cols)
Parameters:
settings - the settings object to write to
cols - the ColumnAggregator objects to save


Copyright, 2003 - 2012. 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.