Class SortHelper

  • All Implemented Interfaces:
    Serializable

    public class SortHelper
    extends RangeHelperBase
    Manipulate cells according to sorting criteria and options. If sorting regions contains blank cells, it will ignore it. It only sort those cells with data.
    Since:
    3.5.0
    Author:
    Hawk
    See Also:
    Serialized Form
    • Constructor Detail

      • SortHelper

        public SortHelper​(SRange range)
    • Method Detail

      • sort

        public void sort​(SRange key1,
                         boolean descending1,
                         SRange.SortDataOption dataOption1,
                         SRange key2,
                         boolean descending2,
                         SRange.SortDataOption dataOption2,
                         SRange key3,
                         boolean descending3,
                         SRange.SortDataOption dataOption3,
                         int header,
                         boolean matchCase,
                         boolean sortByRows)
        Major procedure for sorting a selected range: record merged region, sort, unmerge merged regions, restore merged region
        Parameters:
        key1 - the range that contains first keys to sort
        descending1 - the order to sort first key
        dataOption1 - BookHelper.SORT_TEXT_AS_NUMBERS, BookHelper.SORT_NORMAL_DEFAULT
        key2 -
        descending2 -
        dataOption2 -
        key3 -
        descending3 -
        dataOption3 -
        header -
        matchCase -
        sortByRows - sort by keys in rows, true means "left to right", and false means "top to bottom"