Klasse AbstractObject2CharMap<T>

java.lang.Object
java.util.AbstractMap<T,Character>
speiger.src.collections.objects.maps.abstracts.AbstractObject2CharMap<T>
Typparameter:
T - the keyType of elements maintained by this Collection
Alle implementierten Schnittstellen:
Map<T,Character>, ToCharFunction<T>, Object2CharMap<T>
Bekannte direkte Unterklassen:
Enum2CharMap, ImmutableObject2CharOpenHashMap, Object2CharArrayMap, Object2CharAVLTreeMap, Object2CharConcurrentOpenHashMap, Object2CharMaps.EmptyMap, Object2CharMaps.SingletonMap, Object2CharMaps.SynchronizedMap, Object2CharMaps.UnmodifyableMap, Object2CharOpenCustomHashMap, Object2CharOpenHashMap, Object2CharRBTreeMap

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

    • AbstractObject2CharMap

      public AbstractObject2CharMap()
  • Methodendetails

    • getDefaultReturnValue

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

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

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

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

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

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

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

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

      public boolean containsKey(Object key)
      Angegeben von:
      containsKey in Schnittstelle Map<T,Character>
      Setzt außer Kraft:
      containsKey in Klasse AbstractMap<T,Character>
    • containsValue

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

      public boolean replace(T key, char oldValue, char newValue)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      A Type Specific replace method to replace an existing value
      Angegeben von:
      replace in Schnittstelle Object2CharMap<T>
      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(T key, char value)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      A Type Specific replace method to reduce boxing/unboxing replace an existing value
      Angegeben von:
      replace in Schnittstelle Object2CharMap<T>
      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(Object2CharMap<T> m)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      Type-Specific bulk replace method. Could be seen as putAllIfPresent
      Angegeben von:
      replaceChars in Schnittstelle Object2CharMap<T>
      Parameter:
      m - elements that should be replaced.
    • replaceChars

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

      public char computeChar(T key, ObjectCharUnaryOperator<T> mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      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 Object2CharMap<T>
      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(T key, ToCharFunction<T> mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      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 Object2CharMap<T>
      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(T key, CharSupplier valueProvider)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      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 Object2CharMap<T>
      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(T key, ObjectCharUnaryOperator<T> mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      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 Object2CharMap<T>
      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(T key, ObjectCharUnaryOperator<T> mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      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 Object2CharMap<T>
      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(T key, ToCharFunction<T> mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      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 Object2CharMap<T>
      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(T key, CharSupplier valueProvider)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      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 Object2CharMap<T>
      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(T key, ObjectCharUnaryOperator<T> mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      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 Object2CharMap<T>
      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(T key, char value, CharCharUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      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 Object2CharMap<T>
      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(Object2CharMap<T> m, CharCharUnaryOperator mappingFunction)
      Beschreibung aus Schnittstelle kopiert: Object2CharMap
      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 Object2CharMap<T>
      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 Map<T,Character>
      Angegeben von:
      get in Schnittstelle Object2CharMap<T>
      Setzt außer Kraft:
      get in Klasse AbstractMap<T,Character>
    • getOrDefault

      public Character getOrDefault(Object key, Character defaultValue)
      Angegeben von:
      getOrDefault in Schnittstelle Map<T,Character>
      Angegeben von:
      getOrDefault in Schnittstelle Object2CharMap<T>
    • remove

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

      public ObjectSet<T> keySet()
      Angegeben von:
      keySet in Schnittstelle Map<T,Character>
      Angegeben von:
      keySet in Schnittstelle Object2CharMap<T>
      Setzt außer Kraft:
      keySet in Klasse AbstractMap<T,Character>
    • values

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

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

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

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