public class CachedCollection extends AbstractCollection
Collection which translates added objects
into SoftObject references, allowing the VM to garbage collect
objects in the collection when memory is low.| Modifier and Type | Field and Description |
|---|---|
protected Collection |
collection
Wrapped collection
|
protected ReferenceQueue |
queue
Reference queue
|
| Constructor and Description |
|---|
CachedCollection(Collection collection)
Construct a CachedCollection.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequals, hashCodeprotected final ReferenceQueue queue
protected final Collection collection
public CachedCollection(Collection collection)
collection - Collection to wrap.public Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in class AbstractCollectionpublic int size()
size in interface Collectionsize in class AbstractCollectionpublic boolean add(Object obj)
add in interface Collectionadd in class AbstractCollectionobj - Object (or null to add to the collection.Copyright © 2015 JBoss by Red Hat. All rights reserved.