org.knime.base.node.preproc.filter.row.rowfilter
Class AttrValueRowFilter

java.lang.Object
  extended by org.knime.base.node.preproc.filter.row.rowfilter.RowFilter
      extended by org.knime.base.node.preproc.filter.row.rowfilter.AttrValueRowFilter
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
MissingValueRowFilter, RangeRowFilter, StringCompareRowFilter

public abstract class AttrValueRowFilter
extends RowFilter

Super class for all row filters that test an attribute value (like StringCompareRowFilter, MissingValueRowFilter, and RangeRowFilter).

Author:
ohl, University of Konstanz

Constructor Summary
(package private) AttrValueRowFilter()
          Don't use an instance created by this constructor until calling loadSettings and configure.
protected AttrValueRowFilter(String colName, boolean include)
          The super class stores the class name and the include flag for all filters checking the attribute value in some way.
 
Method Summary
 DataTableSpec configure(DataTableSpec inSpec)
          Called when a new DataTableSpec is available.
protected  int getColIdx()
           
 String getColName()
           
 boolean getInclude()
           
 void loadSettingsFrom(NodeSettingsRO cfg)
          Load your internal settings from the configuration object.
protected  void saveSettings(NodeSettingsWO cfg)
          Do not call this function - rather call RowFilter.saveSettingsTo(NodeSettingsWO).
 
Methods inherited from class org.knime.base.node.preproc.filter.row.rowfilter.RowFilter
clone, matches, saveSettingsTo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttrValueRowFilter

AttrValueRowFilter()
Don't use an instance created by this constructor until calling loadSettings and configure.


AttrValueRowFilter

protected AttrValueRowFilter(String colName,
                             boolean include)
The super class stores the class name and the include flag for all filters checking the attribute value in some way.

Parameters:
colName - the name of the column to test
include - flag indicating whether to include or exclude matching rows
Method Detail

configure

public DataTableSpec configure(DataTableSpec inSpec)
                        throws InvalidSettingsException
Called when a new DataTableSpec is available. The filters can grab whatever they need from that new config (e.g. a comparator), should do some error checking (e.g. col number against number of columns) - throw an InvalidSettingsException if settings are invalid, and can return a new table spec according to their settings - if they can. If a filter cannot tell how it would modify the spec, it should return null. (Returned table specs are not used right now anyway.)

Specified by:
configure in class RowFilter
Parameters:
inSpec - the new spec propagated into the row filter node. Could be null or empty!
Returns:
a new table spec, if you can
Throws:
InvalidSettingsException - if the settings in the row filter are not compatible with the table spec coming in

loadSettingsFrom

public void loadSettingsFrom(NodeSettingsRO cfg)
                      throws InvalidSettingsException
Load your internal settings from the configuration object. Throw an exception if the config is invalid/incorrect/inconsistent.

Specified by:
loadSettingsFrom in class RowFilter
Parameters:
cfg - the object holding the settings to load
Throws:
InvalidSettingsException - if cfg contains invalid/incorrect/inconsistent settings

saveSettings

protected void saveSettings(NodeSettingsWO cfg)
Do not call this function - rather call RowFilter.saveSettingsTo(NodeSettingsWO). This is just a helper function for RowFilter.saveSettingsTo(NodeSettingsWO). Row filters implement this and do the work usually done in RowFilter.saveSettingsTo(NodeSettingsWO). The passed config is prepared in a way that the factory will be able to recreate this object from it.

Specified by:
saveSettings in class RowFilter
Parameters:
cfg - object to add the current internal settings to

getColName

public String getColName()
Returns:
the colName

getColIdx

protected int getColIdx()
Returns:
the index of the column with the column name. Not valid until configure is called.

getInclude

public boolean getInclude()
Returns:
the include


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.