E - the generic type of the elements to be queued.public class ConcurrentLinkedSetQueue<E> extends ConcurrentLinkedQueue<E>
ConcurrentLinkedQueue that additionally contains a set to avoid unnecessary
duplicated entries in cases of non-concurrent additions.
Duplication may still occur if multiple threads enqueue the same objects.| Constructor and Description |
|---|
ConcurrentLinkedSetQueue() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAll(Collection<? extends E> c) |
Iterator<E> |
iterator() |
boolean |
offer(E e)
Adds the object to the tail of this queue, if not already contained.
|
E |
poll() |
boolean |
remove(Object o) |
add, contains, isEmpty, peek, size, spliterator, toArray, toArrayclear, element, removecontainsAll, removeAll, retainAll, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, containsAll, equals, hashCode, parallelStream, removeAll, removeIf, retainAll, streampublic boolean offer(E e)
offer in interface Queue<E>offer in class ConcurrentLinkedQueue<E>e - adds if not already contained the object to the tail of this queuefalse if object is already contained in queue, true otherwise.NullPointerException - - if the specified element is nullpublic E poll()
public boolean remove(Object o)
remove in interface Collection<E>remove in class ConcurrentLinkedQueue<E>public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in class ConcurrentLinkedQueue<E>Copyright © 2019. All rights reserved.