Class TableRowComparator<Bean,VTM extends ViewToModel<Bean>>
- java.lang.Object
-
- io.github.jonestimd.swing.table.sort.TableRowComparator<Bean,VTM>
-
- Type Parameters:
Bean- The class of the beans in the table modelVTM- The class that maps the table row index to the model row index
- All Implemented Interfaces:
java.util.Comparator<VTM>
- Direct Known Subclasses:
HeaderDetailTableRowSorter.HeaderDetailTableRowComparator,SectionTableRowSorter.SectionTableRowComparator
public class TableRowComparator<Bean,VTM extends ViewToModel<Bean>> extends java.lang.Object implements java.util.Comparator<VTM>This class provides a comparator for sorting rows in aDecoratedTablethat uses aBeanTableModel.
-
-
Constructor Summary
Constructors Constructor Description TableRowComparator(DecoratedTable<Bean,? extends BeanTableModel<Bean>> table)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Comparator<VTM>columnComparator(javax.swing.RowSorter.SortKey sortKey)intcompare(VTM row1, VTM row2)java.util.List<javax.swing.RowSorter.SortKey>getSortKeys()booleanisEmpty()booleanisSorted(int column)voidreset()voidsetSortKeys(java.util.List<? extends javax.swing.RowSorter.SortKey> keys)voidtoggleSortOrder(int column)
-
-
-
Constructor Detail
-
TableRowComparator
public TableRowComparator(DecoratedTable<Bean,? extends BeanTableModel<Bean>> table)
-
-
Method Detail
-
compare
public int compare(VTM row1, VTM row2)
- Specified by:
comparein interfacejava.util.Comparator<Bean>
-
getSortKeys
public java.util.List<javax.swing.RowSorter.SortKey> getSortKeys()
-
setSortKeys
public void setSortKeys(java.util.List<? extends javax.swing.RowSorter.SortKey> keys)
-
toggleSortOrder
public void toggleSortOrder(int column)
-
isEmpty
public boolean isEmpty()
-
isSorted
public boolean isSorted(int column)
-
reset
public void reset()
-
columnComparator
protected java.util.Comparator<VTM> columnComparator(javax.swing.RowSorter.SortKey sortKey)
-
-