Class: Stack
@include <Stack>
The Stack class provides a simple stack implementation in Bash++.
Data Members
@Stack.stack
- Type:
primitive
-
Scope:
protected
- An internal array which stores the elements of the stack.
- Type:
Methods
@Stack.size
Scope: public
Echoes the number of elements in the stack.
Usage: @Stack.size
Parameters
@Stack.push
Scope: public
Pushes a value onto the top of the stack.
Usage: @Stack.push $value
Parameters
value
- Type:
primitive
- The value to push onto the top of the stack.
- Type:
@Stack.pop
Scope: public
Pops the top element off the stack and echoes it.
Usage: @Stack.pop
Parameters
@Stack.top
Scope: public
Echoes the top element of the stack.
Usage: @Stack.top
Parameters
@Stack.clear
Scope: public
Removes all elements from the stack.
Usage: @Stack.clear
Parameters
@Stack.empty
Scope: public
Echoes “true” if the stack is empty, “false” otherwise.
Usage: @Stack.empty