SubList
| Kind of class: | class |
|---|---|
| Inherits from: | AbstractList < BasicClass |
| Implements: | |
| Author: | Simon Wacker |
| Classpath: | org.as2lib.data.holder.list.SubList |
| File last modified: | Sunday, 10 July 2005, 15:41:22 |
SubList represents a part of a wrapped list.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.
Summary
Constructor
Class methods
Class methods inherited from AbstractList
Instance methods
Instance methods inherited from AbstractList
Instance methods inherited from BasicClass
Constructor
SubList
function SubList (
list:List,
fromIndex:Number,
toIndex:Number)
Constructs a new
SubList instance.Parameters:
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)
Throws:
org.as2lib.env.except.IllegalArgumentException if argument
org.as2lib.data.holder.IndexOutOfBoundsException if argument
org.as2lib.data.holder.IndexOutOfBoundsException if argument
the size of the passed-in
org.as2lib.data.holder.IndexOutOfBoundsException if argument
list is null orundefinedorg.as2lib.data.holder.IndexOutOfBoundsException if argument
fromIndex is less than 0org.as2lib.data.holder.IndexOutOfBoundsException if argument
toIndex is greater thanthe size of the passed-in
listorg.as2lib.data.holder.IndexOutOfBoundsException if argument
fromIndex is greater thantoIndexInstance methods
clear
function clear (
Void) : Void
Removes all values from this list.
Specified by:
get
function get (
index:Number)
Returns the value at given
index.Parameters:
index:
the index to return the value of
Returns:
the value that is at given
indexThrows:
org.as2lib.data.holder.IndexOutOfBoundsException if given
equal to or greater than this list's size
index is less than 0 orequal to or greater than this list's size
Specified by:
insertByIndexAndValue
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.
Parameters:
index:
the index at which to insert the
valuevalue:
the value 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
Specified by:
iterator
function iterator (
Void) : Iterator
Returns the iterator to iterate over this list.
Returns:
the iterator to iterate over this list
Specified by:
removeByIndex
function removeByIndex (
index:Number)
Removes the value at given
index from this list and returns it.Parameters:
index:
the index of the value to remove
Returns:
the removed value that was originally at given
indexThrows:
org.as2lib.data.holder.IndexOutOfBoundsException if given
equal to or greater than this list's size
index is less than 0 orequal to or greater than this list's size
Specified by:
set
function set (
index:Number,
value)
Sets
value to given index on this list.Parameters:
index:
the index of
valuevalue:
the
value to set to given indexReturns:
the value that was orignially at given
indexThrows:
org.as2lib.data.holder.IndexOutOfBoundsException if given
equal to or greater than this list's size
index is less than 0 orequal to or greater than this list's size
Specified by:
size
function size (
Void) : Number
Returns the number of added values.
Returns:
the number of added values
Specified by:
toArray
function toArray (
Void) : Array
Returns the array representation of this list.
Returns:
the array representation of this list
Specified by: