public class

SynchronizedSortedSet

extends SynchronizedCollection
implements SortedSet<E>
java.lang.Object
   ↳ org.apache.commons.collections.collection.SynchronizedCollection
     ↳ org.apache.commons.collections.set.SynchronizedSortedSet

Class Overview

Decorates another SortedSet to synchronize its behaviour for a multi-threaded environment.

Methods are synchronized, then forwarded to the decorated set.

This class is Serializable from Commons Collections 3.1.

Summary

[Expand]
Inherited Fields
From class org.apache.commons.collections.collection.SynchronizedCollection
Protected Constructors
SynchronizedSortedSet(SortedSet set)
Constructor that wraps (not copies).
SynchronizedSortedSet(SortedSet set, Object lock)
Constructor that wraps (not copies).
Public Methods
Comparator comparator()
static SortedSet decorate(SortedSet set)
Factory method to create a synchronized set.
Object first()
SortedSet headSet(Object toElement)
Object last()
SortedSet subSet(Object fromElement, Object toElement)
SortedSet tailSet(Object fromElement)
Protected Methods
SortedSet getSortedSet()
Gets the decorated set.
[Expand]
Inherited Methods
From class org.apache.commons.collections.collection.SynchronizedCollection
From class java.lang.Object
From interface java.lang.Iterable
From interface java.util.Collection
From interface java.util.Set
From interface java.util.SortedSet

Protected Constructors

protected SynchronizedSortedSet (SortedSet set)

Constructor that wraps (not copies).

Parameters
set the set to decorate, must not be null
Throws
IllegalArgumentException if set is null

protected SynchronizedSortedSet (SortedSet set, Object lock)

Constructor that wraps (not copies).

Parameters
set the set to decorate, must not be null
lock the lock object to use, must not be null
Throws
IllegalArgumentException if set is null

Public Methods

public Comparator comparator ()

public static SortedSet decorate (SortedSet set)

Factory method to create a synchronized set.

Parameters
set the set to decorate, must not be null
Throws
IllegalArgumentException if set is null

public Object first ()

public SortedSet headSet (Object toElement)

public Object last ()

public SortedSet subSet (Object fromElement, Object toElement)

public SortedSet tailSet (Object fromElement)

Protected Methods

protected SortedSet getSortedSet ()

Gets the decorated set.

Returns
  • the decorated set