| java.lang.Object org.glasser.util.comparators.BaseComparator org.glasser.swing.table.ColumnManagerComparator
ColumnManagerComparator | public class ColumnManagerComparator extends BaseComparator (Code) | | This comparator is used by a ListTableModel to sort its rows on a particular
column. It uses the ColumnManager that has been set for the ListTableModel
to extract the column values for each of two given rows, and then compares those
values to establish an ordering for the rows.
Objects of this class are not thread-safe, however, as used by the ListTableModel
in a single-threaded GUI, it should not be a problem.
author: Dave Glasser |
Method Summary | |
protected int | doCompare(Object o1, Object o2) The two objects passed to this method are rows in a ListTableModel. | public int | getSortColumn() Returns the column index which is used to compare two row objects. | public void | setColumnComparator(int columnIndex, Comparator comparator) | protected void | setNullIsGreater(boolean nullIsGreater) Sets the value of the nullIsGreater field, which determines whether
null objects are considered "greater than" or "less than" non-null objects
for sorting purposes. | public void | setSortColumn(int sortColumn) This is the column index on which two row objects will be compared. | protected void | setSortDescending(boolean sortDescending) Sets the value of the sortDescending field. |
columnManager | protected ColumnManager columnManager(Code) | | This is the column manager used to extract column values from row objects.
|
sortColumn | protected int sortColumn(Code) | | |
doCompare | protected int doCompare(Object o1, Object o2)(Code) | | The two objects passed to this method are rows in a ListTableModel. The ColumnManager
is used to get the correct column value from each row object, and compares the two
column values to establish an ordering for the two rows.
|
getSortColumn | public int getSortColumn()(Code) | | Returns the column index which is used to compare two row objects.
|
setColumnComparator | public void setColumnComparator(int columnIndex, Comparator comparator)(Code) | | |
setNullIsGreater | protected void setNullIsGreater(boolean nullIsGreater)(Code) | | Sets the value of the nullIsGreater field, which determines whether
null objects are considered "greater than" or "less than" non-null objects
for sorting purposes. The default is false.
|
setSortColumn | public void setSortColumn(int sortColumn)(Code) | | This is the column index on which two row objects will be compared.
|
setSortDescending | protected void setSortDescending(boolean sortDescending)(Code) | | Sets the value of the sortDescending field. If true, the sign of the
value of the compare() method is "flipped" before it's returned to
the caller, which will cause collections of objects to be sorted
in reverse order.
|
|
|