Class AbstractMultiValuedMap.WrappedCollection
- java.lang.Object
-
- org.apache.commons.collections4.multimap.AbstractMultiValuedMap.WrappedCollection
-
- All Implemented Interfaces:
Iterable<V>,Collection<V>
- Enclosing class:
- AbstractMultiValuedMap<K,V>
class AbstractMultiValuedMap.WrappedCollection extends Object implements Collection<V>
Wrapped collection to handle add and remove on the collection returned by get(object).Currently, the wrapped collection is not cached and has to be retrieved from the underlying map. This is safe, but not very efficient and should be improved in subsequent releases. For this purpose, the scope of this collection is set to package private to simplify later refactoring.
-
-
Constructor Summary
Constructors Constructor Description WrappedCollection(K key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(V value)booleanaddAll(Collection<? extends V> other)voidclear()booleancontains(Object obj)booleancontainsAll(Collection<?> other)protected Collection<V>getMapping()booleanisEmpty()Iterator<V>iterator()booleanremove(Object item)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()Object[]toArray()<T> T[]toArray(T[] a)StringtoString()-
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, parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Field Detail
-
key
protected final K key
-
-
Constructor Detail
-
WrappedCollection
public WrappedCollection(K key)
-
-
Method Detail
-
getMapping
protected Collection<V> getMapping()
-
add
public boolean add(V value)
- Specified by:
addin interfaceCollection<V>
-
addAll
public boolean addAll(Collection<? extends V> other)
- Specified by:
addAllin interfaceCollection<V>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<V>
-
size
public int size()
- Specified by:
sizein interfaceCollection<V>
-
contains
public boolean contains(Object obj)
- Specified by:
containsin interfaceCollection<V>
-
containsAll
public boolean containsAll(Collection<?> other)
- Specified by:
containsAllin interfaceCollection<V>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<V>
-
remove
public boolean remove(Object item)
- Specified by:
removein interfaceCollection<V>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<V>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<V>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<V>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceCollection<V>
-
-