|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.epfl.lpd.ids.utils.MyBlockingQueue<T>
public class MyBlockingQueue<T>
Class implementing the IBlockingQueue. This class represents a
blocking queue and waits until no new element are in the queue.
This class is generic and accepts objects of type T.
| Field Summary | |
|---|---|
protected ArrayList<T> |
arrayList
The array containing all the objects of the queue. |
| Constructor Summary | |
|---|---|
MyBlockingQueue()
Creates a new instance of MyBlockingQueue. |
|
| Method Summary | |
|---|---|
T |
get()
Method used to retrieve the last, and not already get, element of this queue. |
void |
put(T obj)
Method used to put a new element of type T into the queue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ArrayList<T> arrayList
| Constructor Detail |
|---|
public MyBlockingQueue()
ArrayList
| Method Detail |
|---|
public T get()
throws InterruptedException
get in interface IBlockingQueue<T>InterruptedException - If an exception occurs
while waiting for getting the last element of the queue.public void put(T obj)
put in interface IBlockingQueue<T>obj - The object to put into the queue.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||