public class IndexCursorAdaptor<K,O,ID> extends Object implements IndexCursor<K,O,ID>
Constructor and Description |
---|
IndexCursorAdaptor(org.apache.directory.shared.ldap.cursor.Cursor<Tuple> wrappedCursor,
boolean forwardIndex)
Creates an IndexCursorAdaptor which wraps and adapts a Cursor from a table to
one which returns an IndexEntry.
|
Modifier and Type | Method and Description |
---|---|
void |
after(IndexEntry<K,O,ID> element) |
void |
afterLast() |
void |
afterValue(ID id,
K key)
An alternative to calling after(IndexEntry) which often may require
wrapping an id and value in a newly created IndexEntry object that may
be an unnecessary object creation.
|
boolean |
available() |
void |
before(IndexEntry<K,O,ID> element) |
void |
beforeFirst() |
void |
beforeValue(ID id,
K key)
An alternative to calling before(IndexEntry) which often may require
wrapping an id and value in a newly created IndexEntry object that may
be an unnecessary object creation.
|
void |
close() |
void |
close(Exception reason) |
boolean |
first() |
IndexEntry<K,O,ID> |
get() |
boolean |
isClosed() |
boolean |
isElementReused() |
Iterator<IndexEntry<K,O,ID>> |
iterator() |
boolean |
last() |
boolean |
next() |
boolean |
previous() |
void |
setClosureMonitor(org.apache.directory.shared.ldap.cursor.ClosureMonitor monitor) |
public IndexCursorAdaptor(org.apache.directory.shared.ldap.cursor.Cursor<Tuple> wrappedCursor, boolean forwardIndex)
wrappedCursor
- the Cursor being adaptedforwardIndex
- true for a cursor over a forward index, false for
one over a reverse indexpublic boolean available()
available
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
public void beforeValue(ID id, K key) throws Exception
IndexCursor
beforeValue
in interface IndexCursor<K,O,ID>
id
- the id for the entrykey
- the value to advance just beforeException
- if there are faults performing this operationpublic void afterValue(ID id, K key) throws Exception
IndexCursor
afterValue
in interface IndexCursor<K,O,ID>
id
- the id for the entrykey
- the value to advance just after the last valueException
- if there are faults performing this operationpublic void before(IndexEntry<K,O,ID> element) throws Exception
before
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
public void after(IndexEntry<K,O,ID> element) throws Exception
after
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
public void beforeFirst() throws Exception
beforeFirst
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
public void afterLast() throws Exception
afterLast
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
public boolean first() throws Exception
first
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
public boolean last() throws Exception
last
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
public boolean isClosed() throws Exception
isClosed
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
public boolean previous() throws Exception
previous
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
public boolean next() throws Exception
next
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
public IndexEntry<K,O,ID> get() throws Exception
get
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
public boolean isElementReused()
isElementReused
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
public final void setClosureMonitor(org.apache.directory.shared.ldap.cursor.ClosureMonitor monitor)
setClosureMonitor
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
public void close() throws Exception
close
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
public void close(Exception reason) throws Exception
close
in interface org.apache.directory.shared.ldap.cursor.Cursor<IndexEntry<K,O,ID>>
Exception
Copyright © 2003-2012 Apache Software Foundation. All Rights Reserved.