public class SoftSet
extends java.lang.Object
implements java.util.Set
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
SoftSet.ComparableSoftReference |
(package private) static class |
SoftSet.ComparableSoftReferenceIterator |
| Modifier and Type | Field and Description |
|---|---|
private java.lang.ref.ReferenceQueue |
gcqueue
The queue of garbage collected soft references
|
private java.util.HashMap |
map |
| Constructor and Description |
|---|
SoftSet() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(java.lang.Object o) |
boolean |
addAll(java.util.Collection c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection c) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Iterator |
iterator() |
private void |
processQueue()
Iterate through the gcqueue for for any cleared reference, remove
the associated value from the underlying set.
|
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection c) |
boolean |
retainAll(java.util.Collection c) |
int |
size() |
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] a) |
private java.util.HashMap map
private java.lang.ref.ReferenceQueue gcqueue
public int size()
size in interface java.util.Collectionsize in interface java.util.Setpublic boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.Setpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Setpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.Setpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.Setpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Setpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Setpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.Setpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.Setpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.Setpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.Setpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Setpublic boolean equals(java.lang.Object o)
equals in interface java.util.Collectionequals in interface java.util.Setequals in class java.lang.Objectpublic int hashCode()
hashCode in interface java.util.CollectionhashCode in interface java.util.SethashCode in class java.lang.Objectprivate void processQueue()