Class MapSecondary<K,V>

java.lang.Object
components.map.MapSecondary<K,V>
Type Parameters:
K - type of Map domain (key) entries
V - type of Map range (associated value) entries
All Implemented Interfaces:
Map<K,V>, MapKernel<K,V>, Standard<Map<K,V>>, Iterable<Map.Pair<K,V>>
Direct Known Subclasses:
Map1L, Map2, Map3, Map4

public abstract class MapSecondary<K,V> extends Object implements Map<K,V>
Layered implementations of secondary methods for Map.
  • Constructor Details

  • Method Details

    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • replaceValue

      public V replaceValue(K key, V value)
      Description copied from interface: Map
      Replaces the value associated with key in this with value and returns the old value.
      Specified by:
      replaceValue in interface Map<K,V>
      Parameters:
      key - the key whose associated value is replaced
      value - the value replacing the old one
      Returns:
      the old value associated with the given key
    • key

      public K key(V value)
      Description copied from interface: Map
      Reports a key associated with value in this. Note that the key returned generally should not be changed at all via this aliased reference, and if it is then it definitely must not be changed in such a way that it equals another key in the map from which it was obtained.
      Specified by:
      key in interface Map<K,V>
      Parameters:
      value - the value whose associated key is to be reported
      Returns:
      a key associated with value
    • hasValue

      public boolean hasValue(V value)
      Description copied from interface: Map
      Reports whether there is a pair in this whose second component is value.
      Specified by:
      hasValue in interface Map<K,V>
      Parameters:
      value - the value to be checked
      Returns:
      true iff there is a pair in this whose second component is value
    • sharesKeyWith

      public boolean sharesKeyWith(Map<K,V> m)
      Description copied from interface: Map
      Reports whether this and m have any keys in common.
      Specified by:
      sharesKeyWith in interface Map<K,V>
      Parameters:
      m - the Map to be checked against this
      Returns:
      true iff there are keys in common
    • combineWith

      public void combineWith(Map<K,V> m)
      Description copied from interface: Map
      Combines m with this.
      Specified by:
      combineWith in interface Map<K,V>
      Parameters:
      m - the Map to be combined with this