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

java.lang.Object
  extended by org.knime.base.node.preproc.filter.row.rowfilter.RowFilter
      extended by org.knime.base.node.preproc.filter.row.rowfilter.ColValFilterOldObsolete
All Implemented Interfaces:
Cloneable

Deprecated. This filter contains too much functionality (which can be used only one at a time anyway). We have split it into three filter classes: MissingValueRowFilter, StringCompareRowFilter, RangeRowFilter.
This filter is used by the previous row filter node implementation. If you want to remove it, you must move the old code in the deprecated package.

@Deprecated
public class ColValFilterOldObsolete
extends RowFilter

A filter selecting rows depending on the content of a column (or cell of the row). The cell content can either be matched against a regular expression or compared to a given range. Matches and rows inside the range can either be included or excluded. RegExpr match can be done case sensitive or insensitive.

Author:
Peter Ohl, University of Konstanz

Constructor Summary
ColValFilterOldObsolete()
          Deprecated. Default constructor.
ColValFilterOldObsolete(DataValueComparator comp, DataCell lowerBound, DataCell upperBound, String colName, boolean include)
          Deprecated. Creates a new filter that tests the value of the specified cell against the specified range.
ColValFilterOldObsolete(String colName, boolean include)
          Deprecated. Creates a new filter that filters missing values of the specified column.
ColValFilterOldObsolete(String regExpr, String colName, boolean include, boolean caseSensitive, boolean startsWith)
          Deprecated. Creates a new filter which matches the string representation of the specified column against a given regular expression.
 
Method Summary
 boolean caseSensitiveMatch()
          Deprecated.  
 DataTableSpec configure(DataTableSpec inSpec)
          Deprecated. The column value filter grabs the comparator from the table spec (if available) and checks settings against the latest spec.
 String getColumnName()
          Deprecated.  
 boolean getFilterMissingValues()
          Deprecated.  
 DataCell getLowerBound()
          Deprecated.  
 String getRegExpr()
          Deprecated.  
 DataCell getUpperBound()
          Deprecated.  
 boolean includeMatchingLines()
          Deprecated.  
 void loadSettingsFrom(NodeSettingsRO cfg)
          Deprecated. A comparator MUST be set if a range is specified in the config object!! Load your internal settings from the configuration object.
 boolean matches(DataRow row, int rowIndex)
          Deprecated. Return true if the specified row matches the criteria set in the filter.
 boolean mustEntirelyMatch()
          Deprecated.  
 boolean rangeSet()
          Deprecated.  
protected  void saveSettings(NodeSettingsWO cfg)
          Deprecated. Do not call this function - rather call RowFilter.saveSettingsTo(NodeSettingsWO).
 void setDataValueComparator(DataValueComparator dcComp)
          Deprecated. Sets a new comparator used to check the range if lower and upper bounds are set.
 boolean testingStringPattern()
          Deprecated.  
 String toString()
          Deprecated. 
 
Methods inherited from class org.knime.base.node.preproc.filter.row.rowfilter.RowFilter
clone, saveSettingsTo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColValFilterOldObsolete

public ColValFilterOldObsolete(String regExpr,
                               String colName,
                               boolean include,
                               boolean caseSensitive,
                               boolean startsWith)
Deprecated. 
Creates a new filter which matches the string representation of the specified column against a given regular expression.

Parameters:
regExpr - a valid regular expression; causes an exception to fly if its not a valid reg expr
colName - the name of the column to test in the row
include - flag indicating whether to include or exclude rows with a matching value
caseSensitive - if true the match will be done case sensitive, or if false case insensitive
startsWith - determines whether the value must match entirely the regular expression or can only start with it.
Throws:
IllegalArgumentException - if the pattern passed as regular expression is not a valid regExpr

ColValFilterOldObsolete

public ColValFilterOldObsolete(DataValueComparator comp,
                               DataCell lowerBound,
                               DataCell upperBound,
                               String colName,
                               boolean include)
Deprecated. 
Creates a new filter that tests the value of the specified cell against the specified range.

Parameters:
comp - the comparator that will be used to compare the column's cell with the bounds of the range.
lowerBound - if the comparator doesn't return a negative number when the cell is compared with this value, the cell is above the lower bound. If null no minimum is set.
upperBound - if the comparator doesn't return a positive number when the cell is compared with this value, the cell is below the upper bound. If null, no maximum is set.
colName - the name of the column to test in the row
include - determines whether to include or exclude rows with a value inside the range

ColValFilterOldObsolete

public ColValFilterOldObsolete(String colName,
                               boolean include)
Deprecated. 
Creates a new filter that filters missing values of the specified column.

Parameters:
colName - the name of the column to test the values of
include - if true, rows with a missing value in the specified column are included, otherwise excluded

ColValFilterOldObsolete

ColValFilterOldObsolete()
Deprecated. 
Default constructor. Don't use without loading settings before.

Method Detail

setDataValueComparator

public void setDataValueComparator(DataValueComparator dcComp)
Deprecated. 
Sets a new comparator used to check the range if lower and upper bounds are set. This MUST be called after settings have been loaded from a config object and upper/lower bounds were set. It is always save to set a comparator. Its only used if at least one bound is set.

Parameters:
dcComp - the comparator used to compare the column's value with the upper and lower range

includeMatchingLines

public boolean includeMatchingLines()
Deprecated. 
Returns:
true if rows inside the specified range or matching the specified regular expression will be included, false if they are excluded

getColumnName

public String getColumnName()
Deprecated. 
Returns:
the index of the column whose value is tested

getFilterMissingValues

public boolean getFilterMissingValues()
Deprecated. 
Returns:
true if rows with missing values in the specified attribute are filtered.

rangeSet

public boolean rangeSet()
Deprecated. 
Returns:
true if the range of the column is tested

getLowerBound

public DataCell getLowerBound()
Deprecated. 
Returns:
the lower bound of the range the value of the specified column is tested against. null if no range testing is happening or if no minimum is set

getUpperBound

public DataCell getUpperBound()
Deprecated. 
Returns:
the upper bound of the range the value of the specified column is tested against. null if no range testing is happening or if no maximum is set

testingStringPattern

public boolean testingStringPattern()
Deprecated. 
Returns:
true if the string representation of the column's value is tested against a regular expression

getRegExpr

public String getRegExpr()
Deprecated. 
Returns:
the reg expr the column's value is tested against, or null if no pattern matching is happening

mustEntirelyMatch

public boolean mustEntirelyMatch()
Deprecated. 
Returns:
true if the value pattern must entirely match the reg expr, false if it can also only start with the expression

caseSensitiveMatch

public boolean caseSensitiveMatch()
Deprecated. 
Returns:
true if the reg expr match is done in a case sensitive way

matches

public boolean matches(DataRow row,
                       int rowIndex)
                throws EndOfTableException,
                       IncludeFromNowOn
Deprecated. 
Return true if the specified row matches the criteria set in the filter. Can throw a EndOfTableException if the filter can tell that no more rows of the table will be able to fulfill the criteria.

Specified by:
matches in class RowFilter
Parameters:
row - the row to test
rowIndex - the row index of the passed row in the original table
Returns:
true if the row matches the criteria set in the filter, false if not
Throws:
EndOfTableException - if there is no chance that any of the rows coming (including the current rowIndex) will fulfill the criteria, thus no further row in the original table will be a match to this filter. (In general this is hard to tell, but a row number filter can certainly use it.) If the exception is received the row filter table iterator will flag an end of table.
IncludeFromNowOn - if the current and all following rows from now on are to be included into the result table

loadSettingsFrom

public void loadSettingsFrom(NodeSettingsRO cfg)
                      throws InvalidSettingsException
Deprecated. 
A comparator MUST be set if a range is specified in the config object!! 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)
Deprecated. 
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

configure

public DataTableSpec configure(DataTableSpec inSpec)
                        throws InvalidSettingsException
Deprecated. 
The column value filter grabs the comparator from the table spec (if available) and checks settings against the latest spec. 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

toString

public String toString()
Deprecated. 

Overrides:
toString in class Object


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.