net.sf.beanlib.utils
Class CollectionUtils.SynchronizedSortedRangeMap<T,K,V>

java.lang.Object
  extended by net.sf.beanlib.utils.CollectionUtils.SynchronizedMap<K,V>
      extended by net.sf.beanlib.utils.CollectionUtils.SynchronizedSortedMap<K,V>
          extended by net.sf.beanlib.utils.CollectionUtils.SynchronizedSortedRangeMap<T,K,V>
All Implemented Interfaces:
Serializable, Map<K,V>, SortedMap<K,V>, SortedRangeMap<T,K,V>
Enclosing class:
CollectionUtils

static class CollectionUtils.SynchronizedSortedRangeMap<T,K,V>
extends CollectionUtils.SynchronizedSortedMap<K,V>
implements SortedRangeMap<T,K,V>

A thread-safe SortedRangeMap.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
private static long serialVersionUID
           
private  SortedRangeMap<T,K,V> srm
           
 
Fields inherited from class net.sf.beanlib.utils.CollectionUtils.SynchronizedMap
mutex
 
Constructor Summary
CollectionUtils.SynchronizedSortedRangeMap(SortedRangeMap<T,K,V> srm)
           
CollectionUtils.SynchronizedSortedRangeMap(SortedRangeMap<T,K,V> srm, Object mutex)
           
 
Method Summary
 boolean containsKeyPoint(Comparable<T> point)
          Returns true if this map contains a mapping of a key with a range that the specified point falls within.
 V getByPoint(Comparable<T> point)
          Returns the value to which this map maps a key with a range that the specified point falls within.
 
Methods inherited from class net.sf.beanlib.utils.CollectionUtils.SynchronizedSortedMap
comparator, firstKey, headMap, lastKey, subMap, tailMap
 
Methods inherited from class net.sf.beanlib.utils.CollectionUtils.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.SortedMap
comparator, firstKey, headMap, lastKey, subMap, tailMap
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

srm

private SortedRangeMap<T,K,V> srm
Constructor Detail

CollectionUtils.SynchronizedSortedRangeMap

CollectionUtils.SynchronizedSortedRangeMap(SortedRangeMap<T,K,V> srm)

CollectionUtils.SynchronizedSortedRangeMap

CollectionUtils.SynchronizedSortedRangeMap(SortedRangeMap<T,K,V> srm,
                                           Object mutex)
Method Detail

getByPoint

public V getByPoint(Comparable<T> point)
Description copied from interface: SortedRangeMap
Returns the value to which this map maps a key with a range that the specified point falls within. Returns null if the map contains no mapping for any key with such range. A return value of null does not necessarily indicate that the map contains no mapping for a key with such range; it's also possible that the map explicitly maps the key with such range to null. The containsKeyPoint operation may be used to distinguish these two cases.

Specified by:
getByPoint in interface SortedRangeMap<T,K,V>
Parameters:
point - the point that falls within the range of a key whose associated value is to be returned.
Returns:
the value to which this map maps a key with a range that the specified point falls within, or null if the map contains no mapping for any key with such range.
See Also:
SortedRangeMap.containsKeyPoint(Comparable)

containsKeyPoint

public boolean containsKeyPoint(Comparable<T> point)
Description copied from interface: SortedRangeMap
Returns true if this map contains a mapping of a key with a range that the specified point falls within.

Specified by:
containsKeyPoint in interface SortedRangeMap<T,K,V>
Parameters:
point - point to be tested.
Returns:
true if this map contains a mapping of a key with a range that the specified point falls within.