| Package | de.polygonal.ds |
| Class | public class DListIterator |
| Inheritance | DListIterator Object |
| Implements | Iterator |
| Property | Defined By | ||
|---|---|---|---|
| data : *
Grants access to the current item being referenced by the iterator. | DListIterator | ||
| list : DLinkedList
The list this iterator uses. | DListIterator | ||
| node : DListNode
The node the iterator is currently pointing to. | DListIterator | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a new DListIterator instance pointing to a given node. | DListIterator | ||
back():void
Moves the iterator to the previous node. | DListIterator | ||
end():void
Moves the iterator to the tail node. | DListIterator | ||
forth():void
Moves the iterator to the next node. | DListIterator | ||
hasNext():Boolean
Checks if a next item exists. | DListIterator | ||
next():*
Returns the current item and moves the iterator to the next item
in the collection. | DListIterator | ||
remove():Boolean
Removes the node the iterator is pointing to. | DListIterator | ||
start():void
Moves the iterator to the first item in the collection. | DListIterator | ||
toString():String
Prints out a string representing the current object. | DListIterator | ||
valid():Boolean
Checks if the current referenced node is valid. | DListIterator | ||
| 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:DLinkedListThe list this iterator uses.
| node | property |
public var node:DListNodeThe node the iterator is currently pointing to.
| DListIterator | () | Constructor |
public function DListIterator(list:DLinkedList, node:DListNode = null)Creates a new DListIterator instance pointing to a given node. Usually created by invoking DLinkedList.getIterator().
Parameterslist:DLinkedList — The linked list the iterator should handle.
| |
node:DListNode (default = null) — The iterator's starting node.
|
| back | () | method |
public function back():voidMoves the iterator to the previous 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.
|