Access keys

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.
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.

Summary

Constructor
Class properties
Class properties inherited from AbstractList
Instance properties
Instance properties inherited from AbstractList
Class methods
Class methods inherited from AbstractList

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 list is null or
undefined
org.as2lib.data.holder.IndexOutOfBoundsException if argument fromIndex is less than 0
org.as2lib.data.holder.IndexOutOfBoundsException if argument toIndex is greater than
the size of the passed-in list
org.as2lib.data.holder.IndexOutOfBoundsException if argument fromIndex is greater than
toIndex

Instance methods

clear

function clear (
Void) : Void
Removes all values from this list.

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 index
Throws:
org.as2lib.data.holder.IndexOutOfBoundsException if given index is less than 0 or
equal to or greater than this list's size

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 value
value:
the value to insert
Throws:
org.as2lib.data.holder.IndexOutOfBoundsException if the given index is not in range,
this is less than 0 or greater than this list's size

iterator

function iterator (
Void) : Iterator
Returns the iterator to iterate over this list.
Returns:
the iterator to iterate over this list

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 index
Throws:
org.as2lib.data.holder.IndexOutOfBoundsException if given index is less than 0 or
equal to or greater than this list's size

set

function set (
index:Number, value)
Sets value to given index on this list.
Parameters:
index:
the index of value
value:
the value to set to given index
Returns:
the value that was orignially at given index
Throws:
org.as2lib.data.holder.IndexOutOfBoundsException if given index is less than 0 or
equal to or greater than this list's size

size

function size (
Void) : Number
Returns the number of added values.
Returns:
the number of added values

toArray

function toArray (
Void) : Array
Returns the array representation of this list.
Returns:
the array representation of this list