Package com.atlassian.jira.util.collect
Class CopyOnWriteSortedCache<T extends Comparable<T>>
java.lang.Object
com.atlassian.jira.util.collect.CopyOnWriteSortedCache<T>
- Type Parameters:
T- the element type.
- All Implemented Interfaces:
Iterable<T>
Simple copy-on-write ordered cache with
Set semantics.
This implementation supports add/remove and replace all of elements.
Note that because this implementation uses JVM-local locks, it is unsuitable for use in a clustered environment. It should therefore not be used by core JIRA for data that needs to be consistent across the cluster.
-
Constructor Details
-
CopyOnWriteSortedCache
-
-
Method Details
-
add
-
remove
-
replaceAll
-
asList
An unmodifiableListview of the underlying data that does not change.- Returns:
- a
Listcontaining all the elements as at the time the call was made.
-
asSortedSet
An unmodifiableSortedSetview of the underlying data that does not change.- Returns:
- a
SortedSetcontaining all the elements as at the time the call was made.
-
iterator
- Specified by:
iteratorin interfaceIterable<T extends Comparable<T>>
-