Packagecom.yworks.yfiles.base
Interfacepublic interface YCursor
Implementors YList_ListCursorImpl

A general interface for iterating over a collection of objects. 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."



Public Methods
 MethodDefined By
  
current():Object
Returns the object currently pointed on.
YCursor
  
next():void
Moves this cursor one position forward.
YCursor
  
ok():Boolean
Returns true if the current cursor position is valid.
YCursor
  
prev():void
Moves this cursor one position backward (optional).
YCursor
  
size():int
Returns the number of elements that can be accessed with this cursor.
YCursor
  
toFirst():void
Moves this cursor to the first valid cursor position (optional).
YCursor
  
toLast():void
Moves this cursor to the last valid cursor position (optional).
YCursor
Method Detail
current()method
public function current():Object

Returns the object currently pointed on.

Returns
Object
next()method 
public function next():void

Moves this cursor one position forward.

ok()method 
public function ok():Boolean

Returns true if the current cursor position is valid.

Returns
Boolean
prev()method 
public function prev():void

Moves this cursor one position backward (optional).

size()method 
public function size():int

Returns the number of elements that can be accessed with this cursor.

Returns
int
toFirst()method 
public function toFirst():void

Moves this cursor to the first valid cursor position (optional).

toLast()method 
public function toLast():void

Moves this cursor to the last valid cursor position (optional).