|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.g11ntoolkit.util.Arguments.Queue
Private class to handle the queue of arguments.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
See License Agreement.
| Field Summary | |
private int |
front
The index of the first item in the queue. |
private int |
items
The number of items in the queue. |
private java.util.logging.Logger |
log
The log used for all messages from this class. |
private int |
max
The maximum number of items that will fit in the queue. |
private java.lang.Object[] |
queue
LinkedList queue. |
private int |
rear
The index of the last item in the queue. |
| Constructor Summary | |
Arguments.Queue(int size)
Creates a Queue object to contain the specified number of items. |
|
| Method Summary | |
void |
clear()
Clears all the items from the queue. |
boolean |
empty()
Returns true if the queue is empty. |
java.lang.Object |
pop()
Removes an item from the queue. |
void |
print()
Prints the items in the queue on the console. |
void |
push(java.lang.Object token)
Places the specified token on the queue. |
int |
size()
Returns the number of items in the queue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.util.logging.Logger log
private java.lang.Object[] queue
private int max
private int front
private int rear
private int items
| Constructor Detail |
public Arguments.Queue(int size)
Queue object to contain the specified number of items.
size - an int specifying how many items will be placed in the queue| Method Detail |
public void push(java.lang.Object token)
If the queue runs out of space, extend it.
token - an Object specifying the item to be placed on the queueArguments.maxIncrementpublic java.lang.Object pop()
public boolean empty()
public int size()
public void clear()
public void print()
Each item in the queue is printed on a separate line.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||