public static enum SortedLists.KeyAbsentBehavior extends java.lang.Enum<SortedLists.KeyAbsentBehavior>
Enum Constant and Description |
---|
INVERTED_INSERTION_INDEX
Return
~insertionIndex , where insertionIndex is defined as the point at
which the key would be inserted into the list: the index of the next higher element in the
list, or list.size() if there is no such element. |
NEXT_HIGHER
Return the index of the next higher element in the list, or
list.size() if there is
no such element. |
NEXT_LOWER
Return the index of the next lower element in the list, or
-1 if there is no such
element. |
Modifier and Type | Method and Description |
---|---|
abstract int |
resultIndex(int higherIndex) |
static SortedLists.KeyAbsentBehavior |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static SortedLists.KeyAbsentBehavior[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SortedLists.KeyAbsentBehavior NEXT_LOWER
-1
if there is no such
element.public static final SortedLists.KeyAbsentBehavior NEXT_HIGHER
list.size()
if there is
no such element.public static final SortedLists.KeyAbsentBehavior INVERTED_INSERTION_INDEX
~insertionIndex
, where insertionIndex
is defined as the point at
which the key would be inserted into the list: the index of the next higher element in the
list, or list.size()
if there is no such element.
Note that the return value will be >= 0
if and only if there is an element of the
list that compares as equal to the key.
This is equivalent to the behavior of
Collections.binarySearch(List, Object)
when the key isn't present, since
~insertionIndex
is equal to -1 - insertionIndex
.
public static SortedLists.KeyAbsentBehavior[] values()
for (SortedLists.KeyAbsentBehavior c : SortedLists.KeyAbsentBehavior.values()) System.out.println(c);
public static SortedLists.KeyAbsentBehavior valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic abstract int resultIndex(int higherIndex)