Klasse AbstractChar2CharMap

java.lang.Object
java.util.AbstractMap<Character,Character>
speiger.src.collections.chars.maps.abstracts.AbstractChar2CharMap
Alle implementierten Schnittstellen:
Map<Character,Character>, CharUnaryOperator, Char2CharMap
Bekannte direkte Unterklassen:
Char2CharArrayMap, Char2CharAVLTreeMap, Char2CharConcurrentOpenHashMap, Char2CharMaps.EmptyMap, Char2CharMaps.SingletonMap, Char2CharMaps.SynchronizedMap, Char2CharMaps.UnmodifyableMap, Char2CharOpenCustomHashMap, Char2CharOpenHashMap, Char2CharRBTreeMap, ImmutableChar2CharOpenHashMap

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

    • AbstractChar2CharMap

      public AbstractChar2CharMap()
  • Methodendetails

    • getDefaultReturnValue

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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