EDU.oswego.cs.dl.util.concurrent

Class SyncSortedSet

public class SyncSortedSet extends SyncSet implements SortedSet

SyncSortedSets wrap Sync-based control around java.util.SortedSets. They support the following additional reader operations over SyncCollection: comparator, subSet, headSet, tailSet, first, last.

[ Introduction to this package. ]

See Also:

Constructor Summary
SyncSortedSet(SortedSet set, Sync sync)
Create a new SyncSortedSet protecting the given collection, and using the given sync to control both reader and writer methods.
SyncSortedSet(SortedSet set, ReadWriteLock rwl)
Create a new SyncSortedSet protecting the given set, and using the given ReadWriteLock to control reader and writer methods.
SyncSortedSet(SortedSet set, Sync readLock, Sync writeLock)
Create a new SyncSortedSet protecting the given set, and using the given pair of locks to control reader and writer methods.
Method Summary
protected SortedSetbaseSortedSet()
Comparatorcomparator()
Objectfirst()
SortedSetheadSet(Object toElement)
Objectlast()
SortedSetsubSet(Object fromElement, Object toElement)
SortedSettailSet(Object fromElement)

Constructor Detail

SyncSortedSet

public SyncSortedSet(SortedSet set, Sync sync)
Create a new SyncSortedSet protecting the given collection, and using the given sync to control both reader and writer methods. Common, reasonable choices for the sync argument include Mutex, ReentrantLock, and Semaphores initialized to 1.

SyncSortedSet

public SyncSortedSet(SortedSet set, ReadWriteLock rwl)
Create a new SyncSortedSet protecting the given set, and using the given ReadWriteLock to control reader and writer methods.

SyncSortedSet

public SyncSortedSet(SortedSet set, Sync readLock, Sync writeLock)
Create a new SyncSortedSet protecting the given set, and using the given pair of locks to control reader and writer methods.

Method Detail

baseSortedSet

protected SortedSet baseSortedSet()

comparator

public Comparator comparator()

first

public Object first()

headSet

public SortedSet headSet(Object toElement)

last

public Object last()

subSet

public SortedSet subSet(Object fromElement, Object toElement)

tailSet

public SortedSet tailSet(Object fromElement)