Interface CharDoubleMap

All Superinterfaces:
DoubleIterable, DoubleValuesMap, PrimitiveIterable
All Known Subinterfaces:
ImmutableCharDoubleMap, MutableCharDoubleMap
All Known Implementing Classes:
CharDoubleHashMap, SynchronizedCharDoubleMap, UnmodifiableCharDoubleMap

public interface CharDoubleMap
extends DoubleValuesMap
This file was automatically generated from template file primitivePrimitiveMap.stg.
Since:
3.0.
  • Method Details

    • get

      double get​(char key)
      Retrieves the value associated with the key. If no mapping exists for the key, the default value (usually 0) is returned.
      Parameters:
      key - the key
      Returns:
      the value associated with the key, or the default value if no such mapping exists
    • getIfAbsent

      double getIfAbsent​(char key, double ifAbsent)
      Retrieves the value associated with the key, returning the specified default value if no such mapping exists.
      Parameters:
      key - the key
      ifAbsent - the default value to return if no mapping exists for key
      Returns:
      the value associated with the key, or ifAbsent if no such mapping exists.
    • getOrThrow

      double getOrThrow​(char key)
      Retrieves the value associated with the key, throwing an IllegalStateException if no such mapping exists.
      Parameters:
      key - the key
      Returns:
      the value associated with the key
      Throws:
      IllegalStateException - if no mapping exists for the key
    • containsKey

      boolean containsKey​(char key)
      Returns whether or not the key is present in the map.
      Parameters:
      key - the key
      Returns:
      if a mapping exists in this map for the key
    • forEachKey

      void forEachKey​(CharProcedure procedure)
      Iterates through each key in the map, invoking the procedure for each.
      Parameters:
      procedure - the procedure to invoke for each key
    • forEachKeyValue

      void forEachKeyValue​(CharDoubleProcedure procedure)
      Iterates through each key/value pair in the map, invoking the procedure for each.
      Parameters:
      procedure - the procedure to invoke for each key/value pair
    • keysView

      LazyCharIterable keysView()
      Returns a view of the keys in this map. This iterable is backed by the map, so any modifications to the underlying map will be reflected in the keys returned by the iterable.
      Returns:
      a view of the keys in this map
      Since:
      5.0
    • keyValuesView

      RichIterable<CharDoublePair> keyValuesView()
      Returns a view of the key/value pairs in this map. This iterable is backed by the map, so any modifications to the underlying map will be reflected in the pairs returned by the iterable.
      Returns:
      a view of the keys in this map
      Since:
      5.0
    • flipUniqueValues

      DoubleCharMap flipUniqueValues()
      Return the DoubleCharMap that is obtained by flipping the direction of this map and making the associations from value to key.
      Throws:
      IllegalStateException - if the DoubleCharMap contains duplicate values.
      Since:
      9.0
    • select

      CharDoubleMap select​(CharDoublePredicate predicate)
      Return a copy of this map containing only the key/value pairs that match the predicate.
      Parameters:
      predicate - the predicate to determine which key/value pairs in this map should be included in the returned map
      Returns:
      a copy of this map with the matching key/value pairs
    • reject

      CharDoubleMap reject​(CharDoublePredicate predicate)
      Return a copy of this map containing only the key/value pairs that do not match the predicate.
      Parameters:
      predicate - the predicate to determine which key/value pairs in this map should be excluded from the returned map
      Returns:
      a copy of this map without the matching key/value pairs
    • equals

      boolean equals​(Object o)
      Follows the same general contract as Map.equals(Object).
      Overrides:
      equals in class Object
    • hashCode

      int hashCode()
      Follows the same general contract as Map.hashCode().
      Overrides:
      hashCode in class Object
    • toString

      String toString()
      Follows the same general contract as AbstractMap.toString()
      Specified by:
      toString in interface PrimitiveIterable
      Overrides:
      toString in class Object
      Returns:
      a string representation of this CharDoubleMap
      See Also:
      AbstractCollection.toString()
    • toImmutable

      ImmutableCharDoubleMap toImmutable()
      Returns a copy of this map that is immutable (if this map is mutable) or itself if it is already immutable.
      Returns:
      an immutable map that is equivalent to this one
    • keySet

      MutableCharSet keySet()
      Returns a set containing all the keys in this map. The set is backed by the map, so any modifications to the returned set will affect this map.
      Returns:
      a mutable set containing the keys in this map