Package org.h2.mode
Enum DefaultNullOrdering
- All Implemented Interfaces:
Serializable
,Comparable<DefaultNullOrdering>
,java.lang.constant.Constable
Default ordering of NULL values.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionNULL values are sorted before other values, no matter if ascending or descending order is used.NULL values are considered as larger than other values during sorting.NULL values are sorted after other values, no matter if ascending or descending order is used.NULL values are considered as smaller than other values during sorting. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final int
private final int
private final int
private static final DefaultNullOrdering[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
DefaultNullOrdering
(int defaultAscNulls, int defaultDescNulls) -
Method Summary
Modifier and TypeMethodDescriptionint
addExplicitNullOrdering
(int sortType) Returns a sort type bit mask withSortOrder.NULLS_FIRST
orSortOrder.NULLS_LAST
explicitly setint
compareNull
(boolean aNull, int sortType) Compare two expressions where one of them is NULL.static DefaultNullOrdering
valueOf
(int ordinal) Returns default ordering of NULL values for the specified ordinal number.static DefaultNullOrdering
Returns the enum constant of this type with the specified name.static DefaultNullOrdering[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
LOW
NULL values are considered as smaller than other values during sorting. -
HIGH
NULL values are considered as larger than other values during sorting. -
FIRST
NULL values are sorted before other values, no matter if ascending or descending order is used. -
LAST
NULL values are sorted after other values, no matter if ascending or descending order is used.
-
-
Field Details
-
VALUES
-
defaultAscNulls
private final int defaultAscNulls -
defaultDescNulls
private final int defaultDescNulls -
nullAsc
private final int nullAsc -
nullDesc
private final int nullDesc
-
-
Constructor Details
-
DefaultNullOrdering
private DefaultNullOrdering(int defaultAscNulls, int defaultDescNulls)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
valueOf
Returns default ordering of NULL values for the specified ordinal number.- Parameters:
ordinal
- ordinal number- Returns:
- default ordering of NULL values for the specified ordinal number
- See Also:
-
addExplicitNullOrdering
public int addExplicitNullOrdering(int sortType) Returns a sort type bit mask withSortOrder.NULLS_FIRST
orSortOrder.NULLS_LAST
explicitly set- Parameters:
sortType
- sort type bit mask- Returns:
- bit mask with
SortOrder.NULLS_FIRST
orSortOrder.NULLS_LAST
explicitly set
-
compareNull
public int compareNull(boolean aNull, int sortType) Compare two expressions where one of them is NULL.- Parameters:
aNull
- whether the first expression is nullsortType
- the sort bit mask to use- Returns:
- the result of the comparison (-1 meaning the first expression should appear before the second, 0 if they are equal)
-