public final class WeakKey extends WeakReference
Modifier and Type | Field and Description |
---|---|
private int |
hash
saved value of the referent's identity hash code, to maintain
a consistent hash code after the referent has been cleared
|
Constructor and Description |
---|
WeakKey(Object obj)
Create a new WeakKey to the given object.
|
WeakKey(Object obj,
ReferenceQueue refQueue)
Create a new WeakKey to the given object, registered with a queue.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Returns true if the given object is this identical WeakKey instance,
or, if this object's referent has not been cleared, if the given
object is another WeakKey instance with the identical non-null
referent as this one.
|
int |
hashCode()
Returns the identity hash code of the original referent.
|
clear, enqueue, get, isEnqueued
private final int hash
public WeakKey(Object obj)
public WeakKey(Object obj, ReferenceQueue refQueue)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.