public class IdentityWeakHashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>, Cloneable, Serializable
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
IdentityWeakHashMap()
Constructs a new IdentityWeakHashMap with a default initial
capacity of 32 and a loadfactor of 0.75.
|
IdentityWeakHashMap(int initialCapacity)
Constructs a new IdentityWeakHashMap with the given
initial capacity and a default loadFactor of 0.75.
|
IdentityWeakHashMap(int initialCapacity,
float loadFactor)
Constructs a new IdentityWeakHashMap with the given
initial capacity and the given loadFactor.
|
IdentityWeakHashMap(Map m)
Constructs a new IdentityWeakHashMap with the same mappings
as the given map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all of the mappings from this IdentityWeakHashMap.
|
Object |
clone()
Returns a shallow copy of this IdentityWeakHashMap (the
elements are not cloned).
|
boolean |
containsKey(Object key)
Returns true if this IdentityWeakHashMap contains a
mapping for the given key.
|
boolean |
containsValue(Object obj)
Returns true if this IdentityWeakHashMap contains
the given object.
|
Set |
entrySet()
Returns a collection view of the mappings contained in this
IdentityWeakHashMap.
|
V |
get(Object key)
Returns the value to which the given key is mapped in this
IdentityWeakHashMap.
|
boolean |
isEmpty() |
Set |
keySet()
Returns a set view of the keys contained in this
IdentityWeakHashMap.
|
V |
put(K key,
V obj)
Associate the given object with the given key in this
IdentityWeakHashMap, replacing any existing mapping.
|
void |
putAll(Map<? extends K,? extends V> m)
Copies all of the mappings from the given map to this
IdentityWeakHashMap, replacing any existing mappings.
|
V |
remove(Object key)
Removes the mapping (key and its corresponding value) from this
IdentityWeakHashMap, if present.
|
int |
size() |
Collection |
values()
Returns a collection view of the values contained in this
IdentityWeakHashMap.
|
equals, hashCode, toString
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public IdentityWeakHashMap(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity of this
IdentityWeakHashMap.loadFactor
- the loadFactor of the IdentityWeakHashMap.IllegalArgumentException
- if the initial capacity is less
than zero, or if the loadFactor is nonpositive.public IdentityWeakHashMap(int initialCapacity)
initialCapacity
- the initial capacity of the
IdentityWeakHashMap.IllegalArgumentException
- if the initial capacity is less
than zero.public IdentityWeakHashMap()
public IdentityWeakHashMap(Map m)
m
- the map whose mappings are to be placed in the
IdentityWeakHashMap.public int size()
public boolean isEmpty()
public boolean containsValue(Object obj)
containsValue
in interface Map<K,V>
containsValue
in class AbstractMap<K,V>
obj
- the object to find.NullPointerException
- if obj is null.public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
key
- object to be used as a key into this
IdentityWeakHashMap.public V get(Object key)
public V put(K key, V obj)
put
in interface Map<K,V>
put
in class AbstractMap<K,V>
key
- key to map to given object.obj
- object to be associated with key.NullPointerException
- if obj is null.public V remove(Object key)
public void putAll(Map<? extends K,? extends V> m)
public void clear()
public Object clone()
clone
in class AbstractMap<K,V>
public Set keySet()
public Collection values()
public Set entrySet()
EclipseLink 2.5.2, "build v20140319-9ad6abd" API Reference