Schnittstelle Object2ByteMap<T>

Typparameter:
T - the keyType of elements maintained by this Collection
Alle Superschnittstellen:
Map<T,Byte>, ToByteFunction<T>
Alle bekannten Unterschnittstellen:
Object2ByteConcurrentMap<T>, Object2ByteNavigableMap<T>, Object2ByteOrderedMap<T>, Object2ByteSortedMap<T>
Alle bekannten Implementierungsklassen:
AbstractObject2ByteMap, Enum2ByteMap, ImmutableObject2ByteOpenHashMap, LinkedEnum2ByteMap, Object2ByteArrayMap, Object2ByteAVLTreeMap, Object2ByteConcurrentOpenHashMap, Object2ByteLinkedOpenCustomHashMap, Object2ByteLinkedOpenHashMap, Object2ByteMaps.EmptyMap, Object2ByteMaps.SingletonMap, Object2ByteMaps.SynchronizedMap, Object2ByteMaps.SynchronizedNavigableMap, Object2ByteMaps.SynchronizedOrderedMap, Object2ByteMaps.SynchronizedSortedMap, Object2ByteMaps.UnmodifyableMap, Object2ByteMaps.UnmodifyableNavigableMap, Object2ByteMaps.UnmodifyableOrderedMap, Object2ByteMaps.UnmodifyableSortedMap, Object2ByteOpenCustomHashMap, Object2ByteOpenHashMap, Object2ByteRBTreeMap

public interface Object2ByteMap<T> extends Map<T,Byte>, ToByteFunction<T>
A Type Specific Map that reduces memory overhead due to boxing/unboxing of Primitives and some extra helper functions.
  • Verschachtelte Klassen - Übersicht

    Verschachtelte Klassen
    Modifizierer und Typ
    Schnittstelle
    Beschreibung
    static class 
    Builder Cache for allowing to buildMaps
    static interface 
    Type Specific Map Entry that reduces boxing/unboxing
    static interface 
    Fast Entry set that allows for a faster Entry Iterator by recycling the Entry Object and just exchanging 1 internal value
    static final class 
    Helper class that reduces the method spam of the Map Class.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    byte
    addTo(T key, byte value)
    A Helper method to add a primitives together.
    void
    A Helper method to bulk add primitives together.
    default byte
    Type Specific get function to reduce boxing/unboxing
    Helper Class that allows to create Maps without requiring a to type out the entire implementation or know it.
    default Byte
    compute(T key, BiFunction<? super T,? super Byte,? extends Byte> mappingFunction)
     
    byte
    computeByte(T key, ObjectByteUnaryOperator<T> 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".
    byte
    computeByteIfAbsent(T key, ToByteFunction<T> 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".
    byte
    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".
    byte
    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".
    byte
    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".
    byte
    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".
    default Byte
    computeIfAbsent(T key, Function<? super T,? extends Byte> mappingFunction)
     
    default Byte
    computeIfPresent(T key, BiFunction<? super T,? super Byte,? extends Byte> mappingFunction)
     
    boolean
    containsValue(byte value)
    Type Specific method to reduce boxing/unboxing of values
    default boolean
     
    A Function that does a shallow clone of the Map itself.
     
    default void
    forEach(BiConsumer<? super T,? super Byte> action)
     
    void
    Type Specific forEach method to reduce boxing/unboxing
    default Byte
    get(Object key)
     
    byte
    getByte(T key)
    A Type Specific get method to reduce boxing/unboxing
    byte
    Method to see what the default return value is.
    default Byte
    getOrDefault(Object key, Byte defaultValue)
     
    byte
    getOrDefault(T key, byte defaultValue)
    A Type Specific getOrDefault method to reduce boxing/unboxing
     
    default Byte
    merge(T key, Byte value, BiFunction<? super Byte,? super Byte,? extends Byte> mappingFunction)
     
    void
    A Bulk method for merging Maps.
    byte
    mergeByte(T key, byte value, ByteByteUnaryOperator 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".
    Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
    default Byte
    put(Map.Entry<T,Byte> entry)
    A Helper method that allows to put int a Map.Entry into a map.
    default byte
    A Helper method that allows to put int a Object2ByteMap.Entry into a map.
    byte
    put(T key, byte value)
    Type Specific method to reduce boxing/unboxing of values
    default Byte
    put(T key, Byte value)
     
    void
    Type Specific function for the bull putting of values
    default void
    putAll(T[] keys, byte[] values)
    Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
    void
    putAll(T[] keys, byte[] values, int offset, int size)
    Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
    default void
    putAll(T[] keys, Byte[] values)
    Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
    void
    putAll(T[] keys, Byte[] values, int offset, int size)
    Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
    void
    Type-Specific bulk put method put elements into the map if not present.
    byte
    putIfAbsent(T key, byte value)
    Type Specific method to reduce boxing/unboxing of values
    default Byte
    putIfAbsent(T key, Byte value)
     
    byte
    rem(T key)
    Type Specific remove function to reduce boxing/unboxing
    byte
    remOrDefault(T key, byte defaultValue)
    Type-Specific Remove function with a default return value if wanted.
    default Byte
     
    default boolean
    remove(Object key, Object value)
     
    boolean
    remove(T key, byte value)
    Type Specific remove function to reduce boxing/unboxing
    byte
    replace(T key, byte value)
    A Type Specific replace method to reduce boxing/unboxing replace an existing value
    boolean
    replace(T key, byte oldValue, byte newValue)
    A Type Specific replace method to replace an existing value
    default Byte
    replace(T key, Byte value)
     
    default boolean
    replace(T key, Byte oldValue, Byte newValue)
     
    default void
    replaceAll(BiFunction<? super T,? super Byte,? extends Byte> mappingFunction)
     
    void
    A Type Specific mass replace method to reduce boxing/unboxing
    void
    Type-Specific bulk replace method.
    Method to define the default return value if a requested key isn't present
    byte
    subFrom(T key, byte value)
    A Helper method to subtract from primitive from each other.
    byte
    supplyByteIfAbsent(T key, ByteSupplier 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".
    byte
    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".
    default Object2ByteMap<T>
    Creates a Wrapped Map that is Synchronized
    default Object2ByteMap<T>
    Creates a Wrapped Map that is Synchronized
    default Object2ByteMap<T>
    Creates a Wrapped Map that is unmodifiable
     

    Von Schnittstelle geerbte Methoden java.util.Map

    clear, containsKey, equals, hashCode, isEmpty, putAll, size
  • Methodendetails

    • builder

      static Object2ByteMap.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

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

      Object2ByteMap<T> setDefaultReturnValue(byte 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

      Object2ByteMap<T> 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

      byte put(T key, byte 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 byte put(Object2ByteMap.Entry<T> entry)
      A Helper method that allows to put int a Object2ByteMap.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 Byte put(Map.Entry<T,Byte> 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(T[] keys, byte[] 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(T[] keys, byte[] 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(T[] keys, Byte[] 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(T[] keys, Byte[] 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

      byte putIfAbsent(T key, byte 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(Object2ByteMap<T> m)
      Type-Specific bulk put method put elements into the map if not present.
      Parameter:
      m - elements that should be added if not present.
    • addTo

      byte addTo(T key, byte value)
      A Helper method to add a primitives together. If key is not present then this functions as a put.
      Parameter:
      key - the key that should be inserted,
      value - the value that should be inserted / added
      Gibt zurück:
      the last present value or default return value.
    • addToAll

      void addToAll(Object2ByteMap<T> m)
      A Helper method to bulk add primitives together.
      Parameter:
      m - the values that should be added/inserted
    • subFrom

      byte subFrom(T key, byte value)
      A Helper method to subtract from primitive from each other. If the key is not present it will just return the defaultValue How the implementation works is that it will subtract from the current value (if not present it will do nothing) and fence it to the getDefaultReturnValue() If the fence is reached the element will be automaticall removed
      Parameter:
      key - that should be subtract from
      value - that should be subtract
      Gibt zurück:
      the last present or default return value
    • putAll

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

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

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

      byte rem(T 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 Byte remove(Object key)
      Angegeben von:
      remove in Schnittstelle Map<T,Byte>
      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 T but just have to support equals with T.
    • remove

      boolean remove(T key, byte 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<T,Byte>
      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:
    • remOrDefault

      byte remOrDefault(T key, byte 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(T key, byte oldValue, byte 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

      byte replace(T key, byte 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
    • replaceBytes

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

      void replaceBytes(ObjectByteUnaryOperator<T> mappingFunction)
      A Type Specific mass replace method to reduce boxing/unboxing
      Parameter:
      mappingFunction - operation to replace all values
    • computeByte

      byte computeByte(T key, ObjectByteUnaryOperator<T> 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
    • computeByteIfAbsent

      byte computeByteIfAbsent(T key, ToByteFunction<T> 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
    • supplyByteIfAbsent

      byte supplyByteIfAbsent(T key, ByteSupplier 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
    • computeByteIfPresent

      byte computeByteIfPresent(T key, ObjectByteUnaryOperator<T> 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
    • computeByteNonDefault

      byte computeByteNonDefault(T key, ObjectByteUnaryOperator<T> 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
    • computeByteIfAbsentNonDefault

      byte computeByteIfAbsentNonDefault(T key, ToByteFunction<T> 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
    • supplyByteIfAbsentNonDefault

      byte supplyByteIfAbsentNonDefault(T key, ByteSupplier 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
    • computeByteIfPresentNonDefault

      byte computeByteIfPresentNonDefault(T key, ObjectByteUnaryOperator<T> 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
    • mergeByte

      byte mergeByte(T key, byte value, ByteByteUnaryOperator 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
    • mergeAllByte

      void mergeAllByte(Object2ByteMap<T> m, ByteByteUnaryOperator 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

      default boolean replace(T key, Byte oldValue, Byte newValue)
      Angegeben von:
      replace in Schnittstelle Map<T,Byte>
    • replace

      default Byte replace(T key, Byte value)
      Angegeben von:
      replace in Schnittstelle Map<T,Byte>
    • applyAsByte

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

      byte getByte(T 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

      byte getOrDefault(T key, byte 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

      default Byte get(Object key)
      Angegeben von:
      get in Schnittstelle Map<T,Byte>
    • getOrDefault

      default Byte getOrDefault(Object key, Byte defaultValue)
      Angegeben von:
      getOrDefault in Schnittstelle Map<T,Byte>
    • replaceAll

      default void replaceAll(BiFunction<? super T,? super Byte,? extends Byte> mappingFunction)
      Angegeben von:
      replaceAll in Schnittstelle Map<T,Byte>
    • compute

      default Byte compute(T key, BiFunction<? super T,? super Byte,? extends Byte> mappingFunction)
      Angegeben von:
      compute in Schnittstelle Map<T,Byte>
    • computeIfAbsent

      default Byte computeIfAbsent(T key, Function<? super T,? extends Byte> mappingFunction)
      Angegeben von:
      computeIfAbsent in Schnittstelle Map<T,Byte>
    • computeIfPresent

      default Byte computeIfPresent(T key, BiFunction<? super T,? super Byte,? extends Byte> mappingFunction)
      Angegeben von:
      computeIfPresent in Schnittstelle Map<T,Byte>
    • merge

      default Byte merge(T key, Byte value, BiFunction<? super Byte,? super Byte,? extends Byte> mappingFunction)
      Angegeben von:
      merge in Schnittstelle Map<T,Byte>
    • forEach

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

      default void forEach(BiConsumer<? super T,? super Byte> action)
      Angegeben von:
      forEach in Schnittstelle Map<T,Byte>
    • keySet

      ObjectSet<T> keySet()
      Angegeben von:
      keySet in Schnittstelle Map<T,Byte>
    • values

      ByteCollection values()
      Angegeben von:
      values in Schnittstelle Map<T,Byte>
    • entrySet

      ObjectSet<Map.Entry<T,Byte>> entrySet()
      Angegeben von:
      entrySet in Schnittstelle Map<T,Byte>
    • object2ByteEntrySet

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

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

      default Object2ByteMap<T> 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 Object2ByteMap<T> unmodifiable()
      Creates a Wrapped Map that is unmodifiable
      Gibt zurück:
      a new Map Wrapper that is unmodifiable
      Siehe auch:
    • put

      default Byte put(T key, Byte value)
      Angegeben von:
      put in Schnittstelle Map<T,Byte>
    • putIfAbsent

      default Byte putIfAbsent(T key, Byte value)
      Angegeben von:
      putIfAbsent in Schnittstelle Map<T,Byte>