Class AbstractMultiValuedMap.WrappedCollection
- java.lang.Object
-
- org.apache.commons.collections4.multimap.AbstractMultiValuedMap.WrappedCollection
-
- All Implemented Interfaces:
java.lang.Iterable<V>,java.util.Collection<V>
- Direct Known Subclasses:
AbstractListValuedMap.WrappedList,AbstractSetValuedMap.WrappedSet
- Enclosing class:
- AbstractMultiValuedMap<K,V>
class AbstractMultiValuedMap.WrappedCollection extends java.lang.Object implements java.util.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(java.util.Collection<? extends V> other)voidclear()booleancontains(java.lang.Object obj)booleancontainsAll(java.util.Collection<?> other)protected java.util.Collection<V>getMapping()booleanisEmpty()java.util.Iterator<V>iterator()booleanremove(java.lang.Object item)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] a)java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
key
protected final K key
-
-
Constructor Detail
-
WrappedCollection
public WrappedCollection(K key)
-
-
Method Detail
-
getMapping
protected java.util.Collection<V> getMapping()
-
addAll
public boolean addAll(java.util.Collection<? extends V> other)
- Specified by:
addAllin interfacejava.util.Collection<V>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<V>
-
iterator
public java.util.Iterator<V> iterator()
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<V>
-
contains
public boolean contains(java.lang.Object obj)
- Specified by:
containsin interfacejava.util.Collection<V>
-
containsAll
public boolean containsAll(java.util.Collection<?> other)
- Specified by:
containsAllin interfacejava.util.Collection<V>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection<V>
-
remove
public boolean remove(java.lang.Object item)
- Specified by:
removein interfacejava.util.Collection<V>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAllin interfacejava.util.Collection<V>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAllin interfacejava.util.Collection<V>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection<V>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfacejava.util.Collection<V>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-