EDU.oswego.cs.dl.util.concurrent
Class SyncSet
- Collection, Set
public class SyncSet
implements Set
SyncSets wrap Sync-based control around java.util.Sets.
They support two additional reader operations than do
SyncCollection: hashCode and equals.
[
Introduction to this package. ]
SyncCollection
SyncSet(Set set, ReadWriteLock rwl) - Create a new SyncSet protecting the given set,
and using the given ReadWriteLock to control reader and writer methods.
|
SyncSet(Set set, Sync sync) - Create a new SyncSet protecting the given collection,
and using the given sync to control both reader and writer methods.
|
SyncSet(Set set, Sync readLock, Sync writeLock) - Create a new SyncSet protecting the given set,
and using the given pair of locks to control reader and writer methods.
|
add , addAll , afterRead , beforeRead , clear , contains , containsAll , isEmpty , iterator , readerSync , remove , removeAll , retainAll , size , syncFailures , toArray , toArray , unprotectedIterator , writerSync |
SyncSet
public SyncSet(Set set,
ReadWriteLock rwl)
Create a new SyncSet protecting the given set,
and using the given ReadWriteLock to control reader and writer methods.
SyncSet
public SyncSet(Set set,
Sync sync)
Create a new SyncSet 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.
SyncSet
public SyncSet(Set set,
Sync readLock,
Sync writeLock)
Create a new SyncSet protecting the given set,
and using the given pair of locks to control reader and writer methods.
equals
public boolean equals(Object o)
hashCode
public int hashCode()