Package org.apache.mina.util
Class SynchronizedQueue<E>
- java.lang.Object
-
- org.apache.mina.util.SynchronizedQueue<E>
-
- Type Parameters:
E- The type of elements stored in the queue
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>,Queue<E>
public class SynchronizedQueue<E> extends Object implements Queue<E>, Serializable
A decorator that makes the specifiedQueuethread-safe. Like any other synchronizing wrappers, iteration is not thread-safe.- Author:
- Apache MINA Project
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SynchronizedQueue(Queue<E> queue)Create a new SynchronizedQueue instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanaddAll(Collection<? extends E> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)Eelement()booleanequals(Object obj)inthashCode()booleanisEmpty()Iterator<E>iterator()booleanoffer(E e)Epeek()Epoll()Eremove()booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()Object[]toArray()<T> T[]toArray(T[] a)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Method Detail
-
add
public boolean add(E e)
-
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAllin interfaceCollection<E>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<E>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<E>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<E>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<E>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<E>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<E>
-
size
public int size()
- Specified by:
sizein interfaceCollection<E>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceCollection<E>
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceCollection<E>- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<E>- Overrides:
hashCodein classObject
-
-