APIdia Launch Partner
Top Description Inners Fields Constructors Methods
java.beans

pack-priv abstract Class WeakIdentityMap<T>

extends Object
Class Inheritance
Imports
java.lang.ref.ReferenceQueue, .WeakReference

Hash table based mapping, which uses weak references to store keys and reference-equality in place of object-equality to compare them. An entry will automatically be removed when its key is no longer in ordinary use. Both null values and the null key are supported. This class does not require additional synchronization. A thread-safety is provided by a fragile combination of synchronized blocks and volatile fields. Be very careful during editing!
See Also
java.util.IdentityHashMap, java.util.WeakHashMap

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final int
private static final Object
private final ReferenceQueue<Object>
private int
private volatile WeakIdentityMap.Entry<T>[]
private int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected abstract T
public T
get(Object key)

private static int
getIndex(WeakIdentityMap.Entry<?>[] table, int hash)

private WeakIdentityMap.Entry<T>[]
newTable(int length)

private void
private void
transfer(WeakIdentityMap.Entry<T>[] oldTable, WeakIdentityMap.Entry<T>[] newTable)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MAXIMUM_CAPACITYback to summary
private static final int MAXIMUM_CAPACITY
NULLback to summary
private static final Object NULL
queueback to summary
private final ReferenceQueue<Object> queue
sizeback to summary
private int size
tableback to summary
private volatile WeakIdentityMap.Entry<T>[] table
thresholdback to summary
private int threshold

Constructor Detail

WeakIdentityMapback to summary
pack-priv WeakIdentityMap()

Method Detail

createback to summary
protected abstract T create(Object key)
getback to summary
public T get(Object key)
getIndexback to summary
private static int getIndex(WeakIdentityMap.Entry<?>[] table, int hash)
newTableback to summary
private WeakIdentityMap.Entry<T>[] newTable(int length)
Annotations
@SuppressWarnings:unchecked
removeStaleEntriesback to summary
private void removeStaleEntries()
transferback to summary
private void transfer(WeakIdentityMap.Entry<T>[] oldTable, WeakIdentityMap.Entry<T>[] newTable)
java.beans back to summary

private Class WeakIdentityMap.Entry<T>

extends WeakReference<Object>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final int
private volatile WeakIdentityMap.Entry<T>
private volatile T

Constructor Summary

AccessConstructor and Description
pack-priv
Entry(Object key, int hash, T value, ReferenceQueue<Object> queue, WeakIdentityMap.Entry<T> next)

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
isMatched(Object key, int hash)

Field Detail

hashback to summary
private final int hash
nextback to summary
private volatile WeakIdentityMap.Entry<T> next

Hides java.lang.ref.Reference.next.

valueback to summary
private volatile T value

Constructor Detail

Entryback to summary
pack-priv Entry(Object key, int hash, T value, ReferenceQueue<Object> queue, WeakIdentityMap.Entry<T> next)

Method Detail

isMatchedback to summary
pack-priv boolean isMatched(Object key, int hash)