|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.shared.ldap.model.cursor.AbstractCursor<E>
org.apache.directory.shared.ldap.model.cursor.ListCursor<E>
E - The element on which this cursor will iteratepublic class ListCursor<E>
A simple implementation of a Cursor on a List. Optionally, the
Cursor may be limited to a specific range within the list.
| Constructor Summary | |
|---|---|
ListCursor()
Creates a new ListCursor without any elements. |
|
ListCursor(Comparator<E> comparator)
Creates a new ListCursor without any elements. |
|
ListCursor(Comparator<E> comparator,
int start,
List<E> list)
Creates a new ListCursor with a lower (inclusive) bound: the upper (exclusive) bound is the size of the list. |
|
ListCursor(Comparator<E> comparator,
int start,
List<E> list,
int end)
Creates a new ListCursor with lower (inclusive) and upper (exclusive) bounds. |
|
ListCursor(Comparator<E> comparator,
List<E> list)
Creates a new ListCursor without specific bounds: the bounds are acquired from the size of the list. |
|
ListCursor(Comparator<E> comparator,
List<E> list,
int end)
Creates a new ListCursor with a specific upper (exclusive) bound: the lower (inclusive) bound defaults to 0. |
|
ListCursor(int start,
List<E> list)
Creates a new ListCursor with a lower (inclusive) bound: the upper (exclusive) bound is the size of the list. |
|
ListCursor(int start,
List<E> list,
int end)
Creates a new ListCursor with lower (inclusive) and upper (exclusive) bounds. |
|
ListCursor(List<E> list)
Creates a new ListCursor without specific bounds: the bounds are acquired from the size of the list. |
|
ListCursor(List<E> list,
int end)
Creates a new ListCursor with a specific upper (exclusive) bound: the lower (inclusive) bound defaults to 0. |
|
| Method Summary | |
|---|---|
void |
after(E 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 Cursor after the last element. |
boolean |
available()
Determines whether or not a call to get() will succeed. |
void |
before(E 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 Cursor before the first element. |
boolean |
first()
Positions this Cursor at the first element. |
E |
get()
Gets the object at the current position. |
boolean |
isAfterLast()
Is this Cursor positioned after the last element. |
boolean |
isBeforeFirst()
Is this Cursor positioned before the first element. |
boolean |
isFirst()
Is this Cursor positioned at the first element. |
boolean |
isLast()
Is this Cursor positioned at the last element. |
boolean |
last()
Positions this Cursor at the last element. |
boolean |
next()
Advances this Cursor to the next position. |
boolean |
previous()
Advances this Cursor to the previous position. |
| Methods inherited from class org.apache.directory.shared.ldap.model.cursor.AbstractCursor |
|---|
checkNotClosed, close, close, isClosed, iterator, setClosureMonitor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListCursor(Comparator<E> comparator,
int start,
List<E> list,
int end)
comparator - an optional comparator to use for orderingstart - the lower bound indexlist - the list this ListCursor operates onend - the upper bound index
public ListCursor(int start,
List<E> list,
int end)
start - the lower bound indexlist - the list this ListCursor operates onend - the upper bound index
public ListCursor(List<E> list,
int end)
list - the backing for this ListCursorend - the upper bound index representing the position after the
last element
public ListCursor(Comparator<E> comparator,
List<E> list,
int end)
comparator - The comparator to use for the list - the backing for this ListCursorend - the upper bound index representing the position after the
last element
public ListCursor(int start,
List<E> list)
start - the lower (inclusive) bound index: the position of the
first entrylist - the backing for this ListCursor
public ListCursor(Comparator<E> comparator,
int start,
List<E> list)
comparator - The comparator to use for the start - the lower (inclusive) bound index: the position of the
first entrylist - the backing for this ListCursorpublic ListCursor(List<E> list)
list - the backing for this ListCursor
public ListCursor(Comparator<E> comparator,
List<E> list)
comparator - The comparator to use for the list - the backing for this ListCursorpublic ListCursor()
public ListCursor(Comparator<E> comparator)
comparator - The comparator to use for the | Method Detail |
|---|
public boolean available()
public void before(E element)
throws Exception
element - the element to be positioned before
Exception - with problems accessing the underlying btree
public void after(E element)
throws Exception
element - the element to be positioned after
Exception - if there are problems positioning this cursor or if
this Cursor is closed
public void beforeFirst()
throws Exception
Exception - if there are problems positioning this cursor or if
this Cursor is closed
public void afterLast()
throws Exception
Exception - if there are problems positioning this Cursor or if
this Cursor is closed
public boolean first()
throws Exception
Exception - if there are problems positioning this Cursor or if
this Cursor is closed
public boolean last()
throws Exception
Exception - if there are problems positioning this Cursor or if
this Cursor is closed
public boolean isFirst()
throws Exception
isFirst in interface Cursor<E>isFirst in class AbstractCursor<E>Exception - if there are problems querying the position of this Cursor
or if this Cursor is closed
public boolean isLast()
throws Exception
isLast in interface Cursor<E>isLast in class AbstractCursor<E>Exception - if there are problems querying the position of this Cursor
or if this Cursor is closed
public boolean isAfterLast()
throws Exception
isAfterLast in interface Cursor<E>isAfterLast in class AbstractCursor<E>Exception - if there are problems querying the position of this Cursor
or if this Cursor is closed
public boolean isBeforeFirst()
throws Exception
isBeforeFirst in interface Cursor<E>isBeforeFirst in class AbstractCursor<E>Exception - if there are problems querying the position of this Cursor
or if this Cursor is closed
public boolean previous()
throws Exception
Exception - if there are problems advancing to the next position
public boolean next()
throws Exception
Exception - if there are problems advancing to this Cursor to
the next position, or if this Cursor is closed
public E get()
throws Exception
Exception - if the object at this Cursor's current position
cannot be retrieved, or if this Cursor is closed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||