Class ComparatorColumn<T>

java.lang.Object
com.jsql.view.swing.table.ComparatorColumn<T>
All Implemented Interfaces:
Comparator<T>

public class ComparatorColumn<T> extends Object implements Comparator<T>
Comparator for table column values ; column with only int data is sorted like 3 lt 20 lt 100, column with string will sort like 100 gt 20 gt 3 gt abc.
  • Constructor Details

    • ComparatorColumn

      public ComparatorColumn()
  • Method Details

    • compare

      public int compare(T cellLeft, T cellRight)
      Custom compare to sort numbers as numbers. Strings as strings, with numbers ordered before strings.
      Specified by:
      compare in interface Comparator<T>
      Parameters:
      cellLeft -
      cellRight -
      Returns: