Class Int2LongRBTreeMap

All Implemented Interfaces:
Function<Integer,Long>, Int2LongFunction, Int2LongMap, Int2LongSortedMap, Serializable, Cloneable, Function<Integer,Long>, IntToLongFunction, Map<Integer,Long>, SequencedMap<Integer,Long>, SortedMap<Integer,Long>

public class Int2LongRBTreeMap extends AbstractInt2LongSortedMap 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:
  • Constructor Details

    • Int2LongRBTreeMap

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

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

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

      public Int2LongRBTreeMap(SortedMap<Integer,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.
    • Int2LongRBTreeMap

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

      public Int2LongRBTreeMap(Int2LongSortedMap 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.
    • Int2LongRBTreeMap

      public Int2LongRBTreeMap(int[] k, long[] v, Comparator<? super Integer> 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.
    • Int2LongRBTreeMap

      public Int2LongRBTreeMap(int[] 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