public interface ICursor
It can be regarded as a read-only view of such a collection.
A YCursor acts like a movable pointer on the elements of a collection. The pointer can be moved forward and backward and the element currently pointed on can be accessed. The removal of elements can only be performed on the provider of the cursor, not on the cursor itself. (That's why the cursor presents a read-only view.)
Implementations of this interface do not need to support operations marked "optional."
Modifier and Type | Method and Description |
---|---|
Object |
current()
Gets the object currently pointed on.
|
void |
next()
Moves this cursor one position forward.
|
boolean |
ok()
Gets
true if the current cursor position is valid. |
void |
prev()
Moves this cursor one position backward (optional).
|
int |
size()
Gets the number of elements that can be accessed with this cursor.
|
void |
toFirst()
Moves this cursor to the first valid cursor position (optional).
|
void |
toLast()
Moves this cursor to the last valid cursor position (optional).
|
Object current()
void next()
boolean ok()
true
if the current cursor position is valid.void prev()
int size()
void toFirst()
void toLast()