Klasse Short2ObjectMaps

java.lang.Object
speiger.src.collections.shorts.utils.maps.Short2ObjectMaps

public class Short2ObjectMaps extends Object
A Helper class that provides you with Singleton/Empty/Synchronized/Unmodifyable Maps
  • Konstruktordetails

    • Short2ObjectMaps

      public Short2ObjectMaps()
  • Methodendetails

    • empty

      public static <V> Short2ObjectMap<V> empty()
      Empty Map getter function that autocasts to the desired Key and Value
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Gibt zurück:
      empty map of desired type
    • fastIterator

      public static <V> ObjectIterator<Short2ObjectMap.Entry<V>> fastIterator(Short2ObjectMap<V> map)
      Helper method that provides the fastIterator that recycles a single Entry to increase throughput.
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the map the fastIterator should be accessed from
      Gibt zurück:
      either a normal iterator if it does not support this feature to a fastIterator
    • fastIterable

      public static <V> ObjectIterable<Short2ObjectMap.Entry<V>> fastIterable(Short2ObjectMap<V> map)
      Helper method that provides the fastIterable that recycles a single Entry to increase throughput.
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the map the fastIterable should be accessed from
      Gibt zurück:
      either a normal iterable if it does not support this feature to a fastIterable
    • fastForEach

      public static <V> void fastForEach(Short2ObjectMap<V> map, Consumer<Short2ObjectMap.Entry<V>> action)
      A Helper function that provides a faster forEach iterator implementation that recycles the entry to increase throughput
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the map the fast forEach should be accessed from
      action - the action that should be performed on each entry
      Note:
      if the fast forEach is not supported will default to a normal forEach
    • synchronize

      public static <V> Short2ObjectMap<V> synchronize(Short2ObjectMap<V> map)
      Helper function that creates a Helper wrapper to synchronize access into the map.
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the map that should be synchronized
      Gibt zurück:
      a synchronized Map
      Note:
      if the inputted map is already synchronized then it will just return it instead, iterators do not support synchronization
    • synchronize

      public static <V> Short2ObjectMap<V> synchronize(Short2ObjectMap<V> map, Object mutex)
      Helper function that creates a Helper wrapper to synchronize access with custom access control into the map.
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the map that should be synchronized
      mutex - the object that controls access
      Gibt zurück:
      a synchronized Map
      Note:
      if the inputted map is already synchronized then it will just return it instead, iterators do not support synchronization
    • synchronize

      public static <V> Short2ObjectSortedMap<V> synchronize(Short2ObjectSortedMap<V> map)
      Helper function that creates a Helper wrapper to synchronize access into the SortedMap.
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the SortedMap that should be synchronized
      Gibt zurück:
      a synchronized SortedMap
      Note:
      if the inputted map is already synchronized then it will just return it instead, iterators do not support synchronization
    • synchronize

      public static <V> Short2ObjectSortedMap<V> synchronize(Short2ObjectSortedMap<V> map, Object mutex)
      Helper function that creates a Helper wrapper to synchronize access with custom access control into the SortedMap.
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the SortedMap that should be synchronized
      mutex - the object that controls access
      Gibt zurück:
      a synchronized SortedMap
      Note:
      if the inputted map is already synchronized then it will just return it instead, iterators do not support synchronization
    • synchronize

      public static <V> Short2ObjectOrderedMap<V> synchronize(Short2ObjectOrderedMap<V> map)
      Helper function that creates a Helper wrapper to synchronize access into the OrderedMap.
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the OrderedMap that should be synchronized
      Gibt zurück:
      a synchronized OrderedMap
      Note:
      if the inputted map is already synchronized then it will just return it instead, iterators do not support synchronization
    • synchronize

      public static <V> Short2ObjectOrderedMap<V> synchronize(Short2ObjectOrderedMap<V> map, Object mutex)
      Helper function that creates a Helper wrapper to synchronize access with custom access control into the OrderedMap.
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the OrderedMap that should be synchronized
      mutex - the object that controls access
      Gibt zurück:
      a synchronized OrderedMap
      Note:
      if the inputted map is already synchronized then it will just return it instead, iterators do not support synchronization
    • synchronize

      public static <V> Short2ObjectNavigableMap<V> synchronize(Short2ObjectNavigableMap<V> map)
      Helper function that creates a Helper wrapper to synchronize access into the NavigableMap.
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the NavigableMap that should be synchronized
      Gibt zurück:
      a synchronized NavigableMap
      Note:
      if the inputted map is already synchronized then it will just return it instead, iterators do not support synchronization
    • synchronize

      public static <V> Short2ObjectNavigableMap<V> synchronize(Short2ObjectNavigableMap<V> map, Object mutex)
      Helper function that creates a Helper wrapper to synchronize access with custom access control into the NavigableMap.
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the NavigableMap that should be synchronized
      mutex - the object that controls access
      Gibt zurück:
      a synchronized NavigableMap
      Note:
      if the inputted map is already synchronized then it will just return it instead, iterators do not support synchronization
    • unmodifiable

      public static <V> Short2ObjectMap<V> unmodifiable(Short2ObjectMap<V> map)
      A Helper function that creates a Helper wrapper to only allow Read Access into the Map
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the map that should be made Unmodifiable
      Gibt zurück:
      a unmodifiable Map
      Note:
      if the inputted map is already unmodifiable then it will just return it instead
    • unmodifiable

      public static <V> Short2ObjectOrderedMap<V> unmodifiable(Short2ObjectOrderedMap<V> map)
      A Helper function that creates a Helper wrapper to only allow Read Access into the OrderedMap
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the OrderedMap that should be made Unmodifiable
      Gibt zurück:
      a unmodifiable OrderedMap
      Note:
      if the inputted OrderedMap is already unmodifiable then it will just return it instead
    • unmodifiable

      public static <V> Short2ObjectSortedMap<V> unmodifiable(Short2ObjectSortedMap<V> map)
      A Helper function that creates a Helper wrapper to only allow Read Access into the SortedMap
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the SortedMap that should be made Unmodifiable
      Gibt zurück:
      a unmodifiable SortedMap
      Note:
      if the inputted SortedMap is already unmodifiable then it will just return it instead
    • unmodifiable

      public static <V> Short2ObjectNavigableMap<V> unmodifiable(Short2ObjectNavigableMap<V> map)
      A Helper function that creates a Helper wrapper to only allow Read Access into NavigableMap Map
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      map - the NavigableMap that should be made Unmodifiable
      Gibt zurück:
      a unmodifiable NavigableMap
      Note:
      if the inputted NavigableMap is already unmodifiable then it will just return it instead
    • unmodifiable

      public static <V> Short2ObjectMap.Entry<V> unmodifiable(Short2ObjectMap.Entry<V> entry)
      A Helper function that creates a Unmodifyable Entry
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      entry - the Entry that should be made unmodifiable
      Gibt zurück:
      a Unmodifyable Entry
    • unmodifiable

      public static <V> Short2ObjectMap.Entry<V> unmodifiable(Map.Entry<Short,V> entry)
      A Helper function that creates a Unmodifyable Entry
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      entry - the Entry that should be made unmodifiable
      Gibt zurück:
      a Unmodifyable Entry
    • singleton

      public static <V> Short2ObjectMap<V> singleton(short key, V value)
      Creates a Singleton map from the provided values. This reduces overhead that normal Map implementations have.
      Typparameter:
      V - the keyType of elements maintained by this Collection
      Parameter:
      key - the key that should be turned into a singleton
      value - the value that should be turned into a singleton
      Gibt zurück:
      a unmodifiable Singleton map.