Class SortKey


  • public class SortKey
    extends java.lang.Object
    A column and how its sorted.
    • 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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.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 search
        modelColumn - the column index in model coordinates
        Returns:
        the first SortKey for the given column or null if none is found.