E - The element on which this cursor will iteratepublic class SetCursor<E> extends AbstractCursor<E>
Set. Optionally, the
Cursor may be limited to a specific range within the list.| Modifier and Type | Field and Description |
|---|---|
private java.util.Comparator<E> |
comparator
The associated comparator
|
private int |
index
The current position in the list
|
private static boolean |
IS_DEBUG
Speedup for logs
|
private static org.slf4j.Logger |
LOG_CURSOR
A dedicated log for cursors
|
private static int |
MAX_PRINTED_ELEMENT
A limit to what we can print
|
private E[] |
set
The inner Set
|
| Constructor and Description |
|---|
SetCursor()
Creates a new SetCursor without any elements.
|
SetCursor(java.util.Comparator<E> comparator)
Creates a new SetCursor without any elements.
|
SetCursor(java.util.Comparator<E> comparator,
java.util.Set<E> set)
Creates a new SetCursor.
|
SetCursor(java.util.Set<E> set)
Creates a new SetCursor
As with all Cursors, this SetCursor requires a successful return from
advance operations (next() or previous()) to properly return values
using the get() operation.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
close()
Closes this Cursor and frees any resources it my have allocated.
|
void |
close(java.lang.Exception cause)
Closes this Cursor and frees any resources it my have allocated.
|
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.
|
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String tabs)
Pretty-print a cursor and its wrapped cursor.
|
checkNotClosed, isClosed, iterator, setClosureMonitorprivate static final org.slf4j.Logger LOG_CURSOR
private static final boolean IS_DEBUG
private final E[] set
private final java.util.Comparator<E> comparator
private int index
private static final int MAX_PRINTED_ELEMENT
public SetCursor(java.util.Comparator<E> comparator, java.util.Set<E> set)
comparator - an optional comparator to use for orderingset - the Set this StCursor operates onpublic SetCursor(java.util.Set<E> set)
set - the Set this SetCursor operates onpublic SetCursor()
public SetCursor(java.util.Comparator<E> comparator)
comparator - The comparator to use for the public boolean available()
public void before(E element) throws LdapException, CursorException
element - the element to be positioned beforeLdapExceptionCursorExceptionpublic void after(E element) throws LdapException, CursorException
element - the element to be positioned afterLdapExceptionCursorExceptionpublic void beforeFirst()
throws LdapException,
CursorException
LdapExceptionCursorExceptionpublic void afterLast()
throws LdapException,
CursorException
LdapExceptionCursorExceptionpublic boolean first()
throws LdapException,
CursorException
LdapExceptionCursorExceptionpublic boolean last()
throws LdapException,
CursorException
LdapExceptionCursorExceptionpublic boolean isFirst()
public boolean isLast()
public boolean isAfterLast()
isAfterLast in interface Cursor<E>isAfterLast in class AbstractCursor<E>public boolean isBeforeFirst()
isBeforeFirst in interface Cursor<E>isBeforeFirst in class AbstractCursor<E>public boolean previous()
throws LdapException,
CursorException
LdapExceptionCursorExceptionpublic boolean next()
throws LdapException,
CursorException
LdapException - if we have get any LDAP exception while operating
the cursorCursorException - if there are problems advancing to this Cursor to
the next position, or if this Cursor is closedpublic E get() throws CursorException
CursorException - if the object at this Cursor's current position
cannot be retrieved, or if this Cursor is closedpublic void close()
public void close(java.lang.Exception cause)
public java.lang.String toString(java.lang.String tabs)
AbstractCursorpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()