Package org.jdesktop.swingx.decorator
Class SortKey
- java.lang.Object
-
- org.jdesktop.swingx.decorator.SortKey
-
public class SortKey extends java.lang.ObjectA column and how its sorted.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)intgetColumn()The sorting column in terms of model index.java.util.ComparatorgetComparator()The comparator to use, might be null.static SortKeygetFirstSortingKey(java.util.List<? extends SortKey> keys)Returns the first SortKey in the list which is sorted.static SortKeygetFirstSortKeyForColumn(java.util.List<? extends SortKey> keys, int modelColumn)Returns the first SortKey in the list for the given column, or null if the column has no SortKey.SortOrdergetSortOrder()The sort order, ascending, descending or unsorted.inthashCode()
-
-
-
Constructor Detail
-
SortKey
public SortKey(SortOrder sortOrder, int column)
- Parameters:
sortOrder- one ofSortOrder.ASCENDING,SortOrder.DESCENDINGorSortOrder.UNSORTED.column- a column in terms of model index.
-
SortKey
public SortKey(SortOrder sortOrder, int column, java.util.Comparator comparator)
- Parameters:
sortOrder- one ofSortOrder.ASCENDING,SortOrder.DESCENDINGorSortOrder.UNSORTED.column- a column in terms of model index.comparator- the comparator to use with this sort.
-
-
Method Detail
-
getSortOrder
public SortOrder getSortOrder()
The sort order, ascending, descending or unsorted.
-
getColumn
public int getColumn()
The sorting column in terms of model index.
-
getComparator
public java.util.Comparator getComparator()
The comparator to use, might be null.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getFirstSortingKey
public static SortKey getFirstSortingKey(java.util.List<? extends SortKey> keys)
Returns the first SortKey in the list which is sorted. If none is sorted, null is returned.- Parameters:
keys- a list of SortKeys to search- Returns:
- the first SortKey which is sorted or null, if no is found.
-
getFirstSortKeyForColumn
public static SortKey getFirstSortKeyForColumn(java.util.List<? extends SortKey> keys, int modelColumn)
Returns the first SortKey in the list for the given column, or null if the column has no SortKey.- Parameters:
keys- a list of SortKeys to searchmodelColumn- the column index in model coordinates- Returns:
- the first SortKey for the given column or null if none is found.
-
-