|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.base.data.aggregation.AggregationOperator
public abstract class AggregationOperator
Abstract class which has to be extended by all aggregation method operators
that can be registered using the AggregationOperator extension point.
The extending classes have to provide an empty constructor that can
call the AggregationOperator(OperatorData)
constructor with the operator specific OperatorData implementation.
The OperatorData class holds all operator specific information
such as the name of the operator and if the operator supports missing values.
The GlobalSettings class holds global informations such as the
column delimiter to use or the maximum number of unique values per group.
Implementations can use the GlobalSettings.DEFAULT object in the
constructor which is a dummy object which gets replaced when the operator
is created using the
createInstance(GlobalSettings, OperatorColumnSettings) method.
The OperatorColumnSettings contain column specific information for
the operator such as the DataColumnSpec of the column and if
missing values should be considered when aggregating the column.
The class also provides two default instances
OperatorColumnSettings.DEFAULT_INCL_MISSING and
OperatorColumnSettings.DEFAULT_EXCL_MISSING which can be used in
the constructor. These get like the GlobalSettings replaced by the
actual settings from the node dialog in the
createInstance(GlobalSettings, OperatorColumnSettings) method.
All registered classes can be used in the nodes that use the
aggregation operators such as the group by or pivoting node.
AggregationMethods are sorted first by the supported data type and then
by the label.
OperatorData,
GlobalSettings,
OperatorColumnSettings| Constructor Summary | |
|---|---|
AggregationOperator(OperatorData operatorData)
Constructor for class AggregationOperator. |
|
AggregationOperator(OperatorData operatorData,
GlobalSettings globalSettings,
OperatorColumnSettings opColSettings)
Constructor for class AggregationOperator. |
|
| Method Summary | |
|---|---|
int |
compareTo(AggregationMethod o)
|
void |
compute(DataCell cell)
|
protected abstract boolean |
computeInternal(DataCell cell)
|
DataColumnSpec |
createColumnSpec(String colName,
DataColumnSpec origSpec)
|
abstract AggregationOperator |
createInstance(GlobalSettings globalSettings,
OperatorColumnSettings opColSettings)
Creates a new instance of this operator. |
AggregationOperator |
createOperator(GlobalSettings globalSettings,
OperatorColumnSettings opColSettings)
Creates a new instance of this operator and returns it. |
String |
getColumnLabel()
|
protected abstract DataType |
getDataType(DataType origType)
|
GlobalSettings |
getGlobalSettings()
|
String |
getId()
The unique identifier of the method that is used for registration and identification of the aggregation method. |
String |
getLabel()
|
int |
getMaxUniqueValues()
|
OperatorData |
getOperatorData()
|
DataCell |
getResult()
|
protected abstract DataCell |
getResultInternal()
|
String |
getSkipMessage()
|
Class<? extends DataValue> |
getSupportedType()
|
String |
getSupportedTypeLabel()
|
String |
getValueDelimiter()
|
boolean |
inclMissingCells()
|
boolean |
isCompatible(DataColumnSpec origColSpec)
|
boolean |
isCompatible(DataType type)
|
boolean |
isSkipped()
|
boolean |
isUsesLimit()
|
boolean |
keepColumnSpec()
|
void |
reset()
Should reset the operator to the start values. |
protected abstract void |
resetInternal()
Should reset the operator to the start values. |
(package private) void |
setInclMissing(boolean inclMissingCells)
|
protected void |
setSkipMessage(String msg)
|
protected void |
setSkipped(boolean skipped)
This method can be used to mark this group explicitly as skipped. |
boolean |
supportsMissingValueOption()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.knime.base.data.aggregation.AggregationMethod |
|---|
getDescription |
| Constructor Detail |
|---|
public AggregationOperator(OperatorData operatorData)
GlobalSettings.DEFAULT and
OperatorColumnSettings.DEFAULT_INCL_MISSING and calls the
AggregationOperator(OperatorData,
GlobalSettings, OperatorColumnSettings) constructor.
operatorData - the operator specific data
public AggregationOperator(OperatorData operatorData,
GlobalSettings globalSettings,
OperatorColumnSettings opColSettings)
operatorData - the operator specific dataglobalSettings - the global settingsopColSettings - the operator column specific settings| Method Detail |
|---|
public abstract AggregationOperator createInstance(GlobalSettings globalSettings,
OperatorColumnSettings opColSettings)
globalSettings - the global settingsopColSettings - the operator column specific settings
public OperatorData getOperatorData()
OperatorData of this operatorpublic Class<? extends DataValue> getSupportedType()
getSupportedType in interface AggregationMethodDataValue classpublic String getSupportedTypeLabel()
getSupportedTypeLabel in interface AggregationMethodDataValue classpublic int getMaxUniqueValues()
public String getValueDelimiter()
public GlobalSettings getGlobalSettings()
GlobalSettings objectpublic boolean supportsMissingValueOption()
supportsMissingValueOption in interface AggregationMethodtrue if the operator supports the alteration of
the missing cell optionvoid setInclMissing(boolean inclMissingCells)
inclMissingCells - true if missing cells should be
considered during aggregationpublic boolean inclMissingCells()
inclMissingCells in interface AggregationMethodtrue if missing cells are considered during
aggregationpublic boolean isSkipped()
true if this operator was skippedgetSkipMessage()protected void setSkipped(boolean skipped)
skipped - true if the group should be marked as
skippedsetSkipMessage(String)protected void setSkipMessage(String msg)
msg - the cause why the group was skippedsetSkipped(boolean)public String getSkipMessage()
isSkipped()public final void compute(DataCell cell)
cell - the DataCell to consider during computingpublic boolean keepColumnSpec()
true if the original DataColumnSpec should
be kept.protected abstract boolean computeInternal(DataCell cell)
cell - the DataCell to consider during computing the cell
can't be null but can be a missing cell
DataCell.isMissing() if the option is
inclMissingCells() option is set to true.
true if this column should be skipped in further
calculations
public DataColumnSpec createColumnSpec(String colName,
DataColumnSpec origSpec)
createColumnSpec in interface AggregationMethodcolName - the unique name of the columnorigSpec - the original DataColumnSpec
DataColumnSpecCreator for the aggregated columnprotected abstract DataType getDataType(DataType origType)
origType - the DataType of the original column to aggregate
DataType of the aggregation resultpublic final DataCell getResult()
DataCellprotected abstract DataCell getResultInternal()
DataCellpublic final void reset()
protected abstract void resetInternal()
public String getId()
getId in interface AggregationMethodpublic String getLabel()
getLabel in interface AggregationMethodpublic String getColumnLabel()
getColumnLabel in interface AggregationMethod
public AggregationOperator createOperator(GlobalSettings globalSettings,
OperatorColumnSettings opColSettings)
createOperator in interface AggregationMethodglobalSettings - the global settingsopColSettings - the operator column specific settings
public boolean isCompatible(DataColumnSpec origColSpec)
isCompatible in interface AggregationMethodorigColSpec - the DataColumnSpec of the column to
check for compatibility
true if the aggregation method is compatiblepublic boolean isCompatible(DataType type)
type - the DataType to check for compatibility
DataTypepublic boolean isUsesLimit()
true if this method checks the maximum unique
values limit.public int compareTo(AggregationMethod o)
compareTo in interface Comparable<AggregationMethod>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||