Klasse AbstractLong2ShortMap

java.lang.Object
java.util.AbstractMap<Long,Short>
speiger.src.collections.longs.maps.abstracts.AbstractLong2ShortMap
Alle implementierten Schnittstellen:
Map<Long,Short>, Long2ShortFunction, Long2ShortMap
Bekannte direkte Unterklassen:
ImmutableLong2ShortOpenHashMap, Long2ShortArrayMap, Long2ShortAVLTreeMap, Long2ShortConcurrentOpenHashMap, Long2ShortMaps.EmptyMap, Long2ShortMaps.SingletonMap, Long2ShortMaps.SynchronizedMap, Long2ShortMaps.UnmodifyableMap, Long2ShortOpenCustomHashMap, Long2ShortOpenHashMap, Long2ShortRBTreeMap

public abstract class AbstractLong2ShortMap extends AbstractMap<Long,Short> implements Long2ShortMap
A Base Implementation of a Type Specific Map to reduce boxing/unboxing
  • Konstruktordetails

    • AbstractLong2ShortMap

      public AbstractLong2ShortMap()
  • Methodendetails

    • getDefaultReturnValue

      public short getDefaultReturnValue()
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      Method to see what the default return value is.
      Angegeben von:
      getDefaultReturnValue in Schnittstelle Long2ShortMap
      Gibt zurück:
      default return value
    • setDefaultReturnValue

      public AbstractLong2ShortMap setDefaultReturnValue(short v)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      Method to define the default return value if a requested key isn't present
      Angegeben von:
      setDefaultReturnValue in Schnittstelle Long2ShortMap
      Parameter:
      v - value that should be the default return value
      Gibt zurück:
      itself
    • copy

      public Long2ShortMap copy()
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      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
      Angegeben von:
      copy in Schnittstelle Long2ShortMap
      Gibt zurück:
      a Shallow Copy of the Map
    • put

      @Deprecated public Short put(Long key, Short value)
      Veraltet.
      Angegeben von:
      put in Schnittstelle Long2ShortMap
      Angegeben von:
      put in Schnittstelle Map<Long,Short>
      Setzt außer Kraft:
      put in Klasse AbstractMap<Long,Short>
    • addToAll

      public void addToAll(Long2ShortMap m)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      A Helper method to bulk add primitives together.
      Angegeben von:
      addToAll in Schnittstelle Long2ShortMap
      Parameter:
      m - the values that should be added/inserted
    • putAll

      public void putAll(Long2ShortMap m)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      Type Specific function for the bull putting of values
      Angegeben von:
      putAll in Schnittstelle Long2ShortMap
      Parameter:
      m - the elements that should be inserted
    • putAll

      public void putAll(Map<? extends Long,? extends Short> m)
      Angegeben von:
      putAll in Schnittstelle Map<Long,Short>
      Setzt außer Kraft:
      putAll in Klasse AbstractMap<Long,Short>
    • putAll

      public void putAll(long[] keys, short[] values, int offset, int size)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
      Angegeben von:
      putAll in Schnittstelle Long2ShortMap
      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
      Siehe auch:
    • putAll

      public void putAll(Long[] keys, Short[] values, int offset, int size)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
      Angegeben von:
      putAll in Schnittstelle Long2ShortMap
      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
      Siehe auch:
    • putAllIfAbsent

      public void putAllIfAbsent(Long2ShortMap m)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      Type-Specific bulk put method put elements into the map if not present.
      Angegeben von:
      putAllIfAbsent in Schnittstelle Long2ShortMap
      Parameter:
      m - elements that should be added if not present.
    • containsKey

      public boolean containsKey(long key)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      Type Specific method to reduce boxing/unboxing of values
      Angegeben von:
      containsKey in Schnittstelle Long2ShortMap
      Parameter:
      key - element that is searched for
      Gibt zurück:
      if the key is present
    • containsValue

      public boolean containsValue(short value)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      Type Specific method to reduce boxing/unboxing of values
      Angegeben von:
      containsValue in Schnittstelle Long2ShortMap
      Parameter:
      value - element that is searched for
      Gibt zurück:
      if the value is present
    • replace

      public boolean replace(long key, short oldValue, short newValue)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      A Type Specific replace method to replace an existing value
      Angegeben von:
      replace in Schnittstelle Long2ShortMap
      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
    • replace

      public short replace(long key, short value)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      A Type Specific replace method to reduce boxing/unboxing replace an existing value
      Angegeben von:
      replace in Schnittstelle Long2ShortMap
      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
    • replaceShorts

      public void replaceShorts(Long2ShortMap m)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      Type-Specific bulk replace method. Could be seen as putAllIfPresent
      Angegeben von:
      replaceShorts in Schnittstelle Long2ShortMap
      Parameter:
      m - elements that should be replaced.
    • replaceShorts

      public void replaceShorts(LongShortUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      A Type Specific mass replace method to reduce boxing/unboxing
      Angegeben von:
      replaceShorts in Schnittstelle Long2ShortMap
      Parameter:
      mappingFunction - operation to replace all values
    • computeShort

      public short computeShort(long key, LongShortUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      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.
      Angegeben von:
      computeShort in Schnittstelle Long2ShortMap
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value
      Gibt zurück:
      the result of the computation
    • computeShortIfAbsent

      public short computeShortIfAbsent(long key, Long2ShortFunction mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      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.
      Angegeben von:
      computeShortIfAbsent in Schnittstelle Long2ShortMap
      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
    • supplyShortIfAbsent

      public short supplyShortIfAbsent(long key, ShortSupplier valueProvider)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      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.
      Angegeben von:
      supplyShortIfAbsent in Schnittstelle Long2ShortMap
      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
    • computeShortIfPresent

      public short computeShortIfPresent(long key, LongShortUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      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.
      Angegeben von:
      computeShortIfPresent in Schnittstelle Long2ShortMap
      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
    • computeShortNonDefault

      public short computeShortNonDefault(long key, LongShortUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      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.
      Angegeben von:
      computeShortNonDefault in Schnittstelle Long2ShortMap
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value
      Gibt zurück:
      the result of the computation
    • computeShortIfAbsentNonDefault

      public short computeShortIfAbsentNonDefault(long key, Long2ShortFunction mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      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.
      Angegeben von:
      computeShortIfAbsentNonDefault in Schnittstelle Long2ShortMap
      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
    • supplyShortIfAbsentNonDefault

      public short supplyShortIfAbsentNonDefault(long key, ShortSupplier valueProvider)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      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.
      Angegeben von:
      supplyShortIfAbsentNonDefault in Schnittstelle Long2ShortMap
      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
    • computeShortIfPresentNonDefault

      public short computeShortIfPresentNonDefault(long key, LongShortUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      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.
      Angegeben von:
      computeShortIfPresentNonDefault in Schnittstelle Long2ShortMap
      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
    • mergeShort

      public short mergeShort(long key, short value, ShortShortUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      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.
      Angegeben von:
      mergeShort in Schnittstelle Long2ShortMap
      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
    • mergeAllShort

      public void mergeAllShort(Long2ShortMap m, ShortShortUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      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.
      Angegeben von:
      mergeAllShort in Schnittstelle Long2ShortMap
      Parameter:
      m - the entries that should be bulk added
      mappingFunction - the operator that should generate the new Value
    • get

      public Short get(Object key)
      Angegeben von:
      get in Schnittstelle Long2ShortMap
      Angegeben von:
      get in Schnittstelle Map<Long,Short>
      Setzt außer Kraft:
      get in Klasse AbstractMap<Long,Short>
    • getOrDefault

      public Short getOrDefault(Object key, Short defaultValue)
      Angegeben von:
      getOrDefault in Schnittstelle Long2ShortMap
      Angegeben von:
      getOrDefault in Schnittstelle Map<Long,Short>
    • getOrDefault

      public short getOrDefault(long key, short defaultValue)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      A Type Specific getOrDefault method to reduce boxing/unboxing
      Angegeben von:
      getOrDefault in Schnittstelle Long2ShortMap
      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
    • remove

      public Short remove(Object key)
      Angegeben von:
      remove in Schnittstelle Long2ShortMap
      Angegeben von:
      remove in Schnittstelle Map<Long,Short>
      Setzt außer Kraft:
      remove in Klasse AbstractMap<Long,Short>
      Parameter:
      key - the element that should be removed
      Gibt zurück:
      the value that was removed or default return value
      Siehe auch:
    • forEach

      public void forEach(LongShortConsumer action)
      Beschreibung aus Schnittstelle kopiert: Long2ShortMap
      Type Specific forEach method to reduce boxing/unboxing
      Angegeben von:
      forEach in Schnittstelle Long2ShortMap
      Parameter:
      action - processor of the values that are iterator over
    • keySet

      public LongSet keySet()
      Angegeben von:
      keySet in Schnittstelle Long2ShortMap
      Angegeben von:
      keySet in Schnittstelle Map<Long,Short>
      Setzt außer Kraft:
      keySet in Klasse AbstractMap<Long,Short>
    • values

      public ShortCollection values()
      Angegeben von:
      values in Schnittstelle Long2ShortMap
      Angegeben von:
      values in Schnittstelle Map<Long,Short>
      Setzt außer Kraft:
      values in Klasse AbstractMap<Long,Short>
    • entrySet

      public ObjectSet<Map.Entry<Long,Short>> entrySet()
      Angegeben von:
      entrySet in Schnittstelle Long2ShortMap
      Angegeben von:
      entrySet in Schnittstelle Map<Long,Short>
      Angegeben von:
      entrySet in Klasse AbstractMap<Long,Short>
    • equals

      public boolean equals(Object o)
      Angegeben von:
      equals in Schnittstelle Map<Long,Short>
      Setzt außer Kraft:
      equals in Klasse AbstractMap<Long,Short>
    • hashCode

      public int hashCode()
      Angegeben von:
      hashCode in Schnittstelle Map<Long,Short>
      Setzt außer Kraft:
      hashCode in Klasse AbstractMap<Long,Short>