Klasse Byte2DoubleMaps

java.lang.Object
speiger.src.collections.bytes.utils.maps.Byte2DoubleMaps

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

    • Byte2DoubleMaps

      public Byte2DoubleMaps()
  • Methodendetails

    • empty

      public static Byte2DoubleMap empty()
      Empty Map getter function that autocasts to the desired Key and Value
      Gibt zurück:
      empty map of desired type
    • fastIterator

      public static ObjectIterator<Byte2DoubleMap.Entry> fastIterator(Byte2DoubleMap map)
      Helper method that provides the fastIterator that recycles a single Entry to increase throughput.
      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 ObjectIterable<Byte2DoubleMap.Entry> fastIterable(Byte2DoubleMap map)
      Helper method that provides the fastIterable that recycles a single Entry to increase throughput.
      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 void fastForEach(Byte2DoubleMap map, Consumer<Byte2DoubleMap.Entry> action)
      A Helper function that provides a faster forEach iterator implementation that recycles the entry to increase throughput
      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 Byte2DoubleMap synchronize(Byte2DoubleMap map)
      Helper function that creates a Helper wrapper to synchronize access into the map.
      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 Byte2DoubleMap synchronize(Byte2DoubleMap map, Object mutex)
      Helper function that creates a Helper wrapper to synchronize access with custom access control into the map.
      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 Byte2DoubleSortedMap synchronize(Byte2DoubleSortedMap map)
      Helper function that creates a Helper wrapper to synchronize access into the SortedMap.
      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 Byte2DoubleSortedMap synchronize(Byte2DoubleSortedMap map, Object mutex)
      Helper function that creates a Helper wrapper to synchronize access with custom access control into the SortedMap.
      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 Byte2DoubleOrderedMap synchronize(Byte2DoubleOrderedMap map)
      Helper function that creates a Helper wrapper to synchronize access into the OrderedMap.
      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 Byte2DoubleOrderedMap synchronize(Byte2DoubleOrderedMap map, Object mutex)
      Helper function that creates a Helper wrapper to synchronize access with custom access control into the OrderedMap.
      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 Byte2DoubleNavigableMap synchronize(Byte2DoubleNavigableMap map)
      Helper function that creates a Helper wrapper to synchronize access into the NavigableMap.
      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 Byte2DoubleNavigableMap synchronize(Byte2DoubleNavigableMap map, Object mutex)
      Helper function that creates a Helper wrapper to synchronize access with custom access control into the NavigableMap.
      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 Byte2DoubleMap unmodifiable(Byte2DoubleMap map)
      A Helper function that creates a Helper wrapper to only allow Read Access into the Map
      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 Byte2DoubleOrderedMap unmodifiable(Byte2DoubleOrderedMap map)
      A Helper function that creates a Helper wrapper to only allow Read Access into the OrderedMap
      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 Byte2DoubleSortedMap unmodifiable(Byte2DoubleSortedMap map)
      A Helper function that creates a Helper wrapper to only allow Read Access into the SortedMap
      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 Byte2DoubleNavigableMap unmodifiable(Byte2DoubleNavigableMap map)
      A Helper function that creates a Helper wrapper to only allow Read Access into NavigableMap Map
      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 Byte2DoubleMap.Entry unmodifiable(Byte2DoubleMap.Entry entry)
      A Helper function that creates a Unmodifyable Entry
      Parameter:
      entry - the Entry that should be made unmodifiable
      Gibt zurück:
      a Unmodifyable Entry
    • unmodifiable

      public static Byte2DoubleMap.Entry unmodifiable(Map.Entry<Byte,Double> entry)
      A Helper function that creates a Unmodifyable Entry
      Parameter:
      entry - the Entry that should be made unmodifiable
      Gibt zurück:
      a Unmodifyable Entry
    • singleton

      public static Byte2DoubleMap singleton(byte key, double value)
      Creates a Singleton map from the provided values. This reduces overhead that normal Map implementations have.
      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.