public class EquivalentHashMap<K,V> extends AbstractMap<K,V>
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.HashMap| Modifier and Type | Class and Description |
|---|---|
class |
EquivalentHashMap.EntrySet
Deprecated.
|
protected static class |
EquivalentHashMap.Node<K,V>
Deprecated.
|
class |
EquivalentHashMap.Values
Deprecated.
|
AbstractMap.SimpleEntry<K,V>entrySet, keySet, values| Constructor and Description |
|---|
EquivalentHashMap(Equivalence<? super K> keyEq,
Equivalence<? super V> valueEq)
Deprecated.
|
EquivalentHashMap(int initialCapacity,
Equivalence<? super K> keyEq,
Equivalence<? super V> valueEq)
Deprecated.
|
EquivalentHashMap(int initialCapacity,
float loadFactor,
Equivalence<? super K> keyEq,
Equivalence<? super V> valueEq)
Deprecated.
|
EquivalentHashMap(Map<? extends K,? extends V> map,
Equivalence<? super K> keyEq,
Equivalence<? super V> valueEq)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Deprecated.
|
boolean |
containsKey(Object key)
Deprecated.
|
boolean |
containsValue(Object value)
Deprecated.
|
Set<Map.Entry<K,V>> |
entrySet()
Deprecated.
|
boolean |
equals(Object o)
Deprecated.
|
V |
get(Object key)
Deprecated.
|
Equivalence<? super K> |
getKeyEquivalence()
Deprecated.
|
Equivalence<? super V> |
getValueEquivalence()
Deprecated.
|
boolean |
isEmpty()
Deprecated.
|
Set<K> |
keySet()
Deprecated.
|
V |
put(K key,
V value)
Deprecated.
|
void |
putAll(Map<? extends K,? extends V> map)
Deprecated.
|
V |
remove(Object key)
Deprecated.
|
int |
size()
Deprecated.
|
Collection<V> |
values()
Deprecated.
|
assertKeyNotNull, eq, hash, hashCodeclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic EquivalentHashMap(Equivalence<? super K> keyEq, Equivalence<? super V> valueEq)
public EquivalentHashMap(int initialCapacity,
Equivalence<? super K> keyEq,
Equivalence<? super V> valueEq)
public EquivalentHashMap(int initialCapacity,
float loadFactor,
Equivalence<? super K> keyEq,
Equivalence<? super V> valueEq)
public EquivalentHashMap(Map<? extends K,? extends V> map, Equivalence<? super K> keyEq, Equivalence<? super V> valueEq)
public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
public boolean containsValue(Object value)
public void clear()
public boolean equals(Object o)
public Equivalence<? super K> getKeyEquivalence()
public Equivalence<? super V> getValueEquivalence()
public Collection<V> values()
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.