Klasse Object2ShortRBTreeMap<T>

java.lang.Object
java.util.AbstractMap<T,Short>
speiger.src.collections.objects.maps.abstracts.AbstractObject2ShortMap<T>
speiger.src.collections.objects.maps.impl.tree.Object2ShortRBTreeMap<T>
Typparameter:
T - the keyType of elements maintained by this Collection
Alle implementierten Schnittstellen:
Map<T,Short>, NavigableMap<T,Short>, SortedMap<T,Short>, ToShortFunction<T>, Object2ShortMap<T>, Object2ShortNavigableMap<T>, Object2ShortSortedMap<T>

public class Object2ShortRBTreeMap<T> extends AbstractObject2ShortMap<T> implements Object2ShortNavigableMap<T>
A Simple Type Specific RB TreeMap implementation that reduces boxing/unboxing. It is using a bit more memory then FastUtil, but it saves a lot of Performance on the Optimized removal and iteration logic. Which makes the implementation actually useable and does not get outperformed by Javas default implementation.
  • Konstruktordetails

    • Object2ShortRBTreeMap

      public Object2ShortRBTreeMap()
      Default Constructor
    • Object2ShortRBTreeMap

      public Object2ShortRBTreeMap(Comparator<T> comp)
      Constructor that allows to define the sorter
      Parameter:
      comp - the function that decides how the tree is sorted, can be null
    • Object2ShortRBTreeMap

      public Object2ShortRBTreeMap(T[] keys, Short[] values)
      Helper constructor that allow to create a map from boxed values (it will unbox them)
      Parameter:
      keys - the keys that should be put into the map
      values - the values that should be put into the map.
      Löst aus:
      IllegalStateException - if the keys and values do not match in lenght
    • Object2ShortRBTreeMap

      public Object2ShortRBTreeMap(T[] keys, Short[] values, Comparator<T> comp)
      Helper constructor that has a custom sorter and allow to create a map from boxed values (it will unbox them)
      Parameter:
      keys - the keys that should be put into the map
      values - the values that should be put into the map.
      comp - the function that decides how the tree is sorted, can be null
      Löst aus:
      IllegalStateException - if the keys and values do not match in lenght
    • Object2ShortRBTreeMap

      public Object2ShortRBTreeMap(T[] keys, short[] values)
      Helper constructor that allow to create a map from unboxed values
      Parameter:
      keys - the keys that should be put into the map
      values - the values that should be put into the map.
      Löst aus:
      IllegalStateException - if the keys and values do not match in lenght
    • Object2ShortRBTreeMap

      public Object2ShortRBTreeMap(T[] keys, short[] values, Comparator<T> comp)
      Helper constructor that has a custom sorter and allow to create a map from unboxed values
      Parameter:
      keys - the keys that should be put into the map
      values - the values that should be put into the map.
      comp - the function that decides how the tree is sorted, can be null
      Löst aus:
      IllegalStateException - if the keys and values do not match in lenght
    • Object2ShortRBTreeMap

      public Object2ShortRBTreeMap(Map<? extends T,? extends Short> map)
      A Helper constructor that allows to create a Map with exactly the same values as the provided map.
      Parameter:
      map - the values that should be present in the map
    • Object2ShortRBTreeMap

      public Object2ShortRBTreeMap(Map<? extends T,? extends Short> map, Comparator<T> comp)
      A Helper constructor that has a custom sorter and allows to create a Map with exactly the same values as the provided map.
      Parameter:
      map - the values that should be present in the map
      comp - the function that decides how the tree is sorted, can be null
    • Object2ShortRBTreeMap

      public Object2ShortRBTreeMap(Object2ShortMap<T> map)
      A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
      Parameter:
      map - the values that should be present in the map
    • Object2ShortRBTreeMap

      public Object2ShortRBTreeMap(Object2ShortMap<T> map, Comparator<T> comp)
      A Type Specific Helper function that has a custom sorter and allows to create a new Map with exactly the same values as the provided map.
      Parameter:
      map - the values that should be present in the map
      comp - the function that decides how the tree is sorted, can be null
  • Methodendetails