[all packages]
[package pizza.contrib]
[class hierarchy]
[index]
public class pizza.contrib.Stack<A>
(source file: pizza/contrib/Stack.pizza)
java.lang.Object
|
+----pizza.contrib.Stack<A>
The pure class interface.
public class Stack<A>
- A stack class. Uses pizza.lang.List implementation.
- See also:
- pizza.lang.List

Stack()
- Instantiates an empty stack

isEmpty()
- Is the stack empty?
pop()
- Takes the topmost element off the stack and returns it.
push(A)
- Stores element
elem
on the top of the stack.
top()
- Returns the topmost element (whithout removing it).

Stack
public Stack();
- Instantiates an empty stack.

isEmpty
public boolean isEmpty();
- Is the stack empty?
- Returns:
- true if there are no elements on the stack
push
public void push(A elem);
- Stores element
elem
on the top of the stack.
pop
public A pop()
throws IndexOutOfBoundsException;
- Takes the topmost element off the stack and returns it.
- Throws:
- IndexOutOfBoundsException -if the stack is empty
-
top
public A top()
throws IndexOutOfBoundsException;
- Returns the topmost element (whithout removing it).
- Throws:
- IndexOutOfBoundsException -if the stack is empty
-
[all packages]
[package pizza.contrib]
[class hierarchy]
[index]
pizza.contrib.Stack.html