Schnittstelle Float2ObjectMap<V>

Typparameter:
V - the keyType of elements maintained by this Collection
Alle Superschnittstellen:
FloatFunction<V>, Map<Float,V>
Alle bekannten Unterschnittstellen:
Float2ObjectConcurrentMap<V>, Float2ObjectNavigableMap<V>, Float2ObjectOrderedMap<V>, Float2ObjectSortedMap<V>
Alle bekannten Implementierungsklassen:
AbstractFloat2ObjectMap, Float2ObjectArrayMap, Float2ObjectAVLTreeMap, Float2ObjectConcurrentOpenHashMap, Float2ObjectLinkedOpenCustomHashMap, Float2ObjectLinkedOpenHashMap, Float2ObjectMaps.EmptyMap, Float2ObjectMaps.SingletonMap, Float2ObjectMaps.SynchronizedMap, Float2ObjectMaps.SynchronizedNavigableMap, Float2ObjectMaps.SynchronizedOrderedMap, Float2ObjectMaps.SynchronizedSortedMap, Float2ObjectMaps.UnmodifyableMap, Float2ObjectMaps.UnmodifyableNavigableMap, Float2ObjectMaps.UnmodifyableOrderedMap, Float2ObjectMaps.UnmodifyableSortedMap, Float2ObjectOpenCustomHashMap, Float2ObjectOpenHashMap, Float2ObjectRBTreeMap, ImmutableFloat2ObjectOpenHashMap

public interface Float2ObjectMap<V> extends Map<Float,V>, FloatFunction<V>
A Type Specific Map that reduces memory overhead due to boxing/unboxing of Primitives and some extra helper functions.
  • Methodendetails

    • builder

      static Float2ObjectMap.MapBuilder builder()
      Helper Class that allows to create Maps without requiring a to type out the entire implementation or know it.
      Gibt zurück:
      a MapBuilder
    • getDefaultReturnValue

      V getDefaultReturnValue()
      Method to see what the default return value is.
      Gibt zurück:
      default return value
    • setDefaultReturnValue

      Float2ObjectMap<V> setDefaultReturnValue(V v)
      Method to define the default return value if a requested key isn't present
      Parameter:
      v - value that should be the default return value
      Gibt zurück:
      itself
    • copy

      A Function that does a shallow clone of the Map itself. This function is more optimized then a copy constructor since the Map does not have to be unsorted/resorted. It can be compared to Cloneable but with less exception risk
      Gibt zurück:
      a Shallow Copy of the Map
      Note:
      Wrappers and view Maps will not support this feature
    • put

      V put(float key, V value)
      Type Specific method to reduce boxing/unboxing of values
      Parameter:
      key - the key that should be inserted,
      value - the value that should be inserted
      Gibt zurück:
      the last present value or default return value.
      Siehe auch:
    • put

      default V put(Float2ObjectMap.Entry<V> entry)
      A Helper method that allows to put int a Float2ObjectMap.Entry into a map.
      Parameter:
      entry - then Entry that should be inserted.
      Gibt zurück:
      the last present value or default return value.
    • put

      default V put(Map.Entry<Float,V> entry)
      A Helper method that allows to put int a Map.Entry into a map.
      Parameter:
      entry - then Entry that should be inserted.
      Gibt zurück:
      the last present value or default return value.
    • putAll

      default void putAll(float[] keys, V[] values)
      Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
      Parameter:
      keys - the keys that should be added
      values - the values that should be added
      Löst aus:
      IllegalStateException - if the arrays are not the same size
      Siehe auch:
    • putAll

      void putAll(float[] keys, V[] values, int offset, int size)
      Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
      Parameter:
      keys - the keys that should be added
      values - the values that should be added
      offset - where the to start in the array
      size - how many elements should be added
      Löst aus:
      IllegalStateException - if the arrays are not within the range
      Siehe auch:
    • putAll

      default void putAll(Float[] keys, V[] values)
      Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
      Parameter:
      keys - the keys that should be added
      values - the values that should be added
      Löst aus:
      IllegalStateException - if the arrays are not the same size
      Siehe auch:
    • putAll

      void putAll(Float[] keys, V[] values, int offset, int size)
      Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
      Parameter:
      keys - the keys that should be added
      values - the values that should be added
      offset - where the to start in the array
      size - how many elements should be added
      Löst aus:
      IllegalStateException - if the arrays are not within the range
      Siehe auch:
    • putIfAbsent

      V putIfAbsent(float key, V value)
      Type Specific method to reduce boxing/unboxing of values
      Parameter:
      key - the key that should be inserted,
      value - the value that should be inserted
      Gibt zurück:
      the last present value or default return value.
      Siehe auch:
    • putAllIfAbsent

      void putAllIfAbsent(Float2ObjectMap<V> m)
      Type-Specific bulk put method put elements into the map if not present.
      Parameter:
      m - elements that should be added if not present.
    • putAll

      void putAll(Float2ObjectMap<V> m)
      Type Specific function for the bull putting of values
      Parameter:
      m - the elements that should be inserted
    • containsKey

      boolean containsKey(float key)
      Type Specific method to reduce boxing/unboxing of values
      Parameter:
      key - element that is searched for
      Gibt zurück:
      if the key is present
    • containsKey

      default boolean containsKey(Object key)
      Angegeben von:
      containsKey in Schnittstelle Map<Float,V>
      Parameter:
      key - that is searched for.
      Gibt zurück:
      true if found
      Siehe auch:
      Note:
      in some implementations key does not have to be Float but just have to support equals with Float.
    • remove

      V remove(float key)
      Type Specific remove function to reduce boxing/unboxing
      Parameter:
      key - the element that should be removed
      Gibt zurück:
      the value that was removed or default return value
    • remove

      default V remove(Object key)
      Angegeben von:
      remove in Schnittstelle Map<Float,V>
      Parameter:
      key - the element that should be removed
      Gibt zurück:
      the value that was removed or default return value
      Siehe auch:
      Note:
      in some implementations key does not have to be Float but just have to support equals with Float.
    • remove

      boolean remove(float key, V value)
      Type Specific remove function to reduce boxing/unboxing
      Parameter:
      key - the element that should be removed
      value - the expected value that should be found
      Gibt zurück:
      true if the key and value was found and removed
      Siehe auch:
    • remove

      default boolean remove(Object key, Object value)
      Angegeben von:
      remove in Schnittstelle Map<Float,V>
      Parameter:
      key - the element that should be removed
      value - the expected value that should be found
      Gibt zurück:
      true if the key and value was found and removed
      Siehe auch:
    • removeOrDefault

      V removeOrDefault(float key, V defaultValue)
      Type-Specific Remove function with a default return value if wanted.
      Parameter:
      key - the element that should be removed
      defaultValue - the value that should be returned if the entry doesn't exist
      Gibt zurück:
      the value that was removed or default value
      Siehe auch:
    • replace

      boolean replace(float key, V oldValue, V newValue)
      A Type Specific replace method to replace an existing value
      Parameter:
      key - the element that should be searched for
      oldValue - the expected value to be replaced
      newValue - the value to replace the oldValue with.
      Gibt zurück:
      true if the value got replaced
      Note:
      this fails if the value is not present even if it matches the oldValue
    • replace

      V replace(float key, V value)
      A Type Specific replace method to reduce boxing/unboxing replace an existing value
      Parameter:
      key - the element that should be searched for
      value - the value to replace with.
      Gibt zurück:
      the present value or default return value
      Note:
      this fails if the value is not present
    • replaceObjects

      void replaceObjects(Float2ObjectMap<V> m)
      Type-Specific bulk replace method. Could be seen as putAllIfPresent
      Parameter:
      m - elements that should be replaced.
    • replaceObjects

      void replaceObjects(FloatObjectUnaryOperator<V> mappingFunction)
      A Type Specific mass replace method to reduce boxing/unboxing
      Parameter:
      mappingFunction - operation to replace all values
    • compute

      V compute(float key, FloatObjectUnaryOperator<V> mappingFunction)
      A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value
      Gibt zurück:
      the result of the computation
    • computeIfAbsent

      V computeIfAbsent(float key, FloatFunction<V> mappingFunction)
      A Type Specific computeIfAbsent method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value if not present
      Gibt zurück:
      the result of the computed value or present value
    • supplyIfAbsent

      V supplyIfAbsent(float key, ObjectSupplier<V> valueProvider)
      A Supplier based computeIfAbsent function to fill the most used usecase of this function If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      valueProvider - the value if not present
      Gibt zurück:
      the result of the computed value or present value
    • computeIfPresent

      V computeIfPresent(float key, FloatObjectUnaryOperator<V> mappingFunction)
      A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value if present
      Gibt zurück:
      the result of the default return value or present value
      Note:
      if not present then compute is not executed
    • merge

      V merge(float key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
      A Type Specific merge method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      key - the key that should be be searched for
      value - the value that should be merged with
      mappingFunction - the operator that should generate the new Value
      Gibt zurück:
      the result of the merge
      Note:
      if the result matches the default return value then the key is removed from the map
    • mergeAll

      void mergeAll(Float2ObjectMap<V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
      A Bulk method for merging Maps. If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.
      Parameter:
      m - the entries that should be bulk added
      mappingFunction - the operator that should generate the new Value
      Note:
      if the result matches the default return value then the key is removed from the map
    • replace

      @Deprecated default boolean replace(Float key, V oldValue, V newValue)
      Veraltet.
      Angegeben von:
      replace in Schnittstelle Map<Float,V>
    • replace

      @Deprecated default V replace(Float key, V value)
      Veraltet.
      Angegeben von:
      replace in Schnittstelle Map<Float,V>
    • apply

      default V apply(float key)
      Beschreibung aus Schnittstelle kopiert: FloatFunction
      Type Specific get function to reduce boxing/unboxing
      Angegeben von:
      apply in Schnittstelle FloatFunction<V>
      Parameter:
      key - the value that should be processed
      Gibt zurück:
      the result of the function
    • get

      V get(float key)
      A Type Specific get method to reduce boxing/unboxing
      Parameter:
      key - the key that is searched for
      Gibt zurück:
      the searched value or default return value
    • getOrDefault

      V getOrDefault(float key, V defaultValue)
      A Type Specific getOrDefault method to reduce boxing/unboxing
      Parameter:
      key - the key that is searched for
      defaultValue - the value that should be returned if the key is not present
      Gibt zurück:
      the searched value or defaultValue value
    • get

      @Deprecated default V get(Object key)
      Veraltet.
      Angegeben von:
      get in Schnittstelle Map<Float,V>
    • getOrDefault

      @Deprecated default V getOrDefault(Object key, V defaultValue)
      Veraltet.
      Angegeben von:
      getOrDefault in Schnittstelle Map<Float,V>
    • replaceAll

      @Deprecated default void replaceAll(BiFunction<? super Float,? super V,? extends V> mappingFunction)
      Veraltet.
      Angegeben von:
      replaceAll in Schnittstelle Map<Float,V>
    • compute

      @Deprecated default V compute(Float key, BiFunction<? super Float,? super V,? extends V> mappingFunction)
      Veraltet.
      Angegeben von:
      compute in Schnittstelle Map<Float,V>
    • computeIfAbsent

      @Deprecated default V computeIfAbsent(Float key, Function<? super Float,? extends V> mappingFunction)
      Veraltet.
      Angegeben von:
      computeIfAbsent in Schnittstelle Map<Float,V>
    • computeIfPresent

      @Deprecated default V computeIfPresent(Float key, BiFunction<? super Float,? super V,? extends V> mappingFunction)
      Veraltet.
      Angegeben von:
      computeIfPresent in Schnittstelle Map<Float,V>
    • merge

      @Deprecated default V merge(Float key, V value, BiFunction<? super V,? super V,? extends V> mappingFunction)
      Veraltet.
      Angegeben von:
      merge in Schnittstelle Map<Float,V>
    • forEach

      void forEach(FloatObjectConsumer<V> action)
      Type Specific forEach method to reduce boxing/unboxing
      Parameter:
      action - processor of the values that are iterator over
    • forEach

      @Deprecated default void forEach(BiConsumer<? super Float,? super V> action)
      Veraltet.
      Angegeben von:
      forEach in Schnittstelle Map<Float,V>
    • keySet

      FloatSet keySet()
      Angegeben von:
      keySet in Schnittstelle Map<Float,V>
    • values

      ObjectCollection<V> values()
      Angegeben von:
      values in Schnittstelle Map<Float,V>
    • entrySet

      Veraltet.
      Angegeben von:
      entrySet in Schnittstelle Map<Float,V>
    • float2ObjectEntrySet

      ObjectSet<Float2ObjectMap.Entry<V>> float2ObjectEntrySet()
      Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
      Gibt zurück:
      a EntrySet of the collection
    • synchronize

      default Float2ObjectMap<V> synchronize()
      Creates a Wrapped Map that is Synchronized
      Gibt zurück:
      a new Map that is synchronized
      Siehe auch:
    • synchronize

      default Float2ObjectMap<V> synchronize(Object mutex)
      Creates a Wrapped Map that is Synchronized
      Parameter:
      mutex - is the controller of the synchronization block
      Gibt zurück:
      a new Map Wrapper that is synchronized
      Siehe auch:
    • unmodifiable

      default Float2ObjectMap<V> unmodifiable()
      Creates a Wrapped Map that is unmodifiable
      Gibt zurück:
      a new Map Wrapper that is unmodifiable
      Siehe auch:
    • put

      @Deprecated default V put(Float key, V value)
      Veraltet.
      Angegeben von:
      put in Schnittstelle Map<Float,V>
    • putIfAbsent

      @Deprecated default V putIfAbsent(Float key, V value)
      Veraltet.
      Angegeben von:
      putIfAbsent in Schnittstelle Map<Float,V>