Package | org.as3collections.lists |
Class | public class ReadOnlyArrayList |
Inheritance | ReadOnlyArrayList AbstractList AbstractArrayCollection Object |
org.as3coreaddendum.errors.UnsupportedOperationError
.
Method | Defined By | ||
---|---|---|---|
ReadOnlyArrayList(source:Array)
Constructor, creates a new ReadOnlyArrayList object. | ReadOnlyArrayList | ||
add(element:*):Boolean [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
addAll(collection:ICollection):Boolean [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
addAllAt(index:int, collection:ICollection):Boolean [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
addAt(index:int, element:*):Boolean [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
clear():void [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
clone():* [override]
Creates and return a new ReadOnlyArrayList object containing all elements in this list (in the same order). | ReadOnlyArrayList | ||
contains(o:*):Boolean
Returns true if this collection contains the specified object. | AbstractArrayCollection | ||
containsAll(collection:ICollection):Boolean
Returns true if this collection contains all of the elements in the specified collection. | AbstractArrayCollection | ||
equals(other:*):Boolean [override]
This method uses CollectionUtil.equalConsideringOrder method to perform equality, sending this list and other argument. | AbstractList | ||
getAt(index:int):*
Returns the element at the specified position in this list. | AbstractList | ||
indexOf(element:*, fromIndex:int = 0):int
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. | AbstractList | ||
isEmpty():Boolean
Returns true if this collection contains no elements. | AbstractArrayCollection | ||
[override]
Returns an iterator over a set of elements. | ReadOnlyArrayList | ||
lastIndexOf(element:*, fromIndex:int = 0x7fffffff):int
Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. | AbstractList | ||
listIterator(index:int = 0):IListIterator [override]
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list. | ReadOnlyArrayList | ||
remove(o:*):Boolean [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
removeAll(collection:ICollection):Boolean [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
removeAt(index:int):* [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
removeRange(fromIndex:int, toIndex:int):ICollection [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
retainAll(collection:ICollection):Boolean [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
reverse():void [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
setAt(index:int, element:*):* [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyArrayList | ||
size():int
Returns the number of elements in this collection. | AbstractArrayCollection | ||
[override]
Returns a new ReadOnlyArrayList that is a view of the portion of this ReadOnlyArrayList between the specified fromIndex, inclusive, and toIndex, exclusive. | ReadOnlyArrayList | ||
toArray():Array
Returns an array containing all of the elements in this collection. | AbstractArrayCollection | ||
toString():String
Returns the string representation of this instance. | AbstractArrayCollection |
ReadOnlyArrayList | () | Constructor |
public function ReadOnlyArrayList(source:Array)
Constructor, creates a new ReadOnlyArrayList
object.
source:Array — an array to fill the list.
|
ArgumentError — if the source argument is null .
|
add | () | method |
override public function add(element:*):Boolean
This implementation always throws an UnsupportedOperationError
.
Parameters
element:* |
Boolean — |
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
addAll | () | method |
override public function addAll(collection:ICollection):Boolean
This implementation always throws an UnsupportedOperationError
.
Parameters
collection:ICollection |
Boolean — |
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
addAllAt | () | method |
override public function addAllAt(index:int, collection:ICollection):Boolean
This implementation always throws an UnsupportedOperationError
.
Parameters
index:int | |
collection:ICollection |
Boolean — |
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
addAt | () | method |
override public function addAt(index:int, element:*):Boolean
This implementation always throws an UnsupportedOperationError
.
Parameters
index:int | |
element:* |
Boolean — |
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
clear | () | method |
override public function clear():void
This implementation always throws an UnsupportedOperationError
.
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
clone | () | method |
override public function clone():*
Creates and return a new ReadOnlyArrayList
object containing all elements in this list (in the same order).
* — a new ReadOnlyArrayList object containing all elements in this list (in the same order).
|
iterator | () | method |
override public function iterator():IIterator
Returns an iterator over a set of elements.
This implementation returns a ReadOnlyArrayIterator
object.
IIterator — an iterator over a set of elements.
|
See also
listIterator | () | method |
override public function listIterator(index:int = 0):IListIterator
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list. The specified index 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 index minus one.
This implementation returns a ReadOnlyListIterator
object.
Parameters
index:int (default = 0 ) — index of first element to be returned from the list iterator (by a call to the next method)
|
IListIterator — a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.
|
See also
remove | () | method |
override public function remove(o:*):Boolean
This implementation always throws an UnsupportedOperationError
.
Parameters
o:* |
Boolean — |
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
removeAll | () | method |
override public function removeAll(collection:ICollection):Boolean
This implementation always throws an UnsupportedOperationError
.
Parameters
collection:ICollection |
Boolean — |
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
removeAt | () | method |
override public function removeAt(index:int):*
This implementation always throws an UnsupportedOperationError
.
Parameters
index:int |
* —
|
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
removeRange | () | method |
override public function removeRange(fromIndex:int, toIndex:int):ICollection
This implementation always throws an UnsupportedOperationError
.
Parameters
fromIndex:int | |
toIndex:int |
ICollection — |
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
retainAll | () | method |
override public function retainAll(collection:ICollection):Boolean
This implementation always throws an UnsupportedOperationError
.
Parameters
collection:ICollection |
Boolean — |
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
reverse | () | method |
override public function reverse():void
This implementation always throws an UnsupportedOperationError
.
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
setAt | () | method |
override public function setAt(index:int, element:*):*
This implementation always throws an UnsupportedOperationError
.
Parameters
index:int | |
element:* |
* —
|
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyArrayList is a read-only list and doesn't allow modifications.
|
subList | () | method |
override public function subList(fromIndex:int, toIndex:int):IList
Returns a new ReadOnlyArrayList
that is a view of the portion of this ReadOnlyArrayList
between the specified fromIndex
, inclusive, and toIndex
, exclusive.
Parameters
fromIndex:int — the index to start retrieving elements (inclusive).
| |
toIndex:int — the index to stop retrieving elements (exclusive).
|
IList — a new ReadOnlyArrayList that is a view of the specified range within this list.
|
IndexOutOfBoundsError — if fromIndex or toIndex is out of range (index < 0 || index > size()) .
|
import org.as3collections.IList; import org.as3collections.lists.ArrayList; import org.as3collections.lists.ReadOnlyArrayList; var list1:IList = new ArrayList([3, 5, 1, 7]); list1 // [3,5,1,7] var list2:IList = new ReadOnlyArrayList(list1.toArray()); list2 // [3,5,1,7] list2.add(1) // UnsupportedOperationError: ReadOnlyArrayList is a read-only list and doesn't allow modifications. list2.remove(1) // UnsupportedOperationError: ReadOnlyArrayList is a read-only list and doesn't allow modifications. var list3:IList = list2.clone(); list3 // [3,5,1,7] list3.contains(2) // false list3.contains(5) // true list3.indexOf(5) // 1 list3.containsAll(list1) // true list3.equals(list1) // false list3.getAt(2) // 1 list3.subList(1, 3) // [5,1] list3.addAll(list2) // UnsupportedOperationError: ReadOnlyArrayList is a read-only list and doesn't allow modifications. list3.removeRange(1, 3) // UnsupportedOperationError: ReadOnlyArrayList is a read-only list and doesn't allow modifications. var it:IIterator = list3.iterator(); while (it.hasNext()) { it.next() it.remove() // UnsupportedOperationError: ReadOnlyArrayIterator is a read-only iterator and doesn't allow modifications in the collection. } var it2:IListIterator = list3.listIterator(); while (it2.hasNext()) { it2.next() it.add(1) // UnsupportedOperationError: ReadOnlyListIterator is a read-only iterator and doesn't allow modifications in the list. }