Class ObjectDoubleTreeMap

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map, java.util.NavigableMap, java.util.SortedMap

    public class ObjectDoubleTreeMap
    extends java.util.TreeMap
    This class is a map which binds key Object to double value.

    This class is NOT thread safe, synchronize read and write operation when used in multi-threaded context if you really need features provided by this collection.
    In multithreaded context, it may be wiser to use alternative thread safe and type safe collection such as ConcurrentHashMap<YourType, Double>.

    Version:
    $Revision: 107378 $
    Author:
    Olivier Dedieu
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String REVISION  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getDouble​(java.lang.Object key, double defaultValue)
      Returns the value to which this map maps the specified key.
      void inc​(java.lang.Object key)
      Incremente the value associated with the specified key.
      void inc​(java.lang.Object key, double quantity)
      Incremente the value associated with the specified key.
      void put​(java.lang.Object key, double value)
      Associates the specified value with the specified key in this map.
      • Methods inherited from class java.util.TreeMap

        ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, isEmpty, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, equals, getOrDefault, hashCode, isEmpty, merge, putIfAbsent, remove
    • Constructor Detail

      • ObjectDoubleTreeMap

        public ObjectDoubleTreeMap()
    • Method Detail

      • put

        public void put​(java.lang.Object key,
                        double value)
        Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.
        Parameters:
        key - key with which the specified value is to be associated.
        value - value to be associated with the specified key.
      • inc

        public void inc​(java.lang.Object key,
                        double quantity)
        Incremente the value associated with the specified key. If this key did not exist, it is created and the value is set to '1'.
        Parameters:
        key - key for which the specified value must be incremented.
        quantity - the quantity to increment
      • inc

        public void inc​(java.lang.Object key)
        Incremente the value associated with the specified key. If this key did not exist, it is created and the value is set to '1'.
        Parameters:
        key - key for which the specified value must be incremented.
      • getDouble

        public double getDouble​(java.lang.Object key,
                                double defaultValue)
        Returns the value to which this map maps the specified key. Returns defaultValue if the map contains no mapping for this key.
        Parameters:
        key - key whose associated value is to be returned.
        defaultValue - value to return if the map contains no mapping for this key.
        Returns:
        the value to which this map maps the specified key, or defaultValue if the map contains no mapping for this key.