/** * Moves the Cursor to find the first available entry less than the given * key. * * <p>Ownership of the key instance transfers to the Cursor, and it must * not be modified after calling this method. * * @return {@link LockResult#UNOWNED UNOWNED}, {@link LockResult#ACQUIRED * ACQUIRED}, {@link LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws NullPointerException if key is null */ public default LockResult findLt(byte[] key) throws IOException { ViewUtils.findNoLock(this, key); return previous(); }
/** * Moves the Cursor to find the first available entry greater than the * given key. * * <p>Ownership of the key instance transfers to the Cursor, and it must * not be modified after calling this method. * * @return {@link LockResult#UNOWNED UNOWNED}, {@link LockResult#ACQUIRED * ACQUIRED}, {@link LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws NullPointerException if key is null */ public default LockResult findGt(byte[] key) throws IOException { ViewUtils.findNoLock(this, key); return next(); }
/** * Moves the Cursor to find the first available entry greater than the * given key. * * <p>Ownership of the key instance transfers to the Cursor, and it must * not be modified after calling this method. * * @return {@link LockResult#UNOWNED UNOWNED}, {@link LockResult#ACQUIRED * ACQUIRED}, {@link LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws NullPointerException if key is null */ public default LockResult findGt(byte[] key) throws IOException { ViewUtils.findNoLock(this, key); return next(); }
/** * Moves the Cursor to find the first available entry less than the given * key. * * <p>Ownership of the key instance transfers to the Cursor, and it must * not be modified after calling this method. * * @return {@link LockResult#UNOWNED UNOWNED}, {@link LockResult#ACQUIRED * ACQUIRED}, {@link LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws NullPointerException if key is null */ public default LockResult findLt(byte[] key) throws IOException { ViewUtils.findNoLock(this, key); return previous(); }
/** * Moves the Cursor to find the first available entry greater than the * given key. * * <p>Ownership of the key instance transfers to the Cursor, and it must * not be modified after calling this method. * * @return {@link LockResult#UNOWNED UNOWNED}, {@link LockResult#ACQUIRED * ACQUIRED}, {@link LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws NullPointerException if key is null */ public default LockResult findGt(byte[] key) throws IOException { ViewUtils.findNoLock(this, key); return next(); }
/** * Moves the Cursor to find the first available entry less than the given * key. * * <p>Ownership of the key instance transfers to the Cursor, and it must * not be modified after calling this method. * * @return {@link LockResult#UNOWNED UNOWNED}, {@link LockResult#ACQUIRED * ACQUIRED}, {@link LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws NullPointerException if key is null */ public default LockResult findLt(byte[] key) throws IOException { ViewUtils.findNoLock(this, key); return previous(); }
@Override public LockResult find(byte[] key) throws IOException { if (mView.inRange(key)) { LockResult result = mSource.find(key); mOutOfBounds = false; return result; } else { mOutOfBounds = true; ViewUtils.findNoLock(mSource, key); return LockResult.UNOWNED; } }