org.knime.base.data.filter.row
Class DoubleCellFilterRowGenerator

java.lang.Object
  extended by org.knime.base.data.filter.row.DoubleCellFilterRowGenerator
All Implemented Interfaces:
FilterRowGenerator

public class DoubleCellFilterRowGenerator
extends Object
implements FilterRowGenerator

This class implements the FilterRowGenerator interface for DoubleCell objects and checks if they are within a certain interval.

It provides two options, one uses a single border the other one a two border interval. In general, each type allows to define if the border is included or excluded, see IN and OUT. Furthermore, it is possible to define if the range on the LEFT and/or on the RIGHT is included to the interval. E.g., LEFT+IN, LEFT+OUT, RIGHT+IN, RIGHT+OUT.

Author:
Thomas Gabriel, University of Konstanz

Field Summary
static int IN
          Values on the border are included.
static int LEFT
          Use interval on the left of the border.
static int OUT
          Values on the border are excluded.
static int RIGHT
          Use interval of the right of the border.
 
Constructor Summary
DoubleCellFilterRowGenerator(int columnIndex, double doubleValue, int mask)
          Creates a new single border row filter.
DoubleCellFilterRowGenerator(int columnIndex, double doubleLeft, int maskLeft, double doubleRight, int maskRight)
           
DoubleCellFilterRowGenerator(int columnIndex, DoubleValue doubleCell, int mask)
           
DoubleCellFilterRowGenerator(int columnIndex, DoubleValue doubleCellLeft, int maskLeft, DoubleValue doubleCellRight, int maskRight)
           
 
Method Summary
 boolean isIn(DataRow row)
          Checks if the given row lies within the define interval borders.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IN

public static final int IN
Values on the border are included.

See Also:
Constant Field Values

OUT

public static final int OUT
Values on the border are excluded.

See Also:
Constant Field Values

LEFT

public static final int LEFT
Use interval on the left of the border.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Use interval of the right of the border.

See Also:
Constant Field Values
Constructor Detail

DoubleCellFilterRowGenerator

public DoubleCellFilterRowGenerator(int columnIndex,
                                    DoubleValue doubleCell,
                                    int mask)
Parameters:
columnIndex - the column's index
doubleCell - the double cell border
mask - the interval mask
Throws:
NullPointerException - if the double cell is null
See Also:
DoubleCellFilterRowGenerator(int,double,int)

DoubleCellFilterRowGenerator

public DoubleCellFilterRowGenerator(int columnIndex,
                                    double doubleValue,
                                    int mask)
Creates a new single border row filter.

Parameters:
columnIndex - the column's index
doubleValue - the double value border
mask - the interval mask
Throws:
IllegalArgumentException - if the column index is negative or the mask can not composed from IN + LEFT, IN + RIGHT, OUT + LEFT, or OUT + RIGHT

DoubleCellFilterRowGenerator

public DoubleCellFilterRowGenerator(int columnIndex,
                                    DoubleValue doubleCellLeft,
                                    int maskLeft,
                                    DoubleValue doubleCellRight,
                                    int maskRight)
Parameters:
columnIndex - the column's index
doubleCellLeft - the left border value
maskLeft - the left mask
doubleCellRight - the right border value
maskRight - the right mask
Throws:
NullPointerException - if one of the double cells is null
See Also:
DoubleCellFilterRowGenerator(int,double,int,double,int)

DoubleCellFilterRowGenerator

public DoubleCellFilterRowGenerator(int columnIndex,
                                    double doubleLeft,
                                    int maskLeft,
                                    double doubleRight,
                                    int maskRight)
Parameters:
columnIndex - the column's index
doubleLeft - the left border value
maskLeft - the left mask
doubleRight - the right border value
maskRight - the right mask
Throws:
IllegalArgumentException - if the column index is negative, right and left border overlap, left or right mask can not be composed, or the mask conflict by referring to the same direction
Method Detail

isIn

public boolean isIn(DataRow row)
Checks if the given row lies within the define interval borders.

Specified by:
isIn in interface FilterRowGenerator
Parameters:
row - the row which should be checked for being inside the interval
Returns:
true if inside the define interval
Throws:
NullPointerException - if the given row is null
ClassCastException - if the row's cell is not of type DoubleCell


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.