Class EquivalentHashMap<K,​V>

  • All Implemented Interfaces:
    java.util.Map<K,​V>
    Direct Known Subclasses:
    EquivalentLinkedHashMap

    public class EquivalentHashMap<K,​V>
    extends AbstractMap<K,​V>
    Deprecated.
    Custom hash-based map which accepts no null keys nor null values, where equality and hash code calculations are done based on passed Equivalence function implementations for keys and values, as opposed to relying on their own equals/hashCode/toString implementations. This is handy when using key/values whose mentioned methods cannot be overriden, i.e. arrays, and in situations where users want to avoid using wrapper objects. This hash map implementation is optimised for store/retrieval rather than iteration. Internal node entries are not linked, so responsibility to link them falls on the iterators.
    Since:
    5.3
    Author:
    Galder ZamarreƱo
    See Also:
    HashMap
    • Constructor Detail

      • EquivalentHashMap

        public EquivalentHashMap​(Equivalence<? super K> keyEq,
                                 Equivalence<? super V> valueEq)
        Deprecated.
      • EquivalentHashMap

        public EquivalentHashMap​(int initialCapacity,
                                 Equivalence<? super K> keyEq,
                                 Equivalence<? super V> valueEq)
        Deprecated.
      • EquivalentHashMap

        public EquivalentHashMap​(int initialCapacity,
                                 float loadFactor,
                                 Equivalence<? super K> keyEq,
                                 Equivalence<? super V> valueEq)
        Deprecated.
      • EquivalentHashMap

        public EquivalentHashMap​(java.util.Map<? extends K,​? extends V> map,
                                 Equivalence<? super K> keyEq,
                                 Equivalence<? super V> valueEq)
        Deprecated.
    • Method Detail

      • size

        public int size()
        Deprecated.
      • isEmpty

        public boolean isEmpty()
        Deprecated.
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Deprecated.
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Deprecated.
      • get

        public V get​(java.lang.Object key)
        Deprecated.
      • put

        public V put​(K key,
                     V value)
        Deprecated.
      • remove

        public V remove​(java.lang.Object key)
        Deprecated.
      • putAll

        public void putAll​(java.util.Map<? extends K,​? extends V> map)
        Deprecated.
      • clear

        public void clear()
        Deprecated.
      • equals

        public boolean equals​(java.lang.Object o)
        Deprecated.
        Specified by:
        equals in interface java.util.Map<K,​V>
        Overrides:
        equals in class java.lang.Object
      • getKeyEquivalence

        public Equivalence<? super K> getKeyEquivalence()
        Deprecated.
      • getValueEquivalence

        public Equivalence<? super V> getValueEquivalence()
        Deprecated.
      • keySet

        public java.util.Set<K> keySet()
        Deprecated.
      • values

        public java.util.Collection<V> values()
        Deprecated.
      • entrySet

        public java.util.Set<java.util.Map.Entry<K,​V>> entrySet()
        Deprecated.