| Package | de.polygonal.ds |
| Class | public class SListIterator |
| Inheritance | SListIterator Object |
| Implements | Iterator |
| Property | Defined By | ||
|---|---|---|---|
| data : *
Grants access to the current item being referenced by the iterator. | SListIterator | ||
| list : SLinkedList
The list this iterator uses. | SListIterator | ||
| node : SListNode
The node the iterator is pointing to. | SListIterator | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a new SListIterator instance pointing to a given node. | SListIterator | ||
end():void
Moves the iterator to the tail node. | SListIterator | ||
forth():void
Moves the iterator to the next node. | SListIterator | ||
hasNext():Boolean
Checks if a next item exists. | SListIterator | ||
next():*
Returns the current item and moves the iterator to the next item
in the collection. | SListIterator | ||
remove():Boolean
Removes the node the iterator is pointing to. | SListIterator | ||
start():void
Moves the iterator to the first item in the collection. | SListIterator | ||
toString():String
Prints out a string representing the current object. | SListIterator | ||
valid():Boolean
Checks if the current referenced node is valid. | SListIterator | ||
| data | property |
data:*Grants access to the current item being referenced by the iterator. This provides a quick way to read or write the current data.
public function get data():* public function set data(value:any):void| list | property |
public var list:SLinkedListThe list this iterator uses.
| node | property |
public var node:SListNodeThe node the iterator is pointing to.
| SListIterator | () | Constructor |
public function SListIterator(list:SLinkedList = null, node:SListNode = null)Creates a new SListIterator instance pointing to a given node. Usually created by invoking SLinkedList.getIterator().
Parameterslist:SLinkedList (default = null) — The linked list the iterator should handle.
| |
node:SListNode (default = null) — The iterator's starting node.
|
| end | () | method |
public function end():voidMoves the iterator to the tail node.
| forth | () | method |
public function forth():voidMoves the iterator to the next node.
| hasNext | () | method |
public function hasNext():BooleanChecks if a next item exists.
ReturnsBoolean — True if a next item exists, otherwise false.
|
| next | () | method |
public function next():*Returns the current item and moves the iterator to the next item in the collection. Note that the next() method returns the first item in the collection when it's first called.
Returns* — The next item in the collection.
|
| remove | () | method |
public function remove():BooleanRemoves the node the iterator is pointing to.
ReturnsBoolean — True if the removal succeeded, otherwise false.
|
| start | () | method |
public function start():voidMoves the iterator to the first item in the collection.
| toString | () | method |
public function toString():StringPrints out a string representing the current object.
ReturnsString — A string representing the current object.
|
| valid | () | method |
public function valid():BooleanChecks if the current referenced node is valid.
ReturnsBoolean — True if the node exists, otherwise false.
|