public abstract class ReferencedValueHashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>, Cloneable
Note: Referenced entries may be automatically removed during either accessor or mutator operations, possibly causing a concurrent modification to be detected. Therefore, even if multiple threads are only accessing this map, be sure to synchronize this map first. Also, do not rely on the value returned by size() when using an iterator from this map. The iterators may return less entries than the amount reported by size().
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
ReferencedValueHashMap()
Constructs a new, empty map with a default capacity and load
factor, which is 0.75.
|
ReferencedValueHashMap(int initialCapacity)
Constructs a new, empty map with the specified initial capacity
and default load factor, which is 0.75.
|
ReferencedValueHashMap(int initialCapacity,
float loadFactor)
Constructs a new, empty map with the specified initial
capacity and the specified load factor.
|
ReferencedValueHashMap(Map<? extends K,? extends V> t)
Constructs a new map with the same mappings as the given map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
Object |
clone() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> t) |
V |
remove(Object key) |
int |
size() |
String |
toString() |
Collection<V> |
values() |
equals, hashCode
public ReferencedValueHashMap(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity of the HashMap.loadFactor
- the load factor of the HashMapIllegalArgumentException
- if the initial capacity is less
than zero, or if the load factor is nonpositive.public ReferencedValueHashMap(int initialCapacity)
initialCapacity
- the initial capacity of the HashMap.IllegalArgumentException
- if the initial capacity is less
than zero.public ReferencedValueHashMap()
public ReferencedValueHashMap(Map<? extends K,? extends V> t)
public int size()
public boolean isEmpty()
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
containsValue
in class AbstractMap<K,V>
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
public void clear()
public Object clone()
clone
in class AbstractMap<K,V>
public Collection<V> values()
public String toString()
toString
in class AbstractMap<K,V>
Copyright © 2004-2015 Cojen. All Rights Reserved.