Class Double2LongRBTreeMap

All Implemented Interfaces:
it.unimi.dsi.fastutil.doubles.Double2LongFunction, Double2LongMap, Double2LongSortedMap, it.unimi.dsi.fastutil.Function<Double,Long>, Serializable, Cloneable, DoubleToLongFunction, Function<Double,Long>, Map<Double,Long>, SequencedMap<Double,Long>, SortedMap<Double,Long>

public class Double2LongRBTreeMap extends AbstractDouble2LongSortedMap implements Serializable, Cloneable
A type-specific red-black tree map with a fast, small-footprint implementation.

The iterators provided by the views of this class are type-specific bidirectional iterators. Moreover, the iterator returned by iterator() can be safely cast to a type-specific list iterator.

See Also:
  • Field Details

    • tree

      protected transient it.unimi.dsi.fastutil.doubles.Double2LongRBTreeMap.Entry tree
      A reference to the root entry.
    • count

      protected int count
      Number of entries in this map.
    • firstEntry

      protected transient it.unimi.dsi.fastutil.doubles.Double2LongRBTreeMap.Entry firstEntry
      The first key in this map.
    • lastEntry

      protected transient it.unimi.dsi.fastutil.doubles.Double2LongRBTreeMap.Entry lastEntry
      The last key in this map.
    • entries

      protected transient it.unimi.dsi.fastutil.objects.ObjectSortedSet<Double2LongMap.Entry> entries
      Cached set of entries.
    • keys

      protected transient it.unimi.dsi.fastutil.doubles.DoubleSortedSet keys
      Cached set of keys.
    • values

      protected transient it.unimi.dsi.fastutil.longs.LongCollection values
      Cached collection of values.
    • modified

      protected transient boolean modified
      The value of this variable remembers, after a put() or a remove(), whether the domain of the map has been modified.
    • storedComparator

      protected Comparator<? super Double> storedComparator
      This map's comparator, as provided in the constructor.
    • actualComparator

      protected transient it.unimi.dsi.fastutil.doubles.DoubleComparator actualComparator
      This map's actual comparator; it may differ from storedComparator because it is always a type-specific comparator, so it could be derived from the former by wrapping.
  • Constructor Details

    • Double2LongRBTreeMap

      public Double2LongRBTreeMap()
      Creates a new empty tree map.
    • Double2LongRBTreeMap

      public Double2LongRBTreeMap(Comparator<? super Double> c)
      Creates a new empty tree map with the given comparator.
      Parameters:
      c - a (possibly type-specific) comparator.
    • Double2LongRBTreeMap

      public Double2LongRBTreeMap(Map<? extends Double,? extends Long> m)
      Creates a new tree map copying a given map.
      Parameters:
      m - a Map to be copied into the new tree map.
    • Double2LongRBTreeMap

      public Double2LongRBTreeMap(SortedMap<Double,Long> m)
      Creates a new tree map copying a given sorted map (and its Comparator).
      Parameters:
      m - a SortedMap to be copied into the new tree map.
    • Double2LongRBTreeMap

      public Double2LongRBTreeMap(Double2LongMap m)
      Creates a new tree map copying a given map.
      Parameters:
      m - a type-specific map to be copied into the new tree map.
    • Double2LongRBTreeMap

      public Double2LongRBTreeMap(Double2LongSortedMap m)
      Creates a new tree map copying a given sorted map (and its Comparator).
      Parameters:
      m - a type-specific sorted map to be copied into the new tree map.
    • Double2LongRBTreeMap

      public Double2LongRBTreeMap(double[] k, long[] v, Comparator<? super Double> c)
      Creates a new tree map using the elements of two parallel arrays and the given comparator.
      Parameters:
      k - the array of keys of the new tree map.
      v - the array of corresponding values in the new tree map.
      c - a (possibly type-specific) comparator.
      Throws:
      IllegalArgumentException - if k and v have different lengths.
    • Double2LongRBTreeMap

      public Double2LongRBTreeMap(double[] k, long[] v)
      Creates a new tree map using the elements of two parallel arrays.
      Parameters:
      k - the array of keys of the new tree map.
      v - the array of corresponding values in the new tree map.
      Throws:
      IllegalArgumentException - if k and v have different lengths.
  • Method Details