AbstractList
| Kind of class: | class |
|---|---|
| Inherits from: | BasicClass |
| Known subclasses: | |
| Author: | Simon Wacker |
| Classpath: | org.as2lib.data.holder.list.AbstractList |
| File last modified: | Sunday, 10 July 2005, 15:41:22 |
AbstractList provides common implementations of methods needed byimplementations of the org.as2lib.data.holder.List interface.
Summary
Class methods
Instance methods
- insert
- insertByValue
- insertFirst
- insertLast
- insertAll
- insertAllByList
- insertAllByIndexAndList
- remove
- removeByValue
- removeFirst
- removeLast
- removeAll
- setAll
- retainAll
- contains
- containsAll
- subList
- indexOf
- isEmpty
- toString
Instance methods inherited from BasicClass
Class methods
getStringifier
static function getStringifier (
Void) : Stringifier
Returns the stringifier to stringify lists.
Returns:
the list stringifier
setStringifier
static function setStringifier (
listStringifier:Stringifier) : Void
Sets the stringifier to stringify lists.
Parameters:
listStringifier:
the stringifier to stringify lists
Instance methods
contains
function contains (
value) : Boolean
Checks whether
value is contained in this list.Parameters:
value:
the value to check whether it is contained
Returns:
true if value is contained else falsecontainsAll
function containsAll (
list:List) : Boolean
Checks whether all values of
list are contained in this list.Parameters:
list:
the values to check whether they are contained
Returns:
true if all values of list are contained elsefalseindexOf
function indexOf (
value) : Number
Returns the index of
value.Parameters:
value:
the value to return the index of
Returns:
the index of
valueinsertAll
function insertAll (
) : Void
insertAllByIndexAndList
function insertAllByIndexAndList (
index:Number,
list:List) : Void
Inserts all values contained in
specified
list to this list, starting at thespecified
index.Elements that are at an affected index are shifted to the right by the size
of the given list.
Parameters:
index:
the index to start the insertion at
list :
the values to insert
Throws:
org.as2lib.data.holder.IndexOutOfBoundsException if the given
this is less than 0 or greater than this list's size
index is not in range,this is less than 0 or greater than this list's size
insertAllByList
function insertAllByList (
list:List) : Void
Inserts all values contained in
list to the end of this list.Parameters:
list:
the values to insert
insertByValue
function insertByValue (
value) : Void
Inserts
value at the end of this list.Parameters:
value:
the value to insert
See also:
insertFirst
function insertFirst (
value) : Void
Inserts
value at the beginning of this list.Parameters:
value:
the value to insert
insertLast
function insertLast (
value) : Void
Inserts
value at the end of this list.Parameters:
value:
the value to insert
See also:
isEmpty
function isEmpty (
Void) : Boolean
Returns whether this list is empty.
This list is empty if it has no values assigned to it.
Returns:
true if this list is empty else falseremoveAll
function removeAll (
list:List) : Void
Removes all values contained in
list.Parameters:
list:
the values to remove
removeByValue
function removeByValue (
value) : Number
Removes
value from this list if it exists.Parameters:
value:
the value to remove
removeFirst
function removeFirst (
Void)
Removes the value at the beginning of this list.
Returns:
the removed value
removeLast
function removeLast (
Void)
Removes the value at the end of this list.
Returns:
the removed value
retainAll
function retainAll (
list:List) : Void
Retains all values the are contained in
list and removes all others.Parameters:
list:
the list of values to retain
setAll
function setAll (
index:Number,
list:List) : Void
Sets all values contained in
and following indices will be overwritten.
list to this list, starting from givenindex. They values that were originally at the given indexand 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.
Parameters:
index:
the index to start at
list :
the values to set
Throws:
org.as2lib.data.holder.IndexOutOfBoundsException if given
any affected index, that is the given
specific value in the given
size
index is less than 0 or ifany affected index, that is the given
index plus the index of thespecific value in the given
list, is equal to or greater than this list'ssize
subList
function subList (
fromIndex:Number,
toIndex:Number) : List
Returns a view of the portion of this list between the specified
inclusive, and
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.
Parameters:
fromIndex:
the index from which the sub-list starts (inclusive)
toIndex :
the index specifying the end of the sub-list (exclusive)
Returns:
a view of the specified range within this list
Throws:
org.as2lib.data.holder.IndexOutOfBoundsException if argument
org.as2lib.data.holder.IndexOutOfBoundsException if argument
the size of this list
org.as2lib.data.holder.IndexOutOfBoundsException if argument
fromIndex is less than 0org.as2lib.data.holder.IndexOutOfBoundsException if argument
toIndex is greater thanthe size of this list
org.as2lib.data.holder.IndexOutOfBoundsException if argument
fromIndex is greater thantoIndextoString
function toString (
) : String
Returns the string representation of this list.
The string representation is obtained via the stringifier returned by the
static getStringifier method.
Returns:
the string representation of this list
Overrides: