org.as2lib.core.BasicInterface +--org.as2lib.data.holder.Iterator
Iterator
is used to iterate over data holders.
An iterator is quite simple to use. There is one method to check whether there are more elements left to iterate over hasNext, one method to get the next element next and one to remove the current element remove.
Example:
var iterator:Iterator = new MyIterator("value1", "value2", "value3");
while (iterator.hasNext()) {
trace(iterator.next());
}
Output:
value1 value2 value3
public function hasNext(Void):Boolean
Returns whether there is another element to iterate over.
true
if there is at least one element left to iterate
over
public function next(Void)
Returns the next element.
the next element
NoSuchElementException | if there is no next element |
public function remove(Void):Void
Removes the currently selected element from this iterator and from the data holder this iterator iterates over.
IllegalStateException | if you try to remove an element when none is selected |
UnsupportedOperationException | if this method is not supported by the concrete implementation of this interface |