org.as2lib.core.BasicClass +--org.as2lib.data.holder.list.AbstractList +--org.as2lib.data.holder.list.SubList
List
SubList
represents a part of a wrapped list. This part is specified by a
range from one index to another index. Every changes that are made to this list are
actually made to the wrapped list. You can nevertheless treat this list
implementation as any other; there is no difference in usage.
new SubList()
contains(), containsAll(), getStringifier(), indexOf(), insert(), insertAll(), insertAllByIndexAndList(), insertAllByList(), insertByValue(), insertFirst(), insertLast(), isEmpty(), remove(), removeAll(), removeByValue(), removeFirst(), removeLast(), retainAll(), setAll(), setStringifier(), subList(), toString()
public function SubList(list:List, fromIndex:Number, toIndex:Number)
Constructs a new SubList
instance.
list | the list this is a sub-list of |
fromIndex | the start index of this sub-list (inclusive) |
toIndex | the end index of this sub-list (exclusive) |
IllegalArgumentException | if argument list is null or
undefined
|
IndexOutOfBoundsException | if argument fromIndex is less than 0
|
IndexOutOfBoundsException | if argument toIndex is greater than
the size of the passed-in list
|
IndexOutOfBoundsException | if argument fromIndex is greater than
toIndex
|
public function set(index:Number, value)
Sets value
to given index
on this list.
index | the index of value
|
value | the value to set to given index
|
the value that was orignially at given index
IndexOutOfBoundsException | if given index is less than 0 or
equal to or greater than this list's size
|
public function get(index:Number)
Returns the value at given index
.
index | the index to return the value of |
the value that is at given index
IndexOutOfBoundsException | if given index is less than 0 or
equal to or greater than this list's size
|
public function insertByIndexAndValue(index:Number, value):Void
Inserts value
at the given index
.
The element that is currently at the given index
is shifted by one to
the right, as well as any subsequent elements.
index | the index at which to insert the value
|
value | the value to insert |
IndexOutOfBoundsException | if the given index is not in range,
this is less than 0 or greater than this list's size
|
public function removeByIndex(index:Number)
Removes the value at given index
from this list and returns it.
index | the index of the value to remove |
the removed value that was originally at given index
IndexOutOfBoundsException | if given index is less than 0 or
equal to or greater than this list's size
|
public function size(Void):Number
Returns the number of added values.
the number of added values
public function iterator(Void):Iterator
Returns the iterator to iterate over this list.
the iterator to iterate over this list