public enum KeyRangeType extends java.lang.Enum<KeyRangeType>
The terminology used in this class is adapted from Google Guava's ranges. Refer to the Ranges Explained wiki page for more information. LmddJava prepends either "FORWARD" or "BACKWARD" to denote the iterator order.
In the examples below, it is assumed the table has keys 2, 4, 6 and 8.
Enum Constant and Description |
---|
BACKWARD_ALL
Start on the last key and iterate backward until no keys remain.
|
BACKWARD_AT_LEAST
Start on the passed key (or the first key immediately preceding it) and
iterate backward until no keys remain.
|
BACKWARD_AT_MOST
Start on the last key and iterate backward until a key equal to it (or the
first key immediately preceding it it) is reached.
|
BACKWARD_CLOSED
Iterate backward between the passed keys, matching on the first keys
directly equal to the passed key (or immediately preceding it in the case
of the "start" key, or immediately following it in the case of the "stop"
key).
|
BACKWARD_CLOSED_OPEN
Iterate backward between the passed keys, matching on the first keys
directly equal to the passed key (or immediately preceding it in the case
of the "start" key, or immediately following it in the case of the "stop"
key).
|
BACKWARD_GREATER_THAN
Start immediate prior to the passed key (but not equal to it) and iterate
backward until no keys remain.
|
BACKWARD_LESS_THAN
Start on the last key and iterate backward until the last key greater than
the passed "stop" key is reached.
|
BACKWARD_OPEN
Iterate backward between the passed keys, but do not return the passed
keys.
|
BACKWARD_OPEN_CLOSED
Iterate backward between the passed keys.
|
FORWARD_ALL
Starting on the first key and iterate forward until no keys remain.
|
FORWARD_AT_LEAST
Start on the passed key (or the first key immediately after it) and
iterate forward until no keys remain.
|
FORWARD_AT_MOST
Start on the first key and iterate forward until a key equal to it (or the
first key immediately after it) is reached.
|
FORWARD_CLOSED
Iterate forward between the passed keys, matching on the first keys
directly equal to the passed key (or immediately following it in the case
of the "start" key, or immediately preceding it in the case of the "stop"
key).
|
FORWARD_CLOSED_OPEN
Iterate forward between the passed keys, matching on the first keys
directly equal to the passed key (or immediately following it in the case
of the "start" key, or immediately preceding it in the case of the "stop"
key).
|
FORWARD_GREATER_THAN
Start after the passed key (but not equal to it) and iterate forward until
no keys remain.
|
FORWARD_LESS_THAN
Start on the first key and iterate forward until a key the passed key has
been reached (but do not return that key).
|
FORWARD_OPEN
Iterate forward between the passed keys but not equal to either of them.
|
FORWARD_OPEN_CLOSED
Iterate forward between the passed keys.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isDirectionForward()
Whether the key space is iterated in the order provided by LMDB.
|
boolean |
isStartKeyRequired()
Whether the iteration requires a "start" key.
|
boolean |
isStopKeyRequired()
Whether the iteration requires a "stop" key.
|
static KeyRangeType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static KeyRangeType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final KeyRangeType FORWARD_ALL
The "start" and "stop" values are ignored.
In our example, the returned keys would be 2, 4, 6 and 8.
public static final KeyRangeType FORWARD_AT_LEAST
The "start" value is required. The "stop" value is ignored.
In our example and with a passed search key of 5, the returned keys would be 6 and 8. With a passed key of 6, the returned keys would be 6 and 8.
public static final KeyRangeType FORWARD_AT_MOST
The "stop" value is required. The "start" value is ignored.
In our example and with a passed search key of 5, the returned keys would be 2 and 4. With a passed key of 6, the returned keys would be 2, 4 and 6.
public static final KeyRangeType FORWARD_CLOSED
The "start" and "stop" values are both required.
In our example and with a passed search range of 3 - 7, the returned keys would be 4 and 6. With a range of 2 - 6, the keys would be 2, 4 and 6.
public static final KeyRangeType FORWARD_CLOSED_OPEN
The "start" and "stop" values are both required.
In our example and with a passed search range of 3 - 8, the returned keys would be 4 and 6. With a range of 2 - 6, the keys would be 2 and 4.
public static final KeyRangeType FORWARD_GREATER_THAN
The "start" value is required. The "stop" value is ignored.
In our example and with a passed search key of 4, the returned keys would be 6 and 8. With a passed key of 3, the returned keys would be 4, 6 and 8.
public static final KeyRangeType FORWARD_LESS_THAN
The "stop" value is required. The "start" value is ignored.
In our example and with a passed search key of 5, the returned keys would be 2 and 4. With a passed key of 8, the returned keys would be 2, 4 and 6.
public static final KeyRangeType FORWARD_OPEN
The "start" and "stop" values are both required.
In our example and with a passed search range of 3 - 7, the returned keys would be 4 and 6. With a range of 2 - 8, the key would be 4 and 6.
public static final KeyRangeType FORWARD_OPEN_CLOSED
The "start" and "stop" values are both required.
In our example and with a passed search range of 3 - 8, the returned keys would be 4, 6 and 8. With a range of 2 - 6, the keys would be 4 and 6.
public static final KeyRangeType BACKWARD_ALL
The "start" and "stop" values are ignored.
In our example, the returned keys would be 8, 6, 4 and 2.
public static final KeyRangeType BACKWARD_AT_LEAST
The "start" value is required. The "stop" value is ignored.
In our example and with a passed search key of 5, the returned keys would be 4 and 2. With a passed key of 6, the returned keys would be 6, 4 and 2. With a passed key of 9, the returned keys would be 8, 6, 4 and 2.
public static final KeyRangeType BACKWARD_AT_MOST
The "stop" value is required. The "start" value is ignored.
In our example and with a passed search key of 5, the returned keys would be 8 and 6. With a passed key of 6, the returned keys would be 8 and 6.
public static final KeyRangeType BACKWARD_CLOSED
The "start" and "stop" values are both required.
In our example and with a passed search range of 7 - 3, the returned keys would be 6 and 4. With a range of 6 - 2, the keys would be 6, 4 and 2. With a range of 9 - 3, the returned keys would be 8, 6 and 4.
public static final KeyRangeType BACKWARD_CLOSED_OPEN
The "start" and "stop" values are both required.
In our example and with a passed search range of 8 - 3, the returned keys would be 8, 6 and 4. With a range of 7 - 2, the keys would be 6 and 4. With a range of 9 - 3, the keys would be 8, 6 and 4.
public static final KeyRangeType BACKWARD_GREATER_THAN
The "start" value is required. The "stop" value is ignored.
In our example and with a passed search key of 6, the returned keys would be 4 and 2. With a passed key of 7, the returned keys would be 6, 4 and 2. With a passed key of 9, the returned keys would be 8, 6, 4 and 2.
public static final KeyRangeType BACKWARD_LESS_THAN
The "stop" value is required. The "start" value is ignored.
In our example and with a passed search key of 5, the returned keys would be 8 and 6. With a passed key of 2, the returned keys would be 8, 6 and 4
public static final KeyRangeType BACKWARD_OPEN
The "start" and "stop" values are both required.
In our example and with a passed search range of 7 - 2, the returned keys would be 6 and 4. With a range of 8 - 1, the keys would be 6, 4 and 2. With a range of 9 - 4, the keys would be 8 and 6.
public static final KeyRangeType BACKWARD_OPEN_CLOSED
The "start" and "stop" values are both required.
In our example and with a passed search range of 7 - 2, the returned keys would be 6, 4 and 2. With a range of 8 - 4, the keys would be 6 and 4. With a range of 9 - 4, the keys would be 8, 6 and 4.
public static KeyRangeType[] values()
for (KeyRangeType c : KeyRangeType.values()) System.out.println(c);
public static KeyRangeType 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 boolean isDirectionForward()
public boolean isStartKeyRequired()
public boolean isStopKeyRequired()
Copyright © 2016–2018 The LmdbJava Open Source Project. All rights reserved.