|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweiss.nonstandard.ArrayStack<AnyType>
public class ArrayStack<AnyType>
Array-based implementation of the stack.
Constructor Summary | |
---|---|
ArrayStack()
Construct the stack. |
Method Summary | |
---|---|
boolean |
isEmpty()
Test if the stack is logically empty. |
void |
makeEmpty()
Make the stack logically empty. |
void |
pop()
Remove the most recently inserted item from the stack. |
void |
push(AnyType x)
Insert a new item into the stack. |
AnyType |
top()
Get the most recently inserted item in the stack. |
AnyType |
topAndPop()
Return and remove the most recently inserted item from the stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayStack()
Method Detail |
---|
public boolean isEmpty()
isEmpty
in interface Stack<AnyType>
public void makeEmpty()
makeEmpty
in interface Stack<AnyType>
public AnyType top()
top
in interface Stack<AnyType>
UnderflowException
- if the stack is empty.public void pop()
pop
in interface Stack<AnyType>
UnderflowException
- if the stack is empty.public AnyType topAndPop()
topAndPop
in interface Stack<AnyType>
Underflow
- if the stack is empty.public void push(AnyType x)
push
in interface Stack<AnyType>
x
- the item to insert.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |