| Package | ch.capi.data |
| Class | public class ArrayList |
| Implements | IList |
| Subclasses | QueueList, StackList |
IList using an Array
to store the elements.
| Property | Defined by | ||
|---|---|---|---|
| length : int [read-only]
Defines the number of elements contained into
the
ArrayList. | ArrayList | ||
| Method | Defined by | ||
|---|---|---|---|
|
ArrayList(initialData:Array = null)
Creates a new
ArrayList object. | ArrayList | ||
|
addElement(element:*):void
Add an element into the
ArrayList. | ArrayList | ||
|
addElementAt(element:*, index:int):void
Add an element into the
ArrayList at the specified index. | ArrayList | ||
|
clear():void
Removes all the elements contained into this
ArrayList. | ArrayList | ||
|
getElementAt(index:int):*
Get the element at the specified index.
| ArrayList | ||
|
getElementIndex(element:*):int
Get the index of the specified element.
| ArrayList | ||
|
isEmpty():Boolean
Get if the structure is empty or not.
| ArrayList | ||
|
removeElement(element:*):void
Removes an element from the
ArrayList. | ArrayList | ||
|
removeElementAt(index:int):*
Removes the element at the specified index from the
ArrayList. | ArrayList | ||
|
toArray():Array
Retrieves an
Array from the ArrayList. | ArrayList | ||
|
toString():String
Displays the
ArrayList into a String. | ArrayList | ||
| length | property |
length:int [read-only]
Defines the number of elements contained into
the ArrayList.
public function get length():int
| ArrayList | () | constructor |
public function ArrayList(initialData:Array = null)
Creates a new ArrayList object.
initialData:Array (default = null) — The initial data to add to the ArrayList.
|
| addElement | () | method |
public function addElement(element:*):void
Add an element into the ArrayList.
element:* — The element to add.
|
| addElementAt | () | method |
public function addElementAt(element:*, index:int):void
Add an element into the ArrayList at the specified index.
element:* — The element to add.
|
|
index:int — The index of the element.
|
| clear | () | method |
public function clear():void
Removes all the elements contained into this ArrayList.
| getElementAt | () | method |
public function getElementAt(index:int):*Get the element at the specified index.
Parametersindex:int — The index of the element to get.
|
* — The element at the specified index.
|
| getElementIndex | () | method |
public function getElementIndex(element:*):intGet the index of the specified element.
Parameterselement:* — The element to find.
|
int — The index of the element or -1 if the element is
not found.
|
| isEmpty | () | method |
public function isEmpty():BooleanGet if the structure is empty or not.
ReturnsBoolean — true if there is no element into
the structure.
|
| removeElement | () | method |
public function removeElement(element:*):void
Removes an element from the ArrayList.
element:* — The element to remove.
|
| removeElementAt | () | method |
public function removeElementAt(index:int):*
Removes the element at the specified index from the ArrayList.
index:int — The index of the element to remove.
|
* — The removed element.
|
| toArray | () | method |
public function toArray():Array
Retrieves an Array from the ArrayList.
Array — An Array containing the objects.
|
| toString | () | method |
public function toString():String
Displays the ArrayList into a String.
String — A String representing the ArrayList.
|