public class SortKey extends Object
TokenOrder
Constructor and Description |
---|
SortKey(String name)
Create a key using ascending order.
|
SortKey(String name,
TokenOrder order)
Create a key using the specified order.
|
Modifier and Type | Method and Description |
---|---|
static SortKey[] |
asc(String... names)
Create multiple ascending keys.
|
static SortKey |
asc(String name)
Create an ascending key.
|
static SortKey[] |
desc(String... names)
Create multiple descending keys.
|
static SortKey |
desc(String name)
Create a descending key.
|
boolean |
equals(Object o) |
String |
getName()
Get the field name associated with this key.
|
static String[] |
getNames(SortKey... sortKeys)
Extract the field names from several keys.
|
TokenOrder |
getOrder()
Get the ordering associated with this key.
|
static TokenOrder[] |
getOrders(SortKey... sortKeys)
Extract the orderings from several keys.
|
int |
hashCode() |
static SortKey[] |
makeSortKeys(TokenOrder order,
String... names)
Create multiple keys using the specified order.
|
static SortKey[] |
parseKey(String... keyExpressions)
Parse key expressions into
SortKey s. |
String |
toString()
Pretty-print this
SortKey . |
public SortKey(String name)
name
- Name of the key fieldpublic SortKey(String name, TokenOrder order)
name
- Name of the key fieldorder
- Order of the datapublic String getName()
public TokenOrder getOrder()
public String toString()
SortKey
.public static SortKey asc(String name)
name
- Name of the key fieldpublic static SortKey[] asc(String... names)
names
- Names of the key fieldspublic static SortKey desc(String name)
name
- Name of the key fieldpublic static SortKey[] desc(String... names)
names
- Names of the key fieldspublic static SortKey[] makeSortKeys(TokenOrder order, String... names)
order
- Ordering to use for the keysnames
- Names of the key fieldspublic static String[] getNames(SortKey... sortKeys)
sortKeys
- Keys from which to get the field namespublic static TokenOrder[] getOrders(SortKey... sortKeys)
sortKeys
- Keys from which to get the orderingspublic static SortKey[] parseKey(String... keyExpressions)
SortKey
s. A key expression consists of a field
name and optionally the sort order: either "asc" or "desc" for ascending and descending
respectively. Ascending is the default. Field names with embedded white space characters
can optionally use single or double quotes to surround the field name.
Examples:
keyExpressions
- list of expressions to parse into sort keysSortKey
instancesCopyright © 2016 Actian Corporation. All rights reserved.