Class Int2IntRBTreeMap

All Implemented Interfaces:
Function<Integer,Integer>, Int2IntFunction, Int2IntMap, Int2IntSortedMap, Serializable, Cloneable, Function<Integer,Integer>, IntUnaryOperator, Map<Integer,Integer>, SequencedMap<Integer,Integer>, SortedMap<Integer,Integer>

public class Int2IntRBTreeMap extends AbstractInt2IntSortedMap 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

    • Int2IntRBTreeMap

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

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

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

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

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

      public Int2IntRBTreeMap(Int2IntSortedMap 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.
    • Int2IntRBTreeMap

      public Int2IntRBTreeMap(int[] k, int[] 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.
    • Int2IntRBTreeMap

      public Int2IntRBTreeMap(int[] k, int[] 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