Abstract supertype of datastructures that can be used as LIFO stacks.

A Stack has a well-defined top. Elements may be added to the top of the stack by push(), and removed from the top of the stack by pop().

Note that many Stacks are also Lists, but there is no defined relationship between the order of elements in the list and the direction of the stack. In particular, the top of the stack may be first element of the list, or it may be the last element of the list.

no type hierarchy

no supertypes hierarchy

Attributes
topSource Codeshared formal Element? top

The element currently at the top of the stack, or null if the stack is empty.

Inherited Attributes
Attributes inherited from: Object
Methods
popSource Codeshared formal Element? pop()

Remove and return the element at the top of the stack.

pushSource Codeshared formal void push(Element element)

Push a new element onto the top of the stack.

Inherited Methods
Methods inherited from: Object