| Modifier and Type | Field and Description |
|---|---|
| public static final int | ASCENDING
This bit mask means the values should be sorted in ascending order. |
| public static final int | DESCENDING
This bit mask means the values should be sorted in descending order. |
| public static final int | NULLS_FIRST
This bit mask means NULLs should be sorted before other data, no matter if ascending or descending order is used. |
| public static final int | NULLS_LAST
This bit mask means NULLs should be sorted after other data, no matter if ascending or descending order is used. |
| private final ArrayList | orderList
The order list. |
| private final int[] | queryColumnIndexes
The column indexes of the order by expressions within the query. |
| private final SessionLocal | |
| private final int[] | sortTypes
The sort type bit mask (DESCENDING, NULLS_FIRST, NULLS_LAST). |
| Access | Constructor and Description |
|---|---|
| public | SortOrder(SessionLocal
the session session, int[] the column index list queryColumnIndexes)Construct a new sort order object with default sort directions. |
| public | SortOrder(SessionLocal
the session session, int[] the column index list queryColumnIndexes, int[] the sort order bit masks sortType, ArrayList<QueryOrderBy> the original query order list (if this is a query) orderList)Construct a new sort order object. |
| Modifier and Type | Method and Description |
|---|---|
| public static int[] | Returns: the specified array with possibly modified bit masksthe database database, int[] bit masks sortTypes)Add explicit |
| public int | Returns: the result of the comparisonthe first expression list a, Value[] the second expression list b)Implements java. Compare two expression lists. |
| public int | |
| private int | |
| public Column | Returns: the column, or nullthe column index (0, 1,..) index, TableFilter the table filter filter)Get the column for the given table filter, if the sort column is for this filter. |
| public ArrayList | |
| public int[] | |
| public Comparator | |
| public int[] | |
| public int[] | getSortTypesWithNullOrdering()
Returns sort order bit masks with |
| public StringBuilder | Returns: the specified string builderstring builder to append to builder, Expression[] the expression list list, int the number of columns in the select list visible, int formatting flags sqlFlags)Create the SQL snippet that describes this sort order. |
| public static int | |
| public void | |
| public void | |
| public static void | typeToString(StringBuilder
string builder builder, int sort type type)Appends type information (DESC, NULLS FIRST, NULLS LAST) to the specified statement builder. |
| ASCENDING | back to summary |
|---|---|
| public static final int ASCENDING This bit mask means the values should be sorted in ascending order. | |
| DESCENDING | back to summary |
|---|---|
| public static final int DESCENDING This bit mask means the values should be sorted in descending order. | |
| NULLS_FIRST | back to summary |
|---|---|
| public static final int NULLS_FIRST This bit mask means NULLs should be sorted before other data, no matter if ascending or descending order is used. | |
| NULLS_LAST | back to summary |
|---|---|
| public static final int NULLS_LAST This bit mask means NULLs should be sorted after other data, no matter if ascending or descending order is used. | |
| orderList | back to summary |
|---|---|
| private final ArrayList<QueryOrderBy> orderList The order list. | |
| queryColumnIndexes | back to summary |
|---|---|
| private final int[] queryColumnIndexes The column indexes of the order by expressions within the query. | |
| session | back to summary |
|---|---|
| private final SessionLocal session | |
| sortTypes | back to summary |
|---|---|
| private final int[] sortTypes The sort type bit mask (DESCENDING, NULLS_FIRST, NULLS_LAST). | |
| SortOrder | back to summary |
|---|---|
| public SortOrder(SessionLocal session, int[] queryColumnIndexes) Construct a new sort order object with default sort directions.
| |
| SortOrder | back to summary |
|---|---|
| public SortOrder(SessionLocal session, int[] queryColumnIndexes, int[] sortType, ArrayList<QueryOrderBy> orderList) Construct a new sort order object.
| |
| addNullOrdering | back to summary |
|---|---|
| public static int[] addNullOrdering(Database database, int[] sortTypes) Add explicit
| |
| compare | back to summary |
|---|---|
| public int compare(Value[] a, Value[] b) Implements java. Compare two expression lists. | |
| compare | back to summary |
|---|---|
| public int compare(Value[] a, Value[] b, int count) Compare two expression lists. | |
| compareImpl | back to summary |
|---|---|
| private int compareImpl(Value[] a, Value[] b, int count) | |
| getColumn | back to summary |
|---|---|
| public Column getColumn(int index, TableFilter filter) Get the column for the given table filter, if the sort column is for this filter.
| |
| getOrderList | back to summary |
|---|---|
| public ArrayList Returns the original query order list.
| |
| getQueryColumnIndexes | back to summary |
|---|---|
| public int[] getQueryColumnIndexes() Get the column index list. This is the column indexes of the order by expressions within the query. For the query "select name, id from test order by id, name" this is {1, 0} as the first order by expression (the column "id") is the second column of the query, and the second order by expression ("name") is the first column of the query.
| |
| getRowValueComparator | back to summary |
|---|---|
| public Comparator Returns comparator for row values.
| |
| getSortTypes | back to summary |
|---|---|
| public int[] getSortTypes() Get the sort order bit masks.
| |
| getSortTypesWithNullOrdering | back to summary |
|---|---|
| public int[] getSortTypesWithNullOrdering() Returns sort order bit masks with
| |
| getSQL | back to summary |
|---|---|
| public StringBuilder getSQL(StringBuilder builder, Expression[] list, int visible, int sqlFlags) Create the SQL snippet that describes this sort order. This is the SQL snippet that usually appears after the ORDER BY clause.
| |
| inverse | back to summary |
|---|---|
| public static int inverse(int sortTypeWithNull) | |
| sort | back to summary |
|---|---|
| public void sort(ArrayList<Value[]> rows) Sort a list of rows. | |
| sort | back to summary |
|---|---|
| public void sort(ArrayList<Value[]> rows, int fromInclusive, int toExclusive) Sort a list of rows using offset and limit. | |
| typeToString | back to summary |
|---|---|
| public static void typeToString(StringBuilder builder, int type) Appends type information (DESC, NULLS FIRST, NULLS LAST) to the specified statement builder.
| |