|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsu.util.CharQueue
This class implements a characater queue. Yes the JKD does contain a general queue. However that queue operates on objects. This queue 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 | |
CharQueue()
|
|
CharQueue(int Size)
|
Method Summary | |
int |
capacity()
Returns the current number of locations for chars in queue |
void |
clear()
Clears the queue so it has no more elements in it |
char |
dequeue()
Removes front char from the queue and returns the char |
int |
dequeue(char[] charsRemoved)
Fills charsRemoved with chars removed from the queue. |
int |
dequeue(char[] charsRemoved,
int offset,
int numCharsRequested)
Places chars from queue in charsRemoved starting at charsRemoved[offset]. |
char[] |
dequeueAll()
Returns an array containing all chars in the queue. |
void |
enqueue(char charToAdd)
Adds charToAdd to the end of the queue |
void |
enqueue(char[] charsToAdd)
Adds all elements of charsToAdd to the end of the queue |
void |
enqueue(char[] charsToAdd,
int offset,
int numCharsToAdd)
Adds numCharsToAdd elements of charsToAdd, starting with charsToAdd[offset] to the end of the queue |
void |
enqueue(java.lang.String charsToAdd)
Adds charsToAdd to the end of the queue |
boolean |
isEmpty()
Returns true if the queue is empty |
boolean |
isFull()
Returns true if the queue is full |
char |
peek()
Returns the front char from the queue without removing it |
int |
size()
Returns the number of chars in the queue |
java.lang.String |
toString()
Returns string representation of the queue |
int |
unusedCapacity()
Returns the current number of unused locations in the queue |
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 CharQueue(int Size)
public CharQueue()
Method Detail |
public int capacity()
public boolean isEmpty()
public boolean isFull()
public int size()
public java.lang.String toString()
public int unusedCapacity()
public char dequeue()
public int dequeue(char[] charsRemoved)
public int dequeue(char[] charsRemoved, int offset, int numCharsRequested)
public char[] dequeueAll()
public char peek()
public void enqueue(char charToAdd)
public void enqueue(java.lang.String charsToAdd)
public void enqueue(char[] charsToAdd)
public void enqueue(char[] charsToAdd, int offset, int numCharsToAdd)
public void clear()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |