Build 1.0_r1(from source)

java.util
Class Collections.SynchronizedSortedMap<K,V>

java.lang.Object
  extended by java.util.Collections.SynchronizedMap<K,V>
      extended by java.util.Collections.SynchronizedSortedMap<K,V>
All Implemented Interfaces:
Serializable, Map<K,V>, SortedMap<K,V>
Enclosing class:
Collections

static class Collections.SynchronizedSortedMap<K,V>
extends Collections.SynchronizedMap<K,V>
implements SortedMap<K,V>


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class java.util.Collections.SynchronizedMap
mutex
 
Constructor Summary
Collections.SynchronizedSortedMap(SortedMap<K,V> map)
           
Collections.SynchronizedSortedMap(SortedMap<K,V> map, Object mutex)
           
 
Method Summary
 Comparator<? super K> comparator()
          Returns the Comparator used to compare elements in this SortedMap.
 K firstKey()
          Answer the first sorted key in this SortedMap.
 SortedMap<K,V> headMap(K endKey)
          Returns a SortedMap of the specified portion of this SortedMap which contains keys less than the end key.
 K lastKey()
          Returns the last sorted key in this SortedMap.
 SortedMap<K,V> subMap(K startKey, K endKey)
          Returns a SortedMap of the specified portion of this SortedMap which contains keys greater or equal to the start key but less than the end key.
 SortedMap<K,V> tailMap(K startKey)
          Returns a SortedMap of the specified portion of this SortedMap which contains keys greater or equal to the start key.
 
Methods inherited from class java.util.Collections.SynchronizedMap
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, 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

Collections.SynchronizedSortedMap

Collections.SynchronizedSortedMap(SortedMap<K,V> map)

Collections.SynchronizedSortedMap

Collections.SynchronizedSortedMap(SortedMap<K,V> map,
                                  Object mutex)
Method Detail

comparator

public Comparator<? super K> comparator()
Description copied from interface: SortedMap
Returns the Comparator used to compare elements in this SortedMap.

Specified by:
comparator in interface SortedMap<K,V>
Returns:
a Comparator or null if the natural order is used

firstKey

public K firstKey()
Description copied from interface: SortedMap
Answer the first sorted key in this SortedMap.

Specified by:
firstKey in interface SortedMap<K,V>
Returns:
the first sorted key

headMap

public SortedMap<K,V> headMap(K endKey)
Description copied from interface: SortedMap
Returns a SortedMap of the specified portion of this SortedMap which contains keys less than the end key. Users should be aware that the return value is actually backed by this SortedMap. Hence any modifications made to one will be immediately visible to the other.

Specified by:
headMap in interface SortedMap<K,V>
Parameters:
endKey - the end key
Returns:
a submap where the keys are less than endKey

lastKey

public K lastKey()
Description copied from interface: SortedMap
Returns the last sorted key in this SortedMap.

Specified by:
lastKey in interface SortedMap<K,V>
Returns:
the last sorted key

subMap

public SortedMap<K,V> subMap(K startKey,
                             K endKey)
Description copied from interface: SortedMap
Returns a SortedMap of the specified portion of this SortedMap which contains keys greater or equal to the start key but less than the end key. Users should be aware that the return value is actually backed by this SortedMap. Hence any modifications made to one will be immediately visible to the other.

Specified by:
subMap in interface SortedMap<K,V>
Parameters:
startKey - the start key
endKey - the end key
Returns:
a submap where the keys are greater or equal to startKey and less than endKey

tailMap

public SortedMap<K,V> tailMap(K startKey)
Description copied from interface: SortedMap
Returns a SortedMap of the specified portion of this SortedMap which contains keys greater or equal to the start key. The returned SortedMap is backed by this SortedMap so changes to one are reflected by the other.

Specified by:
tailMap in interface SortedMap<K,V>
Parameters:
startKey - the start key
Returns:
a submap where the keys are greater or equal to startKey

Build 1.0_r1(from source)

Please submit a feedback, bug or feature