This implementation provides expected average log(n) time cost for the {@code contains}, {@code add}, and {@code remove}operations and their variants. Insertion, removal, and access operations safely execute concurrently by multiple threads.
Iterators and spliterators are weakly consistent.
Ascending ordered views and their iterators are faster than descending ones.
Beware that, unlike in most collections, the {@code size}method is not a constant-time operation. Because of the asynchronous nature of these sets, determining the current number of elements requires a traversal of the elements, and so may report inaccurate results if this collection is modified during traversal. Additionally, the bulk operations {@code addAll}, {@code removeAll}, {@code retainAll}, {@code containsAll}, {@code equals}, and {@code toArray} are not guaranteedto be performed atomically. For example, an iterator operating concurrently with an {@code addAll} operation might view only someof the added elements.
This class and its iterators implement all of the optional methods of the {@link Set} and {@link Iterator}interfaces. Like most other concurrent collection implementations, this class does not permit the use of {@code null} elements,because {@code null} arguments and return values cannot be reliablydistinguished from the absence of elements.
This class is a member of the Java Collections Framework. @author Doug Lea @param < E> the type of elements maintained by this set @since 1.6
|
|