Class RowBasedColumnComparator<T>

java.lang.Object
docking.widgets.table.sort.RowBasedColumnComparator<T>
Type Parameters:
T - the row type
All Implemented Interfaces:
Comparator<T>
Direct Known Subclasses:
ThreadedTableColumnComparator

public class RowBasedColumnComparator<T> extends Object implements Comparator<T>
A comparator for a specific column that will take in a T row object, extract the value for the given column and then call the give comparator
  • Field Details

  • Constructor Details

    • RowBasedColumnComparator

      public RowBasedColumnComparator(RowObjectTableModel<T> model, int sortColumn, Comparator<Object> comparator)
      Constructs this class with the given column comparator that will get called after the given row is converted to the column value for the given sort column
      Parameters:
      model - the table model using this comparator
      sortColumn - the column being sorted
      comparator - the column comparator to use for sorting
    • RowBasedColumnComparator

      public RowBasedColumnComparator(RowObjectTableModel<T> model, int sortColumn, Comparator<Object> comparator, Comparator<Object> backupRowComparator)
      This version of the constructor is used for the default case where the client will supply a backup row comparator that will get called if the given column comparator returns a '0' value.
      Parameters:
      model - the table model using this comparator
      sortColumn - the column being sorted
      comparator - the column comparator to use for sorting
      backupRowComparator - the backup row comparator
  • Method Details

    • compare

      public int compare(T t1, T t2)
      Specified by:
      compare in interface Comparator<T>
    • getColumnValue

      protected Object getColumnValue(T t)