Methods Summary |
---|
public synchronized java.lang.Object | get()Get the first object out of the queue. Return null if the queue
is empty.
Object object = peek();
if (object != null)
vector.removeElementAt(0);
return object;
|
public boolean | isEmpty()Is the queue empty?
return vector.isEmpty();
|
public java.lang.Object | peek()Peek to see if something is available.
if (isEmpty())
return null;
return vector.elementAt(0);
|
public synchronized java.lang.Object | pull()Pull the first object out of the queue. Wait if the queue is
empty.
while (isEmpty())
try {
wait();
} catch (InterruptedException ex) {
}
return get();
|
public synchronized void | put(java.lang.Object object)Put the object into the queue.
vector.addElement(object);
notify();
|
public int | size()How many elements are there in this queue?
return vector.size();
|