An last in first out implemention of the Collection interface. Order is guaranteed so that the first object that is added to a Stack, is the last object that is returned when the object is queried; or, said another way, the last object that is added to a Stack, is the first object that is returned.
asdk.Stack
class
Method | Description |
addItem( item ) |
Adds the specified item to the top of the Stack. |
addAll( object ) |
Adds all the elements within the array or collection object to the top of the Stack. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
clear() |
Removes all of the items from the Stack. |
containsItem( item ) |
A Boolean value indicating whether the specified item is stored in the Stack. |
containsAllItems( items : Collection ) |
A Boolean value indicating whether all the items within the specified Collection are stored in the Stack. |
getSize() |
Returns the total number of items stored within the Stack |
isEmpty() |
A Boolean value indicating whether the Stack is empty (true) or not (false). |
iterator() |
Returns an iterator that can traverse the items within the Stack from top to bottom. |
peek() |
Returns the last item in the Stack without removing it. |
pop() |
Removes the last item in the Stack |
push( item ) |
Adds the specified item to the top of the Stack. |
removeItem( item ) |
Removes the specified item from the Stack. |
removeAllItems( items : Collection ) |
Removes all the items within the collection object from the Stack. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
retainAllItems( items : Collection ) |
Retains all the items within the collection object within the Stack and removes any items not in the collection. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
setComparator( condition ) |
Sets the comparator for the Stack; this allows for customizing how objects are compared by using various
implementations of the asdk.condition.IComparator interface. The default comparator is asdk.condition.ObjectComparator . |
toArray() |
Returns the items within the Stack as an array. |
toString() |
Returns a string representation of the Stack. |