A scalable concurrent
NavigableSet implementation based on
ConcurrentSkipListMap. The elements of the set are kept
sorted according to their natural ordering,
or by a
Comparator provided at set creation time, depending
on which constructor is used.
This implementation provides expected average log(n) time
cost for the
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
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
toArray are not guaranteed
to be performed atomically. For example, an iterator operating
concurrently with an
addAll operation might view only some
of the added elements.
This class and its iterators implement all of the
optional methods of the
interfaces. Like most other concurrent collection implementations,
this class does not permit the use of
null arguments and return values cannot be reliably
distinguished from the absence of elements.
This class is a member of the Java Collections Framework.
|the type of elements maintained by this set|