|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The interface defining the basic functionality of a Cursor
. There are methods
declared for arbitrarily moving over a list-like structure and for access to the
underlying structure, e.g element()
and length()
.
A Cursor
implements the Enumeration
interface, so one can
use Cursors
as Enumerations
too. In order to
use this correctly, the default constructor of the Cursor
should set
it to the first element.
Method Summary | |
void |
bottom()
Sets the Cursor to the last element. |
java.lang.Object |
element()
Returns the element to which this Cursor points at the moment. |
java.lang.Object |
getBookmark()
Returns a bookmark-object. |
void |
invalidate()
Sets the Cursor to an invalid position. |
int |
length()
Returns the number of elements in the underlying structure of this Cursor . |
void |
next()
Moves the Cursor on to the next position in forward direction. |
void |
next(int step)
Moves the Cursor step elements in forward direction. |
void |
prev()
Moves the Cursor on to the next position in backward direction. |
void |
prev(int step)
Moves the Cursor step elements in backward direction. |
void |
relative(int step)
Moves the Cursor step positions within the underlying
structure. |
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. |
boolean |
valid()
Checks if the Cursor's actual position is valid. |
Methods inherited from interface java.util.Enumeration |
hasMoreElements, nextElement |
Method Detail |
public java.lang.Object element()
Cursor
points at the moment.Cursor
public void relative(int step)
Cursor
step
positions within the underlying
structure.step
- the number of elements to movepublic boolean valid()
Cursor's
actual position is valid.true
, if the Cursor
points to a
valid position, and false
otherwisepublic void invalidate()
Cursor
to an invalid position.public int length()
Cursor
.public void top()
Cursor
to the first element.public void bottom()
Cursor
to the last element.public void next(int step)
Cursor
step
elements in forward direction.step
- the number+1 of elements to skip in forward directionpublic void prev(int step)
Cursor
step
elements in backward direction.step
- the number+1 of elements to skip in backward directionpublic void next()
Cursor
on to the next position in forward direction.public void prev()
Cursor
on to the next position in backward direction.public void set(int index)
Cursor
to the index
-th position from the first
element.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.set(int)
public void set(java.lang.Object bookmark)
FunctionNotSupportedException
will be thrown.bookmark
- a bookmark-objectgetBookmark()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |