Colt 1.0.2

edu.oswego.cs.dl.util.concurrent
Class SyncSortedMap

java.lang.Object
  |
  +--edu.oswego.cs.dl.util.concurrent.SyncMap
        |
        +--edu.oswego.cs.dl.util.concurrent.SyncSortedMap
All Implemented Interfaces:
Map, SortedMap

public class SyncSortedMap
extends SyncMap
implements SortedMap

SyncSortedMaps wrap Sync-based control around java.util.SortedMaps. They support the following additional reader operations over SyncMap: comparator, subMap, headMap, tailMap, firstKey, lastKey.

[ Introduction to this package. ]

See Also:
SyncCollection

Inner classes inherited from class java.util.Map
Map.Entry
 
Constructor Summary
SyncSortedMap(SortedMap map, ReadWriteLock rwl)
          Create a new SyncSortedMap protecting the given map, and using the given ReadWriteLock to control reader and writer methods.
SyncSortedMap(SortedMap map, Sync sync)
          Create a new SyncSortedMap protecting the given map, and using the given sync to control both reader and writer methods.
SyncSortedMap(SortedMap map, Sync readLock, Sync writeLock)
          Create a new SyncSortedMap protecting the given map, and using the given pair of locks to control reader and writer methods.
 
Method Summary
 Comparator comparator()
           
 Object firstKey()
           
 SortedMap headMap(Object toElement)
           
 Object lastKey()
           
 SortedMap subMap(Object fromElement, Object toElement)
           
 SortedMap tailMap(Object fromElement)
           
 
Methods inherited from class edu.oswego.cs.dl.util.concurrent.SyncMap
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, readerSync, remove, size, syncFailures, values, writerSync
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

SyncSortedMap

public SyncSortedMap(SortedMap map,
                     ReadWriteLock rwl)
Create a new SyncSortedMap protecting the given map, and using the given ReadWriteLock to control reader and writer methods.

SyncSortedMap

public SyncSortedMap(SortedMap map,
                     Sync sync)
Create a new SyncSortedMap 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.

SyncSortedMap

public SyncSortedMap(SortedMap map,
                     Sync readLock,
                     Sync writeLock)
Create a new SyncSortedMap protecting the given map, and using the given pair of locks to control reader and writer methods.
Method Detail

comparator

public Comparator comparator()
Specified by:
comparator in interface SortedMap

firstKey

public Object firstKey()
Specified by:
firstKey in interface SortedMap

headMap

public SortedMap headMap(Object toElement)
Specified by:
headMap in interface SortedMap

lastKey

public Object lastKey()
Specified by:
lastKey in interface SortedMap

subMap

public SortedMap subMap(Object fromElement,
                        Object toElement)
Specified by:
subMap in interface SortedMap

tailMap

public SortedMap tailMap(Object fromElement)
Specified by:
tailMap in interface SortedMap

Colt 1.0.2

Submit a bug or feature. Check the Colt home page for the latest news.