|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.server.core.partition.impl.btree.IndexCursorAdaptor<K,O>
public class IndexCursorAdaptor<K,O>
A Cursor which adapts an underlying Tuple based Cursor to one which returns IndexEntry objects rather than tuples.
| Constructor Summary | |
|---|---|
IndexCursorAdaptor(Cursor<Tuple> wrappedCursor,
boolean forwardIndex)
Creates an IndexCursorAdaptor which wraps and adapts a Cursor from a table to one which returns an IndexEntry. |
|
| Method Summary | |
|---|---|
void |
after(IndexEntry<K,O> element)
Prepares this Cursor, so a subsequent call to Cursor#previous() with a true return value, will have positioned the Cursor on a dataset element equal to or less than the element argument but not greater. |
void |
afterLast()
Positions this Curser after the last element. |
void |
afterValue(java.lang.Long 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()
Determines whether or not a call to get() will succeed. |
void |
before(IndexEntry<K,O> element)
Prepares this Cursor, so a subsequent call to Cursor#next() with a true return value, will have positioned the Cursor on a dataset element equal to or less than the element argument but not greater. |
void |
beforeFirst()
Positions this Curser before the first element. |
void |
beforeValue(java.lang.Long 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()
Closes this Cursor and frees any resources it my have allocated. |
void |
close(java.lang.Exception reason)
Closes this Cursor and frees any resources it my have allocated. |
boolean |
first()
Positions this Curser at the first element. |
IndexEntry<K,O> |
get()
Gets the object at the current position. |
boolean |
isClosed()
Checks if this Curser is closed. |
boolean |
isElementReused()
Gets whether or not this Cursor will return the same element object instance on get() operations for any position of this Cursor. |
java.util.Iterator<IndexEntry<K,O>> |
iterator()
|
boolean |
last()
Positions this Curser at the last element. |
boolean |
next()
Advances this Cursor to the next position. |
boolean |
previous()
Advances this Cursor to the previous position. |
void |
setClosureMonitor(ClosureMonitor monitor)
Sets a non-null closure monitor to associate with this Cursor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IndexCursorAdaptor(Cursor<Tuple> wrappedCursor,
boolean forwardIndex)
wrappedCursor - the Cursor being adaptedforwardIndex - true for a cursor over a forward index, false for
one over a reverse index| Method Detail |
|---|
public boolean available()
Cursor
available in interface Cursor<IndexEntry<K,O>>
public void beforeValue(java.lang.Long id,
K key)
throws java.lang.Exception
IndexCursor
beforeValue in interface IndexCursor<K,O>id - the Long id for the entrykey - the value to advance just before
java.lang.Exception - if there are faults peforming this operation
public void afterValue(java.lang.Long id,
K key)
throws java.lang.Exception
IndexCursor
afterValue in interface IndexCursor<K,O>id - the Long id for the entrykey - the value to advance just after the last value
java.lang.Exception - if there are faults peforming this operation
public void before(IndexEntry<K,O> element)
throws java.lang.Exception
Cursor
before in interface Cursor<IndexEntry<K,O>>element - the element to be positioned before
java.lang.Exception - with problems accessing the underlying btree
java.lang.UnsupportedOperationException - if this method is not supported
public void after(IndexEntry<K,O> element)
throws java.lang.Exception
Cursor
after in interface Cursor<IndexEntry<K,O>>element - the element to be positioned after
java.lang.Exception - if there are problems positioning this cursor or if
this Cursor is closed
java.lang.UnsupportedOperationException - if this method is not supported
public void beforeFirst()
throws java.lang.Exception
Cursor
beforeFirst in interface Cursor<IndexEntry<K,O>>java.lang.Exception - if there are problems positioning this cursor or if
this Cursor is closed
java.lang.UnsupportedOperationException - if this method is not supported
public void afterLast()
throws java.lang.Exception
Cursor
afterLast in interface Cursor<IndexEntry<K,O>>java.lang.Exception - if there are problems positioning this Cursor or if
this Cursor is closed
java.lang.UnsupportedOperationException - if this method is not supported
public boolean first()
throws java.lang.Exception
Cursor
first in interface Cursor<IndexEntry<K,O>>java.lang.Exception - if there are problems positioning this Cursor or if
this Cursor is closed
java.lang.UnsupportedOperationException - if this method is not supported
public boolean last()
throws java.lang.Exception
Cursor
last in interface Cursor<IndexEntry<K,O>>java.lang.Exception - if there are problems positioning this Cursor or if
this Cursor is closed
java.lang.UnsupportedOperationException - if this method is not supported
public boolean isClosed()
throws java.lang.Exception
Cursor
isClosed in interface Cursor<IndexEntry<K,O>>java.lang.Exception - if there are problems determining the cursor's closed state
java.lang.UnsupportedOperationException - if this method is not supported
public boolean previous()
throws java.lang.Exception
Cursor
previous in interface Cursor<IndexEntry<K,O>>java.lang.Exception - if there are problems advancing to the next position
java.lang.UnsupportedOperationException - if this method is not supported
public boolean next()
throws java.lang.Exception
Cursor
next in interface Cursor<IndexEntry<K,O>>java.lang.Exception - if there are problems advancing to this Cursor to
the next position, or if this Cursor is closed
java.lang.UnsupportedOperationException - if this method is not supported
public IndexEntry<K,O> get()
throws java.lang.Exception
Cursor
get in interface Cursor<IndexEntry<K,O>>java.lang.Exception - if the object at this Cursor's current position
cannot be retrieved, or if this Cursor is closedpublic boolean isElementReused()
Cursor
isElementReused in interface Cursor<IndexEntry<K,O>>public final void setClosureMonitor(ClosureMonitor monitor)
Cursor
setClosureMonitor in interface Cursor<IndexEntry<K,O>>monitor - the monitor to use for detecting Cursor close events
public void close()
throws java.lang.Exception
Cursor
close in interface Cursor<IndexEntry<K,O>>java.lang.Exception - if for some reason this Cursor could not be closed
public void close(java.lang.Exception reason)
throws java.lang.Exception
Cursor
close in interface Cursor<IndexEntry<K,O>>reason - exception thrown when this Cursor is accessed after close
java.lang.Exception - if for some reason this Cursor could not be closedpublic java.util.Iterator<IndexEntry<K,O>> iterator()
iterator in interface java.lang.Iterable<IndexEntry<K,O>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||