com.waveset.util
Class SynchronizedQueue
java.lang.Object
com.waveset.util.Queue
com.waveset.util.SynchronizedQueue
- Direct Known Subclasses:
- BlockingQueue
- public class SynchronizedQueue
- extends Queue
Field Summary |
static java.lang.String |
code_id
|
Method Summary |
void |
clear()
|
java.lang.Object |
dequeue(boolean waitIfEmpty)
|
void |
enqueue(java.lang.Object obj)
Add the specified item to the back of the queue. |
java.lang.Object |
findEquivalent(java.lang.Object o)
Return the object in the queue matching
the requested one. |
static void |
main(java.lang.String[] args)
|
java.lang.Object |
peek(int i)
|
void |
poke(int i,
java.lang.Object o)
|
boolean |
remove(java.lang.Object o)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
code_id
public static final java.lang.String code_id
- See Also:
- Constant Field Values
SynchronizedQueue
public SynchronizedQueue()
dequeue
public java.lang.Object dequeue(boolean waitIfEmpty)
throws java.lang.InterruptedException
- Parameters:
waitIfEmpty
- if true
, causes the method to block
until the caller is notified or interrupted.
- Returns:
- the next item from the front of the queue.
- Throws:
java.lang.InterruptedException
- if the thread is interrupted
while waiting.
enqueue
public void enqueue(java.lang.Object obj)
- Add the specified item to the back of the queue.
Notify one of the callers waiting to dequeue.
- Overrides:
enqueue
in class Queue
peek
public java.lang.Object peek(int i)
- Overrides:
peek
in class Queue
poke
public void poke(int i,
java.lang.Object o)
- Overrides:
poke
in class Queue
findEquivalent
public java.lang.Object findEquivalent(java.lang.Object o)
- Description copied from class:
Queue
- Return the object in the queue matching
the requested one.
Primarily used for matching by equivalence class.
- Overrides:
findEquivalent
in class Queue
remove
public boolean remove(java.lang.Object o)
- Overrides:
remove
in class Queue
clear
public void clear()
- Overrides:
clear
in class Queue
main
public static void main(java.lang.String[] args)