public static class WeakSoftTable.WeakKey extends WeakReference implements WeakSoftTable.RemovableReference
Modifier and Type | Field and Description |
---|---|
private int |
hashCode
The hash code of the key.
|
private boolean |
nullKey
Whether the key was null, as opposed to being cleared.
|
Modifier | Constructor and Description |
---|---|
|
WeakSoftTable.WeakKey(Object key)
Creates a key that holds a weak reference to the argument and
compares it using ==.
|
protected |
WeakSoftTable.WeakKey(WeakSoftTable.WeakKey weakKey,
ReferenceQueue queue)
Creates a copy of the key registered with the queue.
|
Modifier and Type | Method and Description |
---|---|
void |
cleared(Map map)
Called with the containing map when this instance's reference is
cleared, to remove the associated entry from the map.
|
WeakSoftTable.RemovableReference |
copy(ReferenceQueue queue)
Returns a copy of this instance registered with the specified queue.
|
boolean |
equals(Object o)
Returns true if the argument is an instance of the same concrete
class, and if both objects had null keys, or if neither object has
had its weak key cleared and their values are ==.
|
int |
hashCode() |
clear, enqueue, get, isEnqueued
private final boolean nullKey
private final int hashCode
public WeakSoftTable.WeakKey(Object key)
protected WeakSoftTable.WeakKey(WeakSoftTable.WeakKey weakKey, ReferenceQueue queue)
public WeakSoftTable.RemovableReference copy(ReferenceQueue queue)
WeakSoftTable.RemovableReference
copy
in interface WeakSoftTable.RemovableReference
queue
- the queue with which this instance should be registeredpublic void cleared(Map map)
WeakSoftTable.RemovableReference
cleared
in interface WeakSoftTable.RemovableReference
map
- the map from which this newly cleared instance should be
removedCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.