|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jsim.queue.Queue jsim.queue.FIFO_Queue
public class FIFO_Queue
FIFO_Queue class implements the First_In_First_Out queue. The implementation is based on the Pascal implementation in Data Structures by Rick Decker.
Field Summary |
---|
Fields inherited from class jsim.queue.Queue |
---|
capacity, root, size |
Constructor Summary | |
---|---|
FIFO_Queue()
Constructs an empty FIFO queue with unlimited capacity. |
|
FIFO_Queue(int capacity)
Constructs an empty FIFO queue with limited capacity. |
Method Summary | |
---|---|
Q_Node |
addAt(java.lang.Object item)
Insert an element into the queue. |
void |
clear()
Clear all elements from the queue. |
protected void |
removeMin()
Remove the node containing the minimum/first element from the queue. |
Methods inherited from class jsim.queue.Queue |
---|
add, add, addAll, addAll, cancel, contains, containsAll, first, get, indexOf, isEmpty, isFull, iterator, lastIndexOf, listIterator, listIterator, remove, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
equals, hashCode |
Constructor Detail |
---|
public FIFO_Queue()
public FIFO_Queue(int capacity)
capacity
- the maximum number of items queue can hold.Method Detail |
---|
public Q_Node addAt(java.lang.Object item) throws FullQueueException
addAt
in class Queue
item
- new item to be inserted
FullQueueException
- if queue is fullprotected void removeMin()
removeMin
in class Queue
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class Queue
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |