public class KeyTupleBTreeCursor<K,V>
extends org.apache.directory.api.ldap.model.cursor.AbstractCursor<org.apache.directory.api.ldap.model.cursor.Tuple<K,V>>
| Modifier and Type | Field and Description |
|---|---|
private jdbm.helper.TupleBrowser<K,V> |
browser |
private jdbm.btree.BTree |
btree |
private java.util.Comparator<V> |
comparator |
private static boolean |
IS_DEBUG
Speedup for logs
|
private K |
key |
private static org.slf4j.Logger |
LOG_CURSOR
A dedicated log for cursors
|
private org.apache.directory.api.ldap.model.cursor.Tuple<K,V> |
returnedTuple |
private boolean |
valueAvailable |
private jdbm.helper.Tuple<K,V> |
valueTuple |
| Constructor and Description |
|---|
KeyTupleBTreeCursor(jdbm.btree.BTree btree,
K key,
java.util.Comparator<V> comparator)
Creates a Cursor over the tuples of a JDBM BTree.
|
| Modifier and Type | Method and Description |
|---|---|
void |
after(org.apache.directory.api.ldap.model.cursor.Tuple<K,V> element) |
void |
afterKey(K key) |
void |
afterLast() |
void |
afterValue(K key,
V value) |
boolean |
available() |
void |
before(org.apache.directory.api.ldap.model.cursor.Tuple<K,V> element)
Positions this Cursor over the same keys before the value of the
supplied valueTuple.
|
void |
beforeFirst() |
void |
beforeKey(K key) |
void |
beforeValue(K key,
V value) |
private void |
clearValue() |
void |
close() |
void |
close(java.lang.Exception cause) |
boolean |
first() |
org.apache.directory.api.ldap.model.cursor.Tuple<K,V> |
get() |
boolean |
last() |
boolean |
next() |
boolean |
previous() |
checkNotClosed, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, iterator, setClosureMonitor, toStringprivate static final org.slf4j.Logger LOG_CURSOR
private static final boolean IS_DEBUG
private final java.util.Comparator<V> comparator
private final jdbm.btree.BTree btree
private final K key
private boolean valueAvailable
public KeyTupleBTreeCursor(jdbm.btree.BTree btree,
K key,
java.util.Comparator<V> comparator)
throws java.lang.Exception
btree - the JDBM BTree to build a Cursor overkey - the constant key for which values are returnedcomparator - the Comparator used to determine key orderingjava.lang.Exception - of there are problems accessing the BTreeprivate void clearValue()
public boolean available()
public void beforeKey(K key) throws java.lang.Exception
java.lang.Exceptionpublic void afterKey(K key) throws java.lang.Exception
java.lang.Exceptionpublic void beforeValue(K key, V value) throws java.lang.Exception
java.lang.Exceptionpublic void afterValue(K key, V value) throws org.apache.directory.api.ldap.model.exception.LdapException, org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic void before(org.apache.directory.api.ldap.model.cursor.Tuple<K,V> element) throws org.apache.directory.api.ldap.model.exception.LdapException, org.apache.directory.api.ldap.model.cursor.CursorException
element - the valueTuple who's value is used to position this Cursorjava.lang.Exception - if there are failures to position the Cursororg.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic void after(org.apache.directory.api.ldap.model.cursor.Tuple<K,V> element) throws org.apache.directory.api.ldap.model.exception.LdapException, org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic void beforeFirst()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic void afterLast()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic boolean first()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic boolean last()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic boolean previous()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic boolean next()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic org.apache.directory.api.ldap.model.cursor.Tuple<K,V> get() throws org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.cursor.CursorExceptionpublic void close()
public void close(java.lang.Exception cause)