Performs generalized tree traversal. The direction value indicates whether to traverse forward or backward in collation sequence, whether to descend to child nodes, and whether the key being sought must be strictly greater than or less then the supplied key.
The direction
value must be one of:
- Key.GT:
- Find the next key that is strictly greater than the supplied key. If there is none, return false.
- Key.GTEQ:
- If the supplied key exists in the database, return that key; otherwise find the next greater key and return it.
- Key.EQ:
- Return
true
iff the specified key exists in the database. Does not update the Key. - Key.LT:
- Find the next key that is strictly less than the supplied key. If there is none, return false.
- Key.LTEQ:
- If the supplied key exists in the database, return that key; otherwise find the next smaller key and return it.
@param direction One of Key.GT, Key.GTEQ, Key.EQ, Key.LT or Key.LTEQ.
@param deep Determines whether the result should represent the next (or previous) physical key in the
Tree
or should be restricted to just the logical siblings of the current key. (See
Logical Key Children and Siblings).
@return
true
if there is a key to traverse to, else
false
.
@throws PersistitException