org.as2lib.core.BasicClass +--org.as2lib.data.holder.list.AbstractList
AbstractList
provides common implementations of methods needed by
implementations of the List interface.
static public function getStringifier(Void):Stringifier
Returns the stringifier to stringify lists.
the list stringifier
static public function setStringifier(listStringifier:Stringifier):Void
Sets the stringifier to stringify lists.
listStringifier | the stringifier to stringify lists |
public function insertByValue(value):Void
Inserts value
at the end of this list.
value | the value to insert |
public function insertFirst(value):Void
Inserts value
at the beginning of this list.
value | the value to insert |
public function insertLast(value):Void
Inserts value
at the end of this list.
value | the value to insert |
public function insertAllByList(list:List):Void
Inserts all values contained in list
to the end of this list.
list | the values to insert |
public function insertAllByIndexAndList(index:Number, list:List):Void
Inserts all values contained in list
to this list, starting at the
specified index
.
Elements that are at an affected index are shifted to the right by the size
of the given list
.
index | the index to start the insertion at |
list | the values 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 removeByValue(value):Number
Removes value
from this list if it exists.
value | the value to remove |
public function removeFirst(Void)
Removes the value at the beginning of this list.
the removed value
public function removeLast(Void)
Removes the value at the end of this list.
the removed value
public function removeAll(list:List):Void
Removes all values contained in list
.
list | the values to remove |
public function setAll(index:Number, list:List):Void
Sets all values contained in list
to this list, starting from given
index
. They values that were originally at the given index
and following indices will be overwritten.
This method only overwrites existing index-value pairs. If an affected index
is equal to or greater than this list's size, which would mean that this list's
size had to be expanded, an IndexOutOfBoundsException
will be thrown. In
such a case use the insertAll method instead, which expands this list
dynamically.
index | the index to start at |
list | the values to set |
IndexOutOfBoundsException | if given index is less than 0 or if
any affected index, that is the given index plus the index of the
specific value in the given list , is equal to or greater than this list's
size
|
public function retainAll(list:List):Void
Retains all values the are contained in list
and removes all others.
list | the list of values to retain |
public function contains(value):Boolean
Checks whether value
is contained in this list.
value | the value to check whether it is contained |
true
if value
is contained else false
public function containsAll(list:List):Boolean
Checks whether all values of list
are contained in this list.
list | the values to check whether they are contained |
true
if all values of list
are contained else
false
public function subList(fromIndex:Number, toIndex:Number):List
Returns a view of the portion of this list between the specified fromIndex
,
inclusive, and toIndex
, exclusive.
If fromIndex
and toIndex
are equal an empty list is returned.
The returned list is backed by this list, so changes in the returned list are reflected in this list, and vice-versa.
fromIndex | the index from which the sub-list starts (inclusive) |
toIndex | the index specifying the end of the sub-list (exclusive) |
a view of the specified range within this list
IndexOutOfBoundsException | if argument fromIndex is less than 0
|
IndexOutOfBoundsException | if argument toIndex is greater than
the size of this list
|
IndexOutOfBoundsException | if argument fromIndex is greater than
toIndex
|
public function indexOf(value):Number
Returns the index of value
.
value | the value to return the index of |
the index of value
public function isEmpty(Void):Boolean
Returns whether this list is empty.
This list is empty if it has no values assigned to it.
true
if this list is empty else false
public function toString():String
Returns the string representation of this list.
The string representation is obtained via the stringifier returned by the static getStringifier method.
the string representation of this list
toString() in org.as2lib.core.BasicInterface