public enum SortOrder extends Enum<SortOrder> implements SimpleDatatype<String>
Enum Constant and Description |
---|
ASCENDING
Indicating that values are in increasing order (e.g.
|
DESCENDING
Indicating that values are in decreasing order (e.g.
|
Modifier and Type | Field and Description |
---|---|
private String |
title |
private String |
value |
Modifier and Type | Method and Description |
---|---|
int |
adjustSignum(int compareTo)
Adjusts the
Math.signum(double) of a compare to result with this
SortOrder to the semantic of Collections.sort(java.util.List, java.util.Comparator) . |
String |
getValue()
This method returns the raw value of this datatype.
|
String |
toString()
|
static SortOrder |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SortOrder[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SortOrder ASCENDING
public static final SortOrder DESCENDING
public static SortOrder[] values()
for (SortOrder c : SortOrder.values()) System.out.println(c);
public static SortOrder valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getValue()
SimpleDatatype
String
, Character
, Boolean
, any type of Number
, any type of java.time.LocalDate
, etc.).getValue
in interface AttributeReadValue<String>
getValue
in interface SimpleDatatype<String>
public int adjustSignum(int compareTo)
Math.signum(double)
of a compare to
result with this
SortOrder
to the semantic of Collections.sort(java.util.List, java.util.Comparator)
. In
other words *compareTo
- is the result of a regular compare to
operation.compareTo
) for ASCENDING
and the negation ( -compareTo
) otherwise
(for DESCENDING
).public String toString()
Datatype
String
representation of this Datatype
. While the general contract of
Object.toString()
is very weak and mainly used for debugging, the contract here is very strong. The
returned String
has to be suitable for end-users and official output to any kind of sink. NlsMessage
for
this purpose and implement NlsObject
if you want to support I18N/L10N.Copyright © 2001–2016 mmm-Team. All rights reserved.