Package org.h2.mode
Enum DefaultNullOrdering
- java.lang.Object
-
- java.lang.Enum<DefaultNullOrdering>
-
- org.h2.mode.DefaultNullOrdering
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DefaultNullOrdering>
public enum DefaultNullOrdering extends java.lang.Enum<DefaultNullOrdering>
Default ordering of NULL values.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FIRST
NULL values are sorted before other values, no matter if ascending or descending order is used.HIGH
NULL values are considered as larger than other values during sorting.LAST
NULL values are sorted after other values, no matter if ascending or descending order is used.LOW
NULL values are considered as smaller than other values during sorting.
-
Field Summary
Fields Modifier and Type Field Description private int
defaultAscNulls
private int
defaultDescNulls
private int
nullAsc
private int
nullDesc
private static DefaultNullOrdering[]
VALUES
-
Constructor Summary
Constructors Modifier Constructor Description private
DefaultNullOrdering(int defaultAscNulls, int defaultDescNulls)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
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
valueOf(java.lang.String name)
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 Detail
-
LOW
public static final DefaultNullOrdering LOW
NULL values are considered as smaller than other values during sorting.
-
HIGH
public static final DefaultNullOrdering HIGH
NULL values are considered as larger than other values during sorting.
-
FIRST
public static final DefaultNullOrdering FIRST
NULL values are sorted before other values, no matter if ascending or descending order is used.
-
LAST
public static final DefaultNullOrdering LAST
NULL values are sorted after other values, no matter if ascending or descending order is used.
-
-
Field Detail
-
VALUES
private static final DefaultNullOrdering[] VALUES
-
defaultAscNulls
private final int defaultAscNulls
-
defaultDescNulls
private final int defaultDescNulls
-
nullAsc
private final int nullAsc
-
nullDesc
private final int nullDesc
-
-
Method Detail
-
values
public static DefaultNullOrdering[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DefaultNullOrdering c : DefaultNullOrdering.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DefaultNullOrdering valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
valueOf
public static DefaultNullOrdering valueOf(int ordinal)
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:
Enum.ordinal()
-
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)
-
-