Klasse LinkedEnum2ShortMap<T extends Enum<T>>

Typparameter:
T - the keyType of elements maintained by this Collection
Alle implementierten Schnittstellen:
Map<T,Short>, ToShortFunction<T>, Object2ShortMap<T>, Object2ShortOrderedMap<T>

public class LinkedEnum2ShortMap<T extends Enum<T>> extends Enum2ShortMap<T> implements Object2ShortOrderedMap<T>
A Type Specific LinkedEnumMap implementation that allows for Primitive Values and faster iteration. Unlike javas implementation this one does not jump around between a single long or long array implementation based around the enum size This will cause a bit more memory usage but allows for a simpler implementation.
  • Konstruktordetails

    • LinkedEnum2ShortMap

      public LinkedEnum2ShortMap(Class<T> keyType)
      Default Constructor
      Parameter:
      keyType - the type of Enum that should be used
    • LinkedEnum2ShortMap

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

      public LinkedEnum2ShortMap(T[] keys, short[] values)
      Helper constructor that allow to create a EnumMap 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
    • LinkedEnum2ShortMap

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

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