|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractSet
java.util.HashSet
org.apache.jdo.util.WeakHashSet
A weak HashSet. An element stored in the WeakHashSet might be garbage collected, if there is no strong reference to this element.
Nested Class Summary | |
private static class |
WeakHashSet.WeakElement
A WeakHashSet stores objects of class WeakElement. |
Field Summary | |
(package private) java.lang.ref.ReferenceQueue |
queue
Helps to detect garbage collected values. |
Fields inherited from class java.util.HashSet |
|
Constructor Summary | |
WeakHashSet()
|
Method Summary | |
boolean |
add(java.lang.Object o)
Adds the specified element to this set if it is not already present. |
boolean |
contains(java.lang.Object o)
Returns true if this set contains the specified element. |
private java.lang.Object |
getReferenceObject(java.lang.ref.WeakReference ref)
A convenience method to return the object held by the weak reference or null if it does not exist. |
java.util.Iterator |
iterator()
Returns an iterator over the elements in this set. |
private void |
processQueue()
Removes all garbage collected values with their keys from the map. |
boolean |
remove(java.lang.Object o)
Removes the given element from this set if it is present. |
Methods inherited from class java.util.HashSet |
clear, clone, isEmpty, size |
Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
addAll, containsAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
Field Detail |
java.lang.ref.ReferenceQueue queue
Constructor Detail |
public WeakHashSet()
Method Detail |
public java.util.Iterator iterator()
public boolean contains(java.lang.Object o)
true
if this set contains the specified element.
o
- element whose presence in this set is to be tested.
true
if this set contains the specified element.public boolean add(java.lang.Object o)
o
- element to be added to this set.
true
if the set did not already contain the specified
element.public boolean remove(java.lang.Object o)
o
- object to be removed from this set, if present.
true
if the set contained the specified element.private final java.lang.Object getReferenceObject(java.lang.ref.WeakReference ref)
null
if it does not exist.
private final void processQueue()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |