| java.lang.Object EDU.oswego.cs.dl.util.concurrent.SyncMap
All known Subclasses: EDU.oswego.cs.dl.util.concurrent.SyncSortedMap,
SyncMap | public class SyncMap implements Map(Code) | | SyncMaps wrap Sync-based control around java.util.Maps.
They operate in the same way as SyncCollection.
Reader operations are
- size
- isEmpty
- get
- containsKey
- containsValue
- keySet
- entrySet
- values
Writer operations are:
[ Introduction to this package. ]
See Also: SyncCollection |
Constructor Summary | |
public | SyncMap(Map map, Sync sync) Create a new SyncMap protecting the given map,
and using the given sync to control both reader and writer methods. | public | SyncMap(Map map, ReadWriteLock rwl) Create a new SyncMap protecting the given map,
and using the given ReadWriteLock to control reader and writer methods. | public | SyncMap(Map map, Sync readLock, Sync writeLock) Create a new SyncMap protecting the given map,
and using the given pair of locks to control reader and writer methods. |
SyncMap | public SyncMap(Map map, Sync sync)(Code) | | Create a new SyncMap protecting the given map,
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.
|
SyncMap | public SyncMap(Map map, ReadWriteLock rwl)(Code) | | Create a new SyncMap protecting the given map,
and using the given ReadWriteLock to control reader and writer methods.
|
SyncMap | public SyncMap(Map map, Sync readLock, Sync writeLock)(Code) | | Create a new SyncMap protecting the given map,
and using the given pair of locks to control reader and writer methods.
|
afterRead | protected void afterRead(boolean wasInterrupted)(Code) | | Clean up after a reader operation *
|
beforeRead | protected boolean beforeRead()(Code) | | Try to acquire sync before a reader operation; record failure *
|
clear | public void clear()(Code) | | |
hashCode | public int hashCode()(Code) | | |
isEmpty | public boolean isEmpty()(Code) | | |
readerSync | public Sync readerSync()(Code) | | Return the Sync object managing read-only operations
|
syncFailures | public long syncFailures()(Code) | | Return the number of synchronization failures for read-only operations
|
writerSync | public Sync writerSync()(Code) | | Return the Sync object managing mutative operations
|
|
|