org.dbunit.dataset
Class SortedTable.AbstractRowComparator

java.lang.Object
  extended by org.dbunit.dataset.SortedTable.AbstractRowComparator
All Implemented Interfaces:
Comparator
Direct Known Subclasses:
SortedTable.RowComparator, SortedTable.RowComparatorByString
Enclosing class:
SortedTable

protected abstract static class SortedTable.AbstractRowComparator
extends Object
implements Comparator

Abstract class for sorting the table rows of a given table in a specific order


Constructor Summary
SortedTable.AbstractRowComparator(ITable table, Column[] sortColumns)
           
 
Method Summary
protected abstract  int compare(Column column, Object value1, Object value2)
           
 int compare(Object o1, Object o2)
           
 
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

SortedTable.AbstractRowComparator

public SortedTable.AbstractRowComparator(ITable table,
                                         Column[] sortColumns)
Parameters:
table - The wrapped table to be sorted
sortColumns - The columns to be used for sorting in the given order
Method Detail

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator

compare

protected abstract int compare(Column column,
                               Object value1,
                               Object value2)
                        throws TypeCastException
Parameters:
column - The column to be compared
value1 - The first value of the given column
value2 - The second value of the given column
Returns:
0 if both values are considered equal.
Throws:
TypeCastException


Copyright © 2002-2012. All Rights Reserved.