Klasse AbstractInt2CharMap

java.lang.Object
java.util.AbstractMap<Integer,Character>
speiger.src.collections.ints.maps.abstracts.AbstractInt2CharMap
Alle implementierten Schnittstellen:
Map<Integer,Character>, Int2CharFunction, Int2CharMap
Bekannte direkte Unterklassen:
ImmutableInt2CharOpenHashMap, Int2CharArrayMap, Int2CharAVLTreeMap, Int2CharConcurrentOpenHashMap, Int2CharMaps.EmptyMap, Int2CharMaps.SingletonMap, Int2CharMaps.SynchronizedMap, Int2CharMaps.UnmodifyableMap, Int2CharOpenCustomHashMap, Int2CharOpenHashMap, Int2CharRBTreeMap

public abstract class AbstractInt2CharMap extends AbstractMap<Integer,Character> implements Int2CharMap
A Base Implementation of a Type Specific Map to reduce boxing/unboxing
  • Konstruktordetails

    • AbstractInt2CharMap

      public AbstractInt2CharMap()
  • Methodendetails

    • getDefaultReturnValue

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

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

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

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

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

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

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

      public void putAll(int[] keys, char[] values, int offset, int size)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
      Angegeben von:
      putAll in Schnittstelle Int2CharMap
      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(Integer[] keys, Character[] values, int offset, int size)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
      Angegeben von:
      putAll in Schnittstelle Int2CharMap
      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(Int2CharMap m)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      Type-Specific bulk put method put elements into the map if not present.
      Angegeben von:
      putAllIfAbsent in Schnittstelle Int2CharMap
      Parameter:
      m - elements that should be added if not present.
    • containsKey

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

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

      public boolean replace(int key, char oldValue, char newValue)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      A Type Specific replace method to replace an existing value
      Angegeben von:
      replace in Schnittstelle Int2CharMap
      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 char replace(int key, char value)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      A Type Specific replace method to reduce boxing/unboxing replace an existing value
      Angegeben von:
      replace in Schnittstelle Int2CharMap
      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
    • replaceChars

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

      public void replaceChars(IntCharUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      A Type Specific mass replace method to reduce boxing/unboxing
      Angegeben von:
      replaceChars in Schnittstelle Int2CharMap
      Parameter:
      mappingFunction - operation to replace all values
    • computeChar

      public char computeChar(int key, IntCharUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      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:
      computeChar in Schnittstelle Int2CharMap
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value
      Gibt zurück:
      the result of the computation
    • computeCharIfAbsent

      public char computeCharIfAbsent(int key, Int2CharFunction mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      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:
      computeCharIfAbsent in Schnittstelle Int2CharMap
      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
    • supplyCharIfAbsent

      public char supplyCharIfAbsent(int key, CharSupplier valueProvider)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      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:
      supplyCharIfAbsent in Schnittstelle Int2CharMap
      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
    • computeCharIfPresent

      public char computeCharIfPresent(int key, IntCharUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      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:
      computeCharIfPresent in Schnittstelle Int2CharMap
      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
    • computeCharNonDefault

      public char computeCharNonDefault(int key, IntCharUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      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:
      computeCharNonDefault in Schnittstelle Int2CharMap
      Parameter:
      key - the key that should be computed
      mappingFunction - the operator that should generate the value
      Gibt zurück:
      the result of the computation
    • computeCharIfAbsentNonDefault

      public char computeCharIfAbsentNonDefault(int key, Int2CharFunction mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      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:
      computeCharIfAbsentNonDefault in Schnittstelle Int2CharMap
      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
    • supplyCharIfAbsentNonDefault

      public char supplyCharIfAbsentNonDefault(int key, CharSupplier valueProvider)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      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:
      supplyCharIfAbsentNonDefault in Schnittstelle Int2CharMap
      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
    • computeCharIfPresentNonDefault

      public char computeCharIfPresentNonDefault(int key, IntCharUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      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:
      computeCharIfPresentNonDefault in Schnittstelle Int2CharMap
      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
    • mergeChar

      public char mergeChar(int key, char value, CharCharUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      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:
      mergeChar in Schnittstelle Int2CharMap
      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
    • mergeAllChar

      public void mergeAllChar(Int2CharMap m, CharCharUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      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:
      mergeAllChar in Schnittstelle Int2CharMap
      Parameter:
      m - the entries that should be bulk added
      mappingFunction - the operator that should generate the new Value
    • get

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

      public Character getOrDefault(Object key, Character defaultValue)
      Angegeben von:
      getOrDefault in Schnittstelle Int2CharMap
      Angegeben von:
      getOrDefault in Schnittstelle Map<Integer,Character>
    • getOrDefault

      public char getOrDefault(int key, char defaultValue)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      A Type Specific getOrDefault method to reduce boxing/unboxing
      Angegeben von:
      getOrDefault in Schnittstelle Int2CharMap
      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 Character remove(Object key)
      Angegeben von:
      remove in Schnittstelle Int2CharMap
      Angegeben von:
      remove in Schnittstelle Map<Integer,Character>
      Setzt außer Kraft:
      remove in Klasse AbstractMap<Integer,Character>
      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(IntCharConsumer action)
      Beschreibung aus Schnittstelle kopiert: Int2CharMap
      Type Specific forEach method to reduce boxing/unboxing
      Angegeben von:
      forEach in Schnittstelle Int2CharMap
      Parameter:
      action - processor of the values that are iterator over
    • keySet

      public IntSet keySet()
      Angegeben von:
      keySet in Schnittstelle Int2CharMap
      Angegeben von:
      keySet in Schnittstelle Map<Integer,Character>
      Setzt außer Kraft:
      keySet in Klasse AbstractMap<Integer,Character>
    • values

      public CharCollection values()
      Angegeben von:
      values in Schnittstelle Int2CharMap
      Angegeben von:
      values in Schnittstelle Map<Integer,Character>
      Setzt außer Kraft:
      values in Klasse AbstractMap<Integer,Character>
    • entrySet

      public ObjectSet<Map.Entry<Integer,Character>> entrySet()
      Angegeben von:
      entrySet in Schnittstelle Int2CharMap
      Angegeben von:
      entrySet in Schnittstelle Map<Integer,Character>
      Angegeben von:
      entrySet in Klasse AbstractMap<Integer,Character>
    • equals

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

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