E
- The type of element on which this cursor will iteratepublic class SingletonCursor<E> extends AbstractCursor<E>
Constructor and Description |
---|
SingletonCursor(E singleton)
Creates a new instance of SingletonCursor.
|
SingletonCursor(E singleton,
Comparator<E> comparator)
Creates a new instance of SingletonCursor, with its associated
comparator
|
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.
|
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.
|
checkNotClosed, close, close, isClosed, iterator, setClosureMonitor
public SingletonCursor(E singleton)
singleton
- The unique element to store into this cursorpublic SingletonCursor(E singleton, Comparator<E> comparator)
singleton
- The unique element to store into this cursorcomparator
- The associated comparatorpublic boolean available()
public void before(E element) throws Exception
element
- the element to be positioned beforeException
- with problems accessing the underlying btreepublic void after(E element) throws Exception
element
- the element to be positioned afterException
- if there are problems positioning this cursor or if
this Cursor is closedpublic void beforeFirst() throws Exception
Exception
- if there are problems positioning this cursor or if
this Cursor is closedpublic void afterLast() throws Exception
Exception
- if there are problems positioning this Cursor or if
this Cursor is closedpublic boolean first() throws Exception
Exception
- if there are problems positioning this Cursor or if
this Cursor is closedpublic boolean last() throws Exception
Exception
- if there are problems positioning this Cursor or if
this Cursor is closedpublic 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 closedpublic 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 closedpublic boolean previous() throws Exception
Exception
- if there are problems advancing to the next positionpublic boolean next() throws Exception
Exception
- if there are problems advancing to this Cursor to
the next position, or if this Cursor is closedpublic E get() throws Exception
Exception
- if the object at this Cursor's current position
cannot be retrieved, or if this Cursor is closedCopyright © 2003-2014 The Apache Software Foundation. All Rights Reserved.