class ReferenceCollection<T> extends AbstractCollection<T> implements Collection<T>, Serializable
Ref,
ConcurrentCollections#multiReadCollection(java.util.Collection)| Modifier and Type | Field and Description |
|---|---|
private Collection<Referrer<T>> |
col |
private ReferenceQueuingFactory<T,Referrer<T>> |
rqf |
private static long |
serialVersionUID |
private Ref |
type |
| Constructor and Description |
|---|
ReferenceCollection(Collection<Referrer<T>> col,
Ref type,
boolean gcThread,
long gcCycle) |
ReferenceCollection(Collection<Referrer<T>> col,
ReferenceQueuingFactory<T,Referrer<T>> rqf,
Ref type) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T e) |
boolean |
addAll(Collection<? extends T> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object o)
Because equals and hashCode are not defined for collections, we
cannot guarantee consistent behaviour by implementing equals and
hashCode.
|
(package private) Ref |
getRef() |
(package private) ReferenceQueuingFactory<T,Referrer<T>> |
getRQF() |
int |
hashCode() |
boolean |
isEmpty() |
Iterator<T> |
iterator()
This Iterator may return null values if garbage collection
runs during iteration.
|
(package private) void |
processQueue() |
private void |
readObject(ObjectInputStream stream) |
boolean |
remove(Object o) |
int |
size() |
String |
toString() |
(package private) Referrer<T> |
wrapObj(T t,
boolean enqueue,
boolean temporary) |
(package private) Object |
writeReplace() |
removeAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitparallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArrayprivate static final long serialVersionUID
private final Collection<Referrer<T>> col
private final ReferenceQueuingFactory<T,Referrer<T>> rqf
private final Ref type
ReferenceCollection(Collection<Referrer<T>> col, Ref type, boolean gcThread, long gcCycle)
ReferenceCollection(Collection<Referrer<T>> col, ReferenceQueuingFactory<T,Referrer<T>> rqf, Ref type)
void processQueue()
ReferenceQueuingFactory<T,Referrer<T>> getRQF()
Ref getRef()
public int size()
size in interface Collection<T>size in class AbstractCollection<T>public boolean isEmpty()
isEmpty in interface Collection<T>isEmpty in class AbstractCollection<T>public boolean contains(Object o)
contains in interface Collection<T>contains in class AbstractCollection<T>public Iterator<T> iterator()
iterator in interface Iterable<T>iterator in interface Collection<T>iterator in class AbstractCollection<T>public boolean add(T e)
add in interface Collection<T>add in class AbstractCollection<T>public boolean remove(Object o)
remove in interface Collection<T>remove in class AbstractCollection<T>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<T>containsAll in class AbstractCollection<T>public boolean addAll(Collection<? extends T> c)
addAll in interface Collection<T>addAll in class AbstractCollection<T>public void clear()
clear in interface Collection<T>clear in class AbstractCollection<T>public String toString()
toString in class AbstractCollection<T>public int hashCode()
hashCode in interface Collection<T>hashCode in class Objectpublic boolean equals(Object o)
equals in interface Collection<T>equals in class ObjectCollection.equals(java.lang.Object)final Object writeReplace() throws ObjectStreamException
ObjectStreamExceptionprivate void readObject(ObjectInputStream stream) throws InvalidObjectException
InvalidObjectExceptionCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.