Stores data in a ‘first on, last off’ fashion. Each element placed in this collection can be of any data type.
com.boostworthy.collections.ICollection
Stack | Stores data in a ‘first on, last off’ fashion. |
Variables | |
m_aData | Array for storing all data in this collection. |
Functions and Properties | |
Stack | Constructor. |
addElement | Adds a new element to this object’s collection. |
removeElement | Removes an element from this object’s collection. |
length | Gets the length of this collection. |
getIterator | Returns an iterator of the specified type. |
dispose | Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to ‘null’, etc. |
getElementIndex | Loops through the data array and checks each element against the passed element. |
public function getIterator( uIterator: uint = 2 ):IIterator
Returns an iterator of the specified type.
param | uIterator The iterator type to use for iterating through the data being stored by this collection. Default is ‘2’ (IteratorType.ARRAY_FORWARD). |
An iterator instance of the specified type.
com.boostworthy.collections.iterators.IteratorType
private function getElementIndex( objElement: Object ):int
Loops through the data array and checks each element against the passed element. If the element is found in the data array, it’s index is returned, otherwise ‘null’ is returned indicating that it was not found in the data array.
param | objElement The element being searched for in the collection. |
The element’s index in the data array.
Array for storing all data in this collection.
protected var m_aData: Array
Constructor.
public function Stack()
Adds a new element to this object’s collection.
public function addElement( objElement: Object ):void
Removes an element from this object’s collection.
public function removeElement( objElement: Object ):void
Gets the length of this collection.
public function get length():uint
Returns an iterator of the specified type.
public function getIterator( uIterator: uint = 2 ):IIterator
Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to ‘null’, etc.
public function dispose():void
Loops through the data array and checks each element against the passed element.
private function getElementIndex( objElement: Object ):int