|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.marringtons.string.StringStack
This class implement a stack with String keys and values.
stack = new StringStack(); stack.push( "one"); stack.isEmpty() == false; stack.size() == 1; stack.push( "two"); stack.peek().equals( "two"); stack.pop().equals( "two"); stack.peek().equals( "one"); stack.clear(); stack.isEmpty() == true;
| Constructor Summary | |
StringStack()
|
|
| Method Summary | |
void |
clear()
Empty stack - releasing all references. |
boolean |
isEmpty()
Return true only if the stack is devoid of items. |
String |
peek()
Return the string on the top of the stack (without changint the stack pointer). |
String |
pop()
Pop a string from the stack. |
void |
push(Object item)
Push a string onto the stack (enlarging it if necessary). |
int |
size()
Return the number of items currently on the stack. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public StringStack()
| Method Detail |
public void push(Object item)
item - to pushpublic String pop()
public String peek()
public int size()
public boolean isEmpty()
public void clear()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||