|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectweiss.nonstandard.ListStack<AnyType>
public class ListStack<AnyType>
List-based implementation of the stack.
| Constructor Summary | |
|---|---|
ListStack()
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 ListStack()
| Method Detail |
|---|
public boolean isEmpty()
isEmpty in interface Stack<AnyType>public void makeEmpty()
makeEmpty in interface Stack<AnyType>public void push(AnyType x)
push in interface Stack<AnyType>x - the item to insert.public void pop()
pop in interface Stack<AnyType>UnderflowException - if the stack is empty.public AnyType top()
top in interface Stack<AnyType>UnderflowException - if the stack is empty.public AnyType topAndPop()
topAndPop in interface Stack<AnyType>UnderflowException - if the stack is empty.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||