|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsu.util.CharStack
This class implements a characater stack. Yes the JKD does contain a general stack. However that stack operates on objects. This stack just handles char elements. Use in IO operations where converting chars to objects will be too expensive.
Field Summary | |
static int |
DEFAULT_QUEUE_SIZE
|
Constructor Summary | |
CharStack()
Create a stack of the default size. |
|
CharStack(int initialSize)
Create a stack with the given initial size. |
Method Summary | |
int |
capacity()
Returns the total number of locations,, used or not, for chars in the stack |
void |
clear()
Removes all elements from the stack. |
boolean |
isEmpty()
Returns true is stack is empty. |
char |
peek()
Returns the top char on the stack. |
char |
pop()
Remove and return the top char on the stack. |
void |
push(char addMe)
Adds a char to the top of the stack. |
void |
push(char[] addMe)
Adds an array of characters to the stack. |
void |
push(java.lang.String addMe)
Adds an array of characters to the stack. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int DEFAULT_QUEUE_SIZE
Constructor Detail |
public CharStack()
public CharStack(int initialSize)
Method Detail |
public java.lang.String toString()
public boolean isEmpty()
public char pop()
public char peek()
public int capacity()
public void push(char addMe)
public void push(char[] addMe)
public void push(java.lang.String addMe)
public void clear()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |