|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--csc241.samples.Stack.fixedStack
~mohammad/public_html/classes/csc241/Stack/fixedStack.java This version implements Stack using an array. top_ indexes the top location of the array.
Constructor Summary | |
fixedStack(int size)
construct a fixedStack |
Method Summary | |
boolean |
empty()
return true if stack is empty, otherwise, return false |
boolean |
full()
return true if stack is full, otherwise, return false |
csc241.samples.Stack.Stack |
pop()
remove an element from the top of the stack. |
csc241.samples.Stack.Stack |
push(java.lang.Object val)
add an element to the top of the stack. |
java.lang.Object |
top()
return the element on top of the stack. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public fixedStack(int size)
Method Detail |
public boolean empty()
empty
in interface Stack
public boolean full()
full
in interface Stack
public csc241.samples.Stack.Stack pop() throws stackException
pop
in interface Stack
-
- Exception if stack is empty.
stackException
public csc241.samples.Stack.Stack push(java.lang.Object val) throws stackException
push
in interface Stack
-
- Exception if stack is full
stackException
public java.lang.Object top()
top
in interface Stack
-
- Exception if stack is empty.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |