T - - type of each element in the collection.public class CachedCollection<T> extends Object implements Collection<T>
The cache will be invalidated when data is removed.
| Modifier and Type | Field and Description |
|---|---|
protected Object[] |
cache |
protected Set<T> |
delegate |
| Constructor and Description |
|---|
CachedCollection(Set<T> delegate)
Construct a cached collection with the given delegate.
|
| 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) |
int |
hashCode() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitequals, parallelStream, removeIf, spliterator, streampublic int size()
size in interface Collection<T>public boolean isEmpty()
isEmpty in interface Collection<T>public boolean contains(Object o)
contains in interface Collection<T>public Object[] toArray()
toArray in interface Collection<T>public <T> T[] toArray(T[] a)
toArray in interface Collection<T>public boolean add(T e)
add in interface Collection<T>public boolean addAll(Collection<? extends T> c)
addAll in interface Collection<T>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<T>public boolean remove(Object o)
remove in interface Collection<T>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<T>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<T>public void clear()
clear in interface Collection<T>public int hashCode()
hashCode in interface Collection<T>hashCode in class ObjectCopyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.