Packageorg.as3collections.iterators
Classpublic class ReadOnlyListIterator
InheritanceReadOnlyListIterator Inheritance ListIterator Inheritance Object

An iterator to iterate over lists. This implementation doesn't allow modifications in the list. All methods that change the list will throw an UnsupportedOperationError.



Public Methods
 MethodDefined By
  
ReadOnlyListIterator(source:IList, position:int = 0)
Constructor, creates a new ReadOnlyListIterator object.
ReadOnlyListIterator
  
add(element:*):Boolean
[override] This implementation always throws an UnsupportedOperationError.
ReadOnlyListIterator
 Inherited
hasNext():Boolean
Returns true if the iteration has more elements.
ListIterator
 Inherited
hasPrevious():Boolean
Returns true if the iteration has more elements when traversing the list in the reverse direction.
ListIterator
 Inherited
next():*
Returns the next element in the iteration.
ListIterator
 Inherited
nextIndex():int
Returns the index of the element that would be returned by a subsequent call to next.
ListIterator
 Inherited
Returns the internal pointer of the iteration.
ListIterator
 Inherited
Returns the previous element in the iteration.
ListIterator
 Inherited
Returns the index of the element that would be returned by a subsequent call to previous.
ListIterator
  
remove():void
[override] This implementation always throws an UnsupportedOperationError.
ReadOnlyListIterator
 Inherited
reset():void
Resets the internal pointer of the iterator.
ListIterator
  
set(element:*):void
[override] This implementation always throws an UnsupportedOperationError.
ReadOnlyListIterator
Constructor Detail
ReadOnlyListIterator()Constructor
public function ReadOnlyListIterator(source:IList, position:int = 0)

Constructor, creates a new ReadOnlyListIterator object.

Parameters
source:IList — the source ReadOnlyListIterator to iterate over.
 
position:int (default = 0) — indicates the first element that would be returned by an initial call to next. An initial call to previous would return the element with the specified position minus one.

Throws
ArgumentError — if the source argument is null.
Method Detail
add()method
override public function add(element:*):Boolean

This implementation always throws an UnsupportedOperationError.

Parameters

element:* — the element to add.

Returns
Boolean

Throws
org.as3coreaddendum.errors:UnsupportedOperationError ReadOnlyListIterator is a read-only iterator and doesn't allow modifications in the list.
remove()method 
override public function remove():void

This implementation always throws an UnsupportedOperationError.


Throws
org.as3coreaddendum.errors:UnsupportedOperationError ReadOnlyListIterator is a read-only iterator and doesn't allow modifications in the list.
set()method 
override public function set(element:*):void

This implementation always throws an UnsupportedOperationError.

Parameters

element:* — the element with which to replace the last element returned by next or previous.


Throws
org.as3coreaddendum.errors:UnsupportedOperationError ReadOnlyListIterator is a read-only iterator and doesn't allow modifications in the list.