org.knime.base.node.preproc.groupby.dialogutil
Class AggregationColumnTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by org.knime.base.node.preproc.groupby.dialogutil.AggregationColumnTableModel
All Implemented Interfaces:
Serializable, TableModel

public class AggregationColumnTableModel
extends DefaultTableModel

This DefaultTableModel holds all aggregation columns and their aggregation method.

Author:
Tobias Koetter, University of Konstanz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
AggregationColumnTableModel()
           
 
Method Summary
protected  void addColumn(DataColumnSpec... specs)
           
protected  List<ColumnAggregator> getColumnAggregators()
           
 Class<?> getColumnClass(int columnIndex)
          
 int getColumnCount()
          
 String getColumnName(int columnIdx)
          
protected  Collection<Integer> getNoneNumericalRowIdxs()
           
protected  Collection<Integer> getNumericalRowIdxs()
           
 int getRowCount()
          
 Object getValueAt(int row, int columnIndex)
          
protected  void initialize(List<ColumnAggregator> colAggrs)
          Initializes the column aggregator table with the given ColumnAggregators.
 boolean isCellEditable(int row, int columnIdx)
          
protected  boolean isNumerical(int row)
           
protected  boolean onlyNumerical(int[] rows2check)
           
protected  void removeAll()
          Removes all aggregation column.
protected  void removeColumn(int... idxs)
           
protected  void removeColumns(Collection<String> colNames)
           
protected  void setAggregationMethod(int[] selectedRows, AggregationMethod method)
           
 void setValueAt(Object aValue, int row, int columnIdx)
          
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregationColumnTableModel

public AggregationColumnTableModel()
Method Detail

initialize

protected void initialize(List<ColumnAggregator> colAggrs)
Initializes the column aggregator table with the given ColumnAggregators.

Parameters:
colAggrs - the List of ColumnAggregators

addColumn

protected void addColumn(DataColumnSpec... specs)
Parameters:
specs - the DataColumnSpecs of the columns to add

removeColumn

protected void removeColumn(int... idxs)
Parameters:
idxs - the indices of the columns to remove

removeColumns

protected void removeColumns(Collection<String> colNames)
Parameters:
colNames - the names of the columns to remove

removeAll

protected void removeAll()
Removes all aggregation column.


setAggregationMethod

protected void setAggregationMethod(int[] selectedRows,
                                    AggregationMethod method)
Parameters:
selectedRows - the index of the rows to change the aggregation method
method - the aggregation method to use

getColumnName

public String getColumnName(int columnIdx)

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class DefaultTableModel

onlyNumerical

protected boolean onlyNumerical(int[] rows2check)
Parameters:
rows2check - the index of the rows to check
Returns:
true if all rows with the given index are numerical

getNumericalRowIdxs

protected Collection<Integer> getNumericalRowIdxs()
Returns:
the row indices of all numerical rows

getNoneNumericalRowIdxs

protected Collection<Integer> getNoneNumericalRowIdxs()
Returns:
the row indices of all none numerical rows

isNumerical

protected boolean isNumerical(int row)
Parameters:
row - the index of the row to check
Returns:
true if the row contains a numerical column

setValueAt

public void setValueAt(Object aValue,
                       int row,
                       int columnIdx)

Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class DefaultTableModel

getColumnAggregators

protected List<ColumnAggregator> getColumnAggregators()
Returns:
the ColumnAggregator List

isCellEditable

public boolean isCellEditable(int row,
                              int columnIdx)

Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class DefaultTableModel

getRowCount

public int getRowCount()

Specified by:
getRowCount in interface TableModel
Overrides:
getRowCount in class DefaultTableModel

getColumnCount

public int getColumnCount()

Specified by:
getColumnCount in interface TableModel
Overrides:
getColumnCount in class DefaultTableModel

getColumnClass

public Class<?> getColumnClass(int columnIndex)

Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel

getValueAt

public Object getValueAt(int row,
                         int columnIndex)

Specified by:
getValueAt in interface TableModel
Overrides:
getValueAt in class DefaultTableModel


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.