public class

CopyOnWriteSortedCache

extends Object
implements Iterable<T>
java.lang.Object
   ↳ com.atlassian.jira.util.collect.CopyOnWriteSortedCache<T extends java.lang.Comparable<T>>

Class Overview

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.

Summary

Public Constructors
CopyOnWriteSortedCache(Iterable<T> elements)
Public Methods
T add(T t)
List<T> asList()
An unmodifiable List view of the underlying data that does not change.
SortedSet<T> asSortedSet()
An unmodifiable SortedSet view of the underlying data that does not change.
Iterator<T> iterator()
void remove(T t)
void replaceAll(Iterable<T> elements)
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Iterable

Public Constructors

public CopyOnWriteSortedCache (Iterable<T> elements)

Public Methods

public T add (T t)

public List<T> asList ()

An unmodifiable List view of the underlying data that does not change.

Returns
  • a List containing all the elements as at the time the call was made.

public SortedSet<T> asSortedSet ()

An unmodifiable SortedSet view of the underlying data that does not change.

Returns
  • a SortedSet containing all the elements as at the time the call was made.

public Iterator<T> iterator ()

public void remove (T t)

public void replaceAll (Iterable<T> elements)