|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gishur.core.CursorAdapter
A basic class implementing the Cursor
-interface. The methods defining
movement functionality for a Cursor
are implemented, while methods for
access to the structure, like Cursor.element()
, have been left
abstract. A class which shall be a "pure" Cursor
, i.e. which has not
to implement further functionality of another class, should be derived from
CursorAdapter
. The CursorAdapter
treats its underlying structure
like a ring of elements, where there's an invalid position between the last and
the first element. That means, if you call next()
while the cursor is
set to an invalid position, you will reach the first element, and with prev()
the last.
Constructor Summary | |
protected |
CursorAdapter()
Default Constructor. |
Method Summary | |
void |
bottom()
Sets the Cursor to the last element. |
java.lang.Object |
getBookmark()
Returns a bookmark-object. |
boolean |
hasMoreElements()
Tests if this enumeration contains more elements. |
void |
next()
Moves the Cursor on to the next position in forward direction
(which is possibly invalid !). |
void |
next(int step)
Moves the Cursor step elements in forward direction.
|
java.lang.Object |
nextElement()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide (in fact it does the same as Cursor.element() , because the "next" element is the one the
curosr points on, but after getting the element, nextElement()
moves the cursor position on). |
void |
prev()
Moves the Cursor on to the next position in backward direction
(which is possibly invalid !). |
void |
prev(int step)
Moves the Cursor step elements in backward direction.
|
void |
set(int index)
Sets the Cursor to the index -th position from the first
element. |
void |
set(java.lang.Object bookmark)
Sets the cursor to a bookmarked position. |
void |
top()
Sets the Cursor to the first element. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gishur.core.Cursor |
element, invalidate, length, relative, valid |
Constructor Detail |
protected CursorAdapter()
Cursor
should
point to the first element.Method Detail |
public void top()
Cursor
to the first element.top
in interface Cursor
public void bottom()
Cursor
to the last element.bottom
in interface Cursor
public void next(int step)
Cursor
step
elements in forward direction.
It is possible, that the Cursor
ends up on an invalid position
because there were not step
valid positions left.next
in interface Cursor
step
- the number of elements to move in forward directionpublic void prev(int step)
Cursor
step
elements in backward direction.
It is possible, that the Cursor
ends up on an invalid position
because there were not step
valid positions left.prev
in interface Cursor
step
- the number of elements to move in backward directionpublic void next()
Cursor
on to the next position in forward direction
(which is possibly invalid !).next
in interface Cursor
public void prev()
Cursor
on to the next position in backward direction
(which is possibly invalid !).prev
in interface Cursor
public void set(int index)
Cursor
to the index
-th position from the first
element.set
in interface Cursor
index
- the index
-th element starting with the first one will
be the Cursor's
new positionpublic java.lang.Object getBookmark()
FunctionNotSupportedException
will be thrown.getBookmark
in interface Cursor
set(int)
public void set(java.lang.Object bookmark)
FunctionNotSupportedException
will be thrown.set
in interface Cursor
bookmark
- a bookmark-objectgetBookmark()
public boolean hasMoreElements()
hasMoreElements
in interface java.util.Enumeration
true
if and only if this enumeration object
contains at least one more element to provide;
false
otherwise.public java.lang.Object nextElement()
Cursor.element()
, because the "next" element is the one the
curosr points on, but after getting the element, nextElement()
moves the cursor position on).nextElement
in interface java.util.Enumeration
java.util.NoSuchElementException
- if no more elements exist.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |