public class SynchronizedQueue
extends java.lang.Object
Constructor and Description |
---|
SynchronizedQueue() |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object object)
Adds an object to this queue.
|
void |
clear()
Clears this queue.
|
java.lang.Object |
first()
Gets the first object in this queue.
|
boolean |
isEmpty()
Gets whether this queue is empty.
|
boolean |
isEnabled()
Gets whether this queue is enabled
|
java.lang.Object |
last()
Gets the last object in this queue.
|
java.lang.Object |
remove()
Removes an object from this queue; blocks if this queue is empty.
|
java.lang.Object |
remove(long timeout)
Removes an object from this queue; blocks for a specified interval if
this queue is empty.
|
void |
setEnabled(boolean enabled)
Sets whether this queue is enabled.
|
public void add(java.lang.Object object)
object
- A non-null object.public java.lang.Object remove() throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.Object remove(long timeout) throws java.lang.InterruptedException
timeout
- A long giving the number of milliseconds to wait.java.lang.InterruptedException
public void clear()
public void setEnabled(boolean enabled)
public boolean isEnabled()
public boolean isEmpty()
public java.lang.Object first()
public java.lang.Object last()