Top Inners Fields Constructors Methods
org.eclipse.persistence.internal.helper

public Class IdentityWeakHashMap<K, V>

extends AbstractMap<K, V>
implements Map<K, V>, Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable, java.util.Map
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serializable, java.lang.ref.ReferenceQueue, .WeakReference, java.util.AbstractCollection, .AbstractMap, .AbstractSet, .Collection, .ConcurrentModificationException, .Iterator, .Map, .NoSuchElementException, .Set, org.eclipse.persistence.internal.localization.ExceptionLocalization

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
private static class
pack-priv static interface
pack-priv static class
private class
pack-priv static class
IdentityWeakHashMap.WeakEntry<K, V>

IdentityWeakHashMap entry.

pack-priv static class

Field Summary

Modifier and TypeField and Description
protected transient int
pack-priv static final int
pack-priv static final float
private static IdentityWeakHashMap.EmptyHashIterator
private transient IdentityWeakHashMap.WeakEntry<K, V>[]
private transient Set<E>
private transient Set<E>
protected float
pack-priv static final int
private transient int
protected ReferenceQueue<T>
referenceQueue

This is used by the garbage collector.

pack-priv static final long
protected int
private transient Collection<E>

Constructor Summary

AccessConstructor and Description
public
IdentityWeakHashMap(int
the initial capacity of this IdentityWeakHashMap.
initialCapacity
,
float
the loadFactor of the IdentityWeakHashMap.
loadFactor
)

Constructs a new IdentityWeakHashMap with the given initial capacity and the given loadFactor.

public
IdentityWeakHashMap(int
the initial capacity of the IdentityWeakHashMap.
initialCapacity
)

Constructs a new IdentityWeakHashMap with the given initial capacity and a default loadFactor of 0.75.

public
IdentityWeakHashMap()

Constructs a new IdentityWeakHashMap with a default initial capacity of 32 and a loadfactor of 0.75.

public
IdentityWeakHashMap(Map<K, V>
the map whose mappings are to be placed in the IdentityWeakHashMap.
m
)

Constructs a new IdentityWeakHashMap with the same mappings as the given map.

Method Summary

Modifier and TypeMethod and Description
protected void
public void
clear()

Overrides java.util.AbstractMap.clear.

Implements java.util.Map.clear.

Removes all of the mappings from this IdentityWeakHashMap.
public Object

Returns:

a shallow copy of this IdentityWeakHashMap.
clone
()

Overrides java.util.AbstractMap.clone.

Returns a shallow copy of this IdentityWeakHashMap (the elements are not cloned).
public boolean

Returns:

true if this IdentityWeakHashMap contains a mapping for key.
containsKey
(Object
object to be used as a key into this IdentityWeakHashMap.
key
)

Overrides java.util.AbstractMap.containsKey.

Implements java.util.Map.containsKey.

Returns true if this IdentityWeakHashMap contains a mapping for the given key.
public boolean

Returns:

true if this IdentityWeakHashMap contains obj.
containsValue
(Object
the object to find.
obj
)

Overrides java.util.AbstractMap.containsValue.

Implements java.util.Map.containsValue.

Returns true if this IdentityWeakHashMap contains the given object.
public Set<E>

Returns:

a collection view of the mappings contained in this IdentityWeakHashMap.
entrySet
()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.Map.entrySet.

Returns a collection view of the mappings contained in this IdentityWeakHashMap.
public V

Returns:

the value to which this IdentityWeakHashMap maps the given key.
get
(Object
key whose associated value is to be returned.
key
)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Returns the value to which the given key is mapped in this IdentityWeakHashMap.
private Iterator<E>
public boolean

Returns:

true if this IdentityWeakHashMap is empty.
isEmpty
()

Overrides java.util.AbstractMap.isEmpty.

Implements java.util.Map.isEmpty.

Returns true if this map contains no key-value mappings.
public Set<E>

Returns:

a set view of the keys contained in this IdentityWeakHashMap.
keySet
()

Overrides java.util.AbstractMap.keySet.

Implements java.util.Map.keySet.

Returns a set view of the keys contained in this IdentityWeakHashMap.
public V

Returns:

the previous object for key or null if this IdentityWeakHashMap did not have one.
put
(K
key to map to given object.
key
,
V
object to be associated with key.
obj
)

Overrides java.util.AbstractMap.put.

Implements java.util.Map.put.

Associate the given object with the given key in this IdentityWeakHashMap, replacing any existing mapping.
public void
putAll(Map<? extends K, ? extends V>
mappings to be stored in this IdentityWeakHashMap.
m
)

Overrides java.util.AbstractMap.putAll.

Implements java.util.Map.putAll.

Copies all of the mappings from the given map to this IdentityWeakHashMap, replacing any existing mappings.
private void
readObject(ObjectInputStream s)

Deserialize the IdentityWeakHashMap from a stream.

private void
rehash()

INTERNAL: Re-builds the internal array of Entry's with a larger capacity.

public V

Returns:

the previous object for key or null if this IdentityWeakHashMap did not have one.
remove
(Object
key whose mapping is to be removed from the map.
key
)

Overrides java.util.AbstractMap.remove.

Implements java.util.Map.remove.

Removes the mapping (key and its corresponding value) from this IdentityWeakHashMap, if present.
protected boolean
removeEntry(Map.Entry<K, V> o, boolean userModification)

public int

Returns:

the size of this IdentityWeakHashMap.
size
()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Returns the number of key-value mappings in this map.
public Collection<E>

Returns:

a collection view of the values contained in this IdentityWeakHashMap.
values
()

Overrides java.util.AbstractMap.values.

Implements java.util.Map.values.

Returns a collection view of the values contained in this IdentityWeakHashMap.
private void
writeObject(ObjectOutputStream s)

Serialize the state of this IdentityWeakHashMap to a stream.

Inherited from java.util.AbstractMap:
equalshashCodetoString