Class comb.collections.Stack
Extends
comb.collections.Collection.
LIFO Data structure
Defined in: Stack.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
the current number of elements in this queue
|
|
true if this queue is empty
|
|
a copy of the values contained in this queue
|
Method Attributes | Method Name and Description |
---|---|
clear()
Removes all items from this stack.
|
|
contains(obj)
Determine if this stack contains the element
|
|
peek()
Retrieves the item at the tail of the stack without removing it
|
|
pop()
Removes the tail of this static
|
|
push(data)
Add an item to the tail of this stack
|
|
remove(obj)
Removes an element from this stack.
|
- Methods borrowed from class comb.collections.Collection:
- concat, indexOf, join, lastIndexOf, slice, toString
Field Detail
{Number}
count
the current number of elements in this queue
{Boolean}
isEmpty
true if this queue is empty
{Array}
values
a copy of the values contained in this queue
Method Detail
clear()
Removes all items from this stack.
{Boolean}
contains(obj)
Determine if this stack contains the element
- Parameters:
- {*} obj
- the object to find
- Returns:
- {Boolean} true if this stack contains the element
{*}
peek()
Retrieves the item at the tail of the stack without removing it
- Returns:
- {*} The element at the tail of the stack. Returns undefined if the stack is empty.
{*}
pop()
Removes the tail of this static
- Returns:
- {*} the data at the tail of this stack
push(data)
Add an item to the tail of this stack
- Parameters:
- {*} data
- item to qppend to this stack
{Boolean}
remove(obj)
Removes an element from this stack.
- Parameters:
- {*} obj
- the data to remove.
- Returns:
- {Boolean} true if the element was removed, false otherwise.