|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractCollection | +--planetj.util.WeakCollection
A Collection which does not prevent items from being garbage collected. If there are no other references to an item which has been added to a WeakCollection then that item will be garbage collected (and removed from that WeakCollection). This means that the size of a WeakCollection may diminish as time goes by even if no objects are directly removed from it.
A WeakCollection is not thread-safe, even if none of the threads are altering its contents.
Constructor Summary | |
WeakCollection()
WeakCollection constructor |
|
WeakCollection(Collection c)
WeakCollection constructor |
Method Summary | |
boolean |
add(Object o)
Adds a item to this collection |
Object |
get()
Gets a single item out of the Collection. |
boolean |
isEmpty()
Returns true if this collection contains no elements. |
Iterator |
iterator()
Returns an iterator over the elements contained in this collection. |
boolean |
remove(Object o)
Removes an item from this collection. |
int |
size()
Returns the number of elements in this collection. |
Methods inherited from class java.util.AbstractCollection |
addAll, clear, contains, containsAll, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
equals, hashCode |
Constructor Detail |
public WeakCollection()
public WeakCollection(Collection c)
Method Detail |
public boolean add(Object o)
add
in interface Collection
add
in class AbstractCollection
public Object get()
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in class AbstractCollection
public Iterator iterator()
iterator
in interface Collection
iterator
in class AbstractCollection
public boolean remove(Object o)
remove
in interface Collection
remove
in class AbstractCollection
public int size()
size
in interface Collection
size
in class AbstractCollection
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |