Package io.keikai.range.impl
Class SortHelper
- java.lang.Object
-
- io.keikai.range.impl.RangeHelperBase
-
- io.keikai.range.impl.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SortHelper.SortKey
-
Field Summary
Fields Modifier and Type Field Description static int
SORT_HEADER_NO
static int
SORT_HEADER_YES
-
Fields inherited from class io.keikai.range.impl.RangeHelperBase
range, sheet
-
-
Constructor Summary
Constructors Constructor Description SortHelper(SRange range)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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-
Methods inherited from class io.keikai.range.impl.RangeHelperBase
getColumn, getFormatEngine, getFormattedText, getFormulaEngine, getLastColumn, getLastRow, getRow, isBlank, isWholeColumn, isWholeRow, isWholeSheet
-
-
-
-
Field Detail
-
SORT_HEADER_NO
public static final int SORT_HEADER_NO
- See Also:
- Constant Field Values
-
SORT_HEADER_YES
public static final int SORT_HEADER_YES
- See Also:
- Constant Field Values
-
-
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 sortdescending1
- the order to sort first keydataOption1
- BookHelper.SORT_TEXT_AS_NUMBERS, BookHelper.SORT_NORMAL_DEFAULTkey2
-descending2
-dataOption2
-key3
-descending3
-dataOption3
-header
-matchCase
-sortByRows
- sort by keys in rows, true means "left to right", and false means "top to bottom"
-
-