Class SortedTable.AbstractRowComparator

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

public 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 Details

    • AbstractRowComparator

      public 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 Details

    • 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