|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.Vector
fr.dyade.aaa.util.Queue
The Queue
class implements a First-In-First-Out
(FIFO) list of objects.
A queue is for the exclusive use of one single consumer, whereas many
producers may access it. It is ready for use after instanciation. A
producer may wait for the queue to be empty by calling the
stop()
method. This method returns when the queue is
actually empty, and prohibitis any further call to the push
method. To be able to use the queue again, it must be re-started through
the start()
method.
Field Summary |
Fields inherited from class java.util.Vector |
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
Queue()
Constructs a Queue instance. |
Method Summary | |
java.lang.Object |
get()
Waits for an object to be pushed in the queue, and eventually returns it without removing it. |
java.lang.Object |
pop()
Removes and returns the object at the top of this queue. |
void |
push(java.lang.Object item)
Pushes an item at the end of this queue. |
void |
start()
Authorizes the use of the queue by producers. |
void |
stop()
Stops the queue by returning when it is empty and prohibiting any further producers call to the push method. |
Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
Methods inherited from class java.util.AbstractList |
iterator, listIterator, listIterator |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
iterator, listIterator, listIterator |
Constructor Detail |
public Queue()
Queue
instance.
Method Detail |
public void push(java.lang.Object item)
item
- The item to be pushed at the end of this queue.
StoppedQueueException
- If the queue is stopping or stopped.public java.lang.Object pop()
EmptyQueueException
- If the queue is empty.public java.lang.Object get() throws java.lang.InterruptedException
java.lang.InterruptedException
public void start()
public void stop() throws java.lang.InterruptedException
push
method.
java.lang.InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |