de.kupzog.examples
Class SortComparatorExample

java.lang.Object
  extended by de.kupzog.ktable.KTableSortComparator
      extended by de.kupzog.examples.SortComparatorExample
All Implemented Interfaces:
java.util.Comparator

public class SortComparatorExample
extends KTableSortComparator

Author:
Lorenz Maierhofer

Field Summary
 
Fields inherited from class de.kupzog.ktable.KTableSortComparator
SORT_DOWN, SORT_NONE, SORT_UP
 
Constructor Summary
SortComparatorExample(KTableSortedModel model, int columnIndex, int direction)
           
 
Method Summary
 int doCompare(java.lang.Object o1, java.lang.Object o2, int row1, int row2)
          Implement this method to do the actual compare between the two cell contents.
 
Methods inherited from class de.kupzog.ktable.KTableSortComparator
compare, getColumnToSortOn, getModel, getSortDirection, setColumnToCompare, setModel, setSortDirection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SortComparatorExample

public SortComparatorExample(KTableSortedModel model,
                             int columnIndex,
                             int direction)
Method Detail

doCompare

public int doCompare(java.lang.Object o1,
                     java.lang.Object o2,
                     int row1,
                     int row2)
Description copied from class: KTableSortComparator
Implement this method to do the actual compare between the two cell contents.

Specified by:
doCompare in class KTableSortComparator
Parameters:
o1 - The cell content of the first cell
o2 - The cell content of the second cell
row1 - The row index where o1 was found in the model.
row2 - The row index where o2 was found in the model.
Returns:
Returns an int smaller, equal or larger than 0 if o1 is smaller, equal or larger than o2.