Packagech.capi.data
Classpublic class StackList
InheritanceStackList Inheritance ArrayList Inheritance Object
Implements IStack

Represents a basic implementation of a IStack object.



Public Properties
 PropertyDefined By
 Inheritedlength : int
[read-only] Defines the number of elements contained in the ArrayList.
ArrayList
  nextElement : *
[read-only] Defines the next element that will be removed from the data structure.
StackList
Public Methods
 MethodDefined By
  
StackList(initialData:Array = null)
Creates a new StackList object.
StackList
  
add(element:*):void
Add an element to the data structure.
StackList
 Inherited
addElement(element:*):void
Add an element in the ArrayList.
ArrayList
 Inherited
addElementAt(element:*, index:int):void
Add an element in the ArrayList at the specified index.
ArrayList
 Inherited
clear():void
Removes all the elements contained in this ArrayList.
ArrayList
 Inherited
contains(element:*, compare:Function = null):Boolean
Returns true if the specified element is contained in the IList or false otherwise.
ArrayList
 Inherited
getElementAt(index:int):*
Get the element at the specified index.
ArrayList
 Inherited
getElementIndex(element:*):int
Get the index of the specified element.
ArrayList
  
Get the top element of the StackList.
StackList
 Inherited
isEmpty():Boolean
Get if the structure is empty or not.
ArrayList
  
remove():*
Removes the last element of the StackList.
StackList
 Inherited
removeElement(element:*):void
Removes an element from the ArrayList.
ArrayList
 Inherited
removeElementAt(index:int):*
Removes the element at the specified index from the ArrayList.
ArrayList
 Inherited
toArray():Array
Retrieves an Array from the ArrayList.
ArrayList
 Inherited
toString():String
Displays the ArrayList in a String.
ArrayList
Property Detail
nextElementproperty
nextElement:*  [read-only]

Defines the next element that will be removed from the data structure.


Implementation
    public function get nextElement():*
Constructor Detail
StackList()Constructor
public function StackList(initialData:Array = null)

Creates a new StackList object.

Parameters
initialData:Array (default = null) — The Array with the elements to initialize. All the elements contained in the Array will be added in the StackList.
Method Detail
add()method
public function add(element:*):void

Add an element to the data structure.

Parameters

element:* — The element to add.

getTopElement()method 
public function getTopElement():*

Get the top element of the StackList.

Returns
* — The top element.
remove()method 
public function remove():*

Removes the last element of the StackList.

Returns
* — The element removed.