|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
org.jboss.util.collection.CachedCollection
public class CachedCollection
A wrapper around a Collection
which translates added objects
into SoftObject
references, allowing the VM to garbage collect
objects in the collection when memory is low.
Field Summary | |
---|---|
protected Collection |
collection
Wrapped collection |
protected ReferenceQueue |
queue
Reference queue |
Constructor Summary | |
---|---|
CachedCollection(Collection collection)
Construct a CachedCollection. |
Method Summary | |
---|---|
boolean |
add(Object obj)
Add an object to the collection. |
Iterator |
iterator()
Returns an iterator over the elements contained in this collection. |
int |
size()
Returns the size of the collection. |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Field Detail |
---|
protected final ReferenceQueue queue
protected final Collection collection
Constructor Detail |
---|
public CachedCollection(Collection collection)
collection
- Collection to wrap.Method Detail |
---|
public Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
iterator
in class AbstractCollection
public int size()
size
in interface Collection
size
in class AbstractCollection
public boolean add(Object obj)
add
in interface Collection
add
in class AbstractCollection
obj
- Object (or null to add to the collection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |