Packagecom.addicted2flash.util
Interfacepublic interface IStack extends ICollection, IDisposable
ImplementorsArrayStack, LinkedStack

The IStack interface represents a last-in-first-out (LIFO) stack of elements.



Public Methods
 MethodDefined by
 Inherited
add(o:*):void
Appends the specified element to the end of this list (optional operation).
ICollection
 Inherited
Adds all of the elements in the specified collection to this collection (optional operation).
ICollection
 Inherited
clear():void
Removes all of the elements from this list (optional operation).
ICollection
 Inherited
Returns a copy of the ICollection.
ICollection
 Inherited
contains(o:*):Boolean
Returns true if this list contains the specified element.
ICollection
 Inherited
Returns true if this collection contains all of the elements in the specified collection.
ICollection
 Inherited
dispose():void
free memory for garbage collection.
IDisposable
 Inherited
getAt(i:int):*
Returns the element at the specified position in this collection.
ICollection
  
indexOf(o:*):int
return index of element in the stack.
IStack
 Inherited
isEmpty():Boolean
Returns true if this list contains no elements.
ICollection
 Inherited
Returns an iterator over the elements in this list.
ICollection
  
peek():*
Looks at the object at the top of this stack without removing it from the stack.
IStack
  
pop():*
removes the element at the top of this stack and returns that object as the value of this function.
IStack
  
push(o:*):*
Pushes an element onto the top of this stack.
IStack
 Inherited
remove(o:*):Boolean
Removes the first occurrence in this list of the specified element (optional operation).
ICollection
 Inherited
Removes a single instance of the specified element from this collection, if it is present (optional operation)
ICollection
 Inherited
size():int
Returns the number of elements in this list.
ICollection
 Inherited
toArray():Array
Converts the collection into an array.
ICollection
Method detail
indexOf()method
public function indexOf(o:*):int

return index of element in the stack. If element doesn't exist, return value is -1;

Parameters
o:*

Returns
int — index of element in the stack
peek()method 
public function peek():*

Looks at the object at the top of this stack without removing it from the stack.

Returns
* — element at the top of this stack

Throws
— if stack is empty
pop()method 
public function pop():*

removes the element at the top of this stack and returns that object as the value of this function.

Returns
* — element at the top of this stack

Throws
— if stack is empty
push()method 
public function push(o:*):*

Pushes an element onto the top of this stack.

Parameters
o:* — item to be pushed onto this stack

Returns
* — item argument