Class ShuttleSorter


  • public class ShuttleSorter
    extends Sorter
    Pluggable sorting filter.
    • Constructor Detail

      • ShuttleSorter

        public ShuttleSorter()
      • ShuttleSorter

        public ShuttleSorter​(int col,
                             boolean ascending)
      • ShuttleSorter

        public ShuttleSorter​(int col,
                             boolean ascending,
                             java.util.Comparator comparator)
    • Method Detail

      • init

        protected void init()
        Description copied from class: Filter
        Provides filter-specific initialization. Called from the Filter constructor.
        Specified by:
        init in class Filter
      • reset

        protected void reset()
        Resets the internal row mappings from this filter to the previous filter.
        Specified by:
        reset in class Filter
      • filter

        protected void filter()
        Performs the sort. Calls sort only if canFilter(), regards all values as equal (== doesn't sort) otherwise.
        Specified by:
        filter in class Filter
        See Also:
        canFilter()
      • canFilter

        protected boolean canFilter()
        This is a quickfix for #55-swingx: NPE if sorter is in pipeline. No way to automatically cleanup "from the outside" if the sorter is hooked to a columnIndex which is no longer valid. So we check here for assigned and valid index.

        PENDING: should be done higher up?

        Returns:
        boolean to indicate whether accessing the values is valid.
      • getSize

        public int getSize()
        Description copied from class: Filter
        Returns the number of records that remain in this filter's output ("view") after the input records have been filtered.
        Specified by:
        getSize in class Filter
        Returns:
        the number of records that remain in this filter's output ("view") after the input records have been filtered
      • mapTowardModel

        protected int mapTowardModel​(int row)
        Description copied from class: Filter
        PRE: 0 <= row < getSize();
        Specified by:
        mapTowardModel in class Filter
        Returns:
        TODO:
      • sort

        protected void sort​(int[] from,
                            int[] to,
                            int low,
                            int high)