|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.server.core.cursor.AbstractCursor<E>
org.apache.directory.server.core.cursor.ListCursor<E>
public 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(java.util.Comparator<E> comparator)
|
|
ListCursor(java.util.Comparator<E> comparator,
int start,
java.util.List<E> list)
|
|
ListCursor(java.util.Comparator<E> comparator,
int start,
java.util.List<E> list,
int end)
Creates a new ListCursor with lower (inclusive) and upper (exclusive) bounds. |
|
ListCursor(java.util.Comparator<E> comparator,
java.util.List<E> list)
|
|
ListCursor(java.util.Comparator<E> comparator,
java.util.List<E> list,
int end)
|
|
ListCursor(int start,
java.util.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,
java.util.List<E> list,
int end)
Creates a new ListCursor with lower (inclusive) and upper (exclusive) bounds. |
|
ListCursor(java.util.List<E> list)
Creates a new ListCursor without specific bounds: the bounds are acquired from the size of the list. |
|
ListCursor(java.util.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 Curser 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 Curser before the first element. |
boolean |
first()
Positions this Curser at the first element. |
E |
get()
Gets the object at the current position. |
boolean |
isAfterLast()
|
boolean |
isBeforeFirst()
|
boolean |
isElementReused()
Gets whether or not this Cursor will return the same element object instance on get() operations for any position of this Cursor. |
boolean |
isFirst()
|
boolean |
isLast()
|
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. |
Methods inherited from class org.apache.directory.server.core.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(java.util.Comparator<E> comparator, int start, java.util.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 indexpublic ListCursor(int start, java.util.List<E> list, int end)
start
- the lower bound indexlist
- the list this ListCursor operates onend
- the upper bound indexpublic ListCursor(java.util.List<E> list, int end)
list
- the backing for this ListCursorend
- the upper bound index representing the position after the
last elementpublic ListCursor(java.util.Comparator<E> comparator, java.util.List<E> list, int end)
public ListCursor(int start, java.util.List<E> list)
start
- the lower (inclusive) bound index: the position of the
first entrylist
- the backing for this ListCursorpublic ListCursor(java.util.Comparator<E> comparator, int start, java.util.List<E> list)
public ListCursor(java.util.List<E> list)
list
- the backing for this ListCursorpublic ListCursor(java.util.Comparator<E> comparator, java.util.List<E> list)
public ListCursor()
public ListCursor(java.util.Comparator<E> comparator)
Method Detail |
---|
public boolean available()
Cursor
public void before(E element) throws java.lang.Exception
Cursor
element
- the element to be positioned before
java.lang.IllegalStateException
- if the underlying list is not sorted
and/or a comparator is not provided.
java.lang.Exception
- with problems accessing the underlying btree
java.lang.UnsupportedOperationException
- if this method is not supportedpublic void after(E element) throws java.lang.Exception
Cursor
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 supportedpublic void beforeFirst() throws java.lang.Exception
Cursor
java.lang.Exception
- if there are problems positioning this cursor or if
this Cursor is closed
java.lang.UnsupportedOperationException
- if this method is not supportedpublic void afterLast() throws java.lang.Exception
Cursor
java.lang.Exception
- if there are problems positioning this Cursor or if
this Cursor is closed
java.lang.UnsupportedOperationException
- if this method is not supportedpublic boolean first() throws java.lang.Exception
Cursor
java.lang.Exception
- if there are problems positioning this Cursor or if
this Cursor is closed
java.lang.UnsupportedOperationException
- if this method is not supportedpublic boolean last() throws java.lang.Exception
Cursor
java.lang.Exception
- if there are problems positioning this Cursor or if
this Cursor is closed
java.lang.UnsupportedOperationException
- if this method is not supportedpublic boolean isFirst() throws java.lang.Exception
java.lang.Exception
public boolean isLast() throws java.lang.Exception
java.lang.Exception
public boolean isAfterLast() throws java.lang.Exception
java.lang.Exception
public boolean isBeforeFirst() throws java.lang.Exception
java.lang.Exception
public boolean previous() throws java.lang.Exception
Cursor
java.lang.Exception
- if there are problems advancing to the next position
java.lang.UnsupportedOperationException
- if this method is not supportedpublic boolean next() throws java.lang.Exception
Cursor
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 supportedpublic E get() throws java.lang.Exception
Cursor
java.lang.Exception
- if the object at this Cursor's current position
cannot be retrieved, or if this Cursor is closedpublic boolean isElementReused()
Cursor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |