| Modifier and Type | Field and Description |
|---|---|
| private int | hashValue
value of the referent's "identity" hash code |
| private Object | strongRef
strong reference to the referent, for when this WeakRef is "pinned" |
| Access | Constructor and Description |
|---|---|
| public | |
| public | WeakRef(Object obj, ReferenceQueue<Object> q)
Create a new WeakRef to the given object, registered with a queue. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object obj)
Overrides java. Return true if "obj" is this identical WeakRef object, or, if the contained reference has not been cleared, if "obj" is another WeakRef object with the identical non-null referent. |
| public int | hashCode()
Overrides java. Always return the "identity" hash code of the original referent. |
| public synchronized void | |
| private void | |
| public synchronized void |
| hashValue | back to summary |
|---|---|
| private int hashValue value of the referent's "identity" hash code | |
| strongRef | back to summary |
|---|---|
| private Object strongRef strong reference to the referent, for when this WeakRef is "pinned" | |
| WeakRef | back to summary |
|---|---|
| public WeakRef(Object obj) Create a new WeakRef to the given object. | |
| WeakRef | back to summary |
|---|---|
| public WeakRef(Object obj, ReferenceQueue<Object> q) Create a new WeakRef to the given object, registered with a queue. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Return true if "obj" is this identical WeakRef object, or, if the contained reference has not been cleared, if "obj" is another WeakRef object with the identical non-null referent. Otherwise, return false. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Always return the "identity" hash code of the original referent. | |
| pin | back to summary |
|---|---|
| public synchronized void pin() Pin the contained reference (make this a strong reference). | |
| setHashValue | back to summary |
|---|---|
| private void setHashValue(Object obj) | |
| unpin | back to summary |
|---|---|
| public synchronized void unpin() Unpin the contained reference (make this a weak reference). | |