org.knime.base.node.preproc.setoperator
Class SingleColRowComparator

java.lang.Object
  extended by org.knime.base.node.preproc.setoperator.SingleColRowComparator
All Implemented Interfaces:
Comparator<DataRow>

public class SingleColRowComparator
extends Object
implements Comparator<DataRow>

Author:
Tobias Koetter, University of Konstanz

Constructor Summary
SingleColRowComparator(int colIdx, DataValueComparator comp)
          Constructor for class SingleColRowComparator.
 
Method Summary
static int compare(DataCell c1, DataCell c2, Comparator<DataCell> comp)
           
 int compare(DataRow r1, DataRow r2)
          
 Comparator<DataCell> getComparator()
           
 void setColumnIndex(int colIdx)
           
 void setComparator(Comparator<DataCell> comp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SingleColRowComparator

public SingleColRowComparator(int colIdx,
                              DataValueComparator comp)
Constructor for class SingleColRowComparator.

Parameters:
colIdx - the index of the column to compare or -1 if the RowID should be used
comp - the Comparator to use
Method Detail

setComparator

public void setComparator(Comparator<DataCell> comp)
Parameters:
comp - the Comparator to use

getComparator

public Comparator<DataCell> getComparator()
Returns:
the used Comparator

setColumnIndex

public void setColumnIndex(int colIdx)
Parameters:
colIdx - the colIdx to set or -1 if the RowID should be used

compare

public int compare(DataRow r1,
                   DataRow r2)

Specified by:
compare in interface Comparator<DataRow>

compare

public static int compare(DataCell c1,
                          DataCell c2,
                          Comparator<DataCell> comp)
Parameters:
c1 - first cell to compare
c2 - second cell to compare
comp - the comparator to use
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.


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.