[all packages]
[package net.sf.pizzacompiler.util]
[class hierarchy]
[index]
public class net.sf.pizzacompiler.util.Stack<A>
(source file: /home/enno/source/tmp/pizza/main/src/net/sf/pizzacompiler/util/Stack.pizza)
java.lang.Object
|
+----net.sf.pizzacompiler.util.Stack<A>
The pure class interface.
public class Stack<A>
implements java.io.Serializable
- A stack class. Uses net.sf.pizzacompiler.lang.List implementation.
- See also:
- net.sf.pizzacompiler.lang.List
- Stack()
- Instantiates a new stack
- isEmpty()
- Is the stack empty?
- pop()
- Takes the topmost element off the stack and returns it.
- push(A)
- Stores an element on the top of the stack.
- top()
- Returns the topmost element.
Stack
public Stack();
- Instantiates a new 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 an element 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.
- Throws:
- IndexOutOfBoundsException -if the stack is empty
-
[all packages]
[package net.sf.pizzacompiler.util]
[class hierarchy]
[index]
net.sf.pizzacompiler.util.Stack.html