E - the type of the elements in the bag.public interface ConcurrentBag<E> extends Bag<E>
Bag providing thread safety and atomicity guarantees.| Modifier and Type | Method and Description |
|---|---|
int |
addAllAbsent(Collection<? extends E> c)
Adds all of the elements in the specified collection that are not
already contained in this bag.
|
boolean |
addIfAbsent(E e)
Adds the given element to this bag if not already present.
|
int addAllAbsent(Collection<? extends E> c)
c - the collection containing elements to be added to this bag.NullPointerException - if the given collection is null
or if it contains a null reference.boolean addIfAbsent(E e)
e - the element to be added to this bag, if absent.true if the element has been added.NullPointerException - if e is null.Copyright © 2012–2015. All rights reserved.