public class SynchronizedQueue<E>
extends java.lang.Object
implements java.util.Queue<E>, java.io.Serializable
Queue thread-safe.
Like any other synchronizing wrappers, iteration is not thread-safe.| Constructor and Description |
|---|
SynchronizedQueue(java.util.Queue<E> q) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E e) |
boolean |
addAll(java.util.Collection<? extends E> c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
E |
element() |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
E |
remove() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
java.lang.String |
toString() |
public SynchronizedQueue(java.util.Queue<E> q)
public boolean add(E e)
public boolean addAll(java.util.Collection<? extends E> c)
addAll in interface java.util.Collection<E>public void clear()
clear in interface java.util.Collection<E>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<E>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<E>public boolean isEmpty()
isEmpty in interface java.util.Collection<E>public java.util.Iterator<E> iterator()
public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<E>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<E>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<E>public int size()
size in interface java.util.Collection<E>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<E>public <T> T[] toArray(T[] a)
toArray in interface java.util.Collection<E>public boolean equals(java.lang.Object obj)
equals in interface java.util.Collection<E>equals in class java.lang.Objectpublic int hashCode()
hashCode in interface java.util.Collection<E>hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object