Top Fields Constructors Methods
org.eclipse.collections.impl.multimap.set

public abstract Class AbstractMutableSetMultimap<K, V>

extends AbstractMutableMultimap<K, V, MutableSet<V>>
implements MutableSetMultimap<K, V>
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.api.multimap.set.MutableSetMultimap, org.eclipse.collections.api.multimap.set.MutableSetIterableMultimap, org.eclipse.collections.api.multimap.MutableMultimap, org.eclipse.collections.api.multimap.Multimap, org.eclipse.collections.api.multimap.set.SetMultimap, org.eclipse.collections.api.multimap.set.UnsortedSetMultimap
Known Direct Subclasses
org.eclipse.collections.impl.multimap.set.MultiReaderUnifiedSetMultimap, org.eclipse.collections.impl.multimap.set.UnifiedSetMultimap, org.eclipse.collections.impl.multimap.set.strategy.UnifiedSetWithHashingStrategyMultimap
Imports
org.eclipse.collections.api.block.function.Function, .Function2, org.eclipse.collections.api.block.procedure.Procedure2, org.eclipse.collections.api.factory.Maps, org.eclipse.collections.api.map.MutableMap, org.eclipse.collections.api.multimap.bag.MutableBagMultimap, org.eclipse.collections.api.multimap.set.ImmutableSetMultimap, .MutableSetMultimap, org.eclipse.collections.api.set.ImmutableSet, .MutableSet, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.multimap.AbstractMutableMultimap, org.eclipse.collections.impl.multimap.bag.HashBagMultimap

Field Summary

Inherited from org.eclipse.collections.impl.multimap.AbstractMutableMultimap:
maptotalSize

Constructor Summary

AccessConstructor and Description
protected
protected
protected
protected

Method Summary

Modifier and TypeMethod and Description
public MutableSetMultimap<K, V>
public <K2, V2> MutableBagMultimap<K2, V2>
collectKeyMultiValues(Function<? super K, ? extends K2> keyFunction, Function<? super V, ? extends V2> valueFunction)

Implements org.eclipse.collections.api.multimap.set.MutableSetMultimap.collectKeyMultiValues, org.eclipse.collections.api.multimap.MutableMultimap.collectKeyMultiValues, org.eclipse.collections.api.multimap.Multimap.collectKeyMultiValues.

Returns a new multimap with the results of applying the specified keyFunction and valueFunction on each key and corresponding values of the source multimap.

public <K2, V2> MutableBagMultimap<K2, V2>
collectKeysValues(Function2<? super K, ? super V, Pair<K2, V2>> function)

Implements org.eclipse.collections.api.multimap.set.MutableSetMultimap.collectKeysValues, org.eclipse.collections.api.multimap.MutableMultimap.collectKeysValues, org.eclipse.collections.api.multimap.Multimap.collectKeysValues.

Returns a new multimap with the results of applying the specified function on each key and value of the source multimap.

public <V2> MutableBagMultimap<K, V2>
collectValues(Function<? super V, ? extends V2> function)

Implements org.eclipse.collections.api.multimap.set.MutableSetMultimap.collectValues, org.eclipse.collections.api.multimap.MutableMultimap.collectValues, org.eclipse.collections.api.multimap.Multimap.collectValues.

Returns a new multimap with the results of applying the specified function on each value of the source multimap.

public void
public ImmutableSetMultimap<K, V>
public MutableSetMultimap<K, V>
Inherited from org.eclipse.collections.impl.multimap.AbstractMutableMultimap:
addToTotalSizeclearclearTotalSizecreateMapcreateMapWithKeyCountdecrementTotalSizegetgetIfAbsentPutAllgetMapincrementTotalSizeisEmptykeySetputputAllputAllreadExternalremoveremoveAllreplaceValuessizesizeDistinctsubtractFromTotalSizetoMaptoMapwriteExternal

Constructor Detail

AbstractMutableSetMultimapback to summary
protected AbstractMutableSetMultimap()
AbstractMutableSetMultimapback to summary
protected AbstractMutableSetMultimap(Pair<K, V>... pairs)
AbstractMutableSetMultimapback to summary
protected AbstractMutableSetMultimap(Iterable<Pair<K, V>> inputIterable)
AbstractMutableSetMultimapback to summary
protected AbstractMutableSetMultimap(int size)

Method Detail

asSynchronizedback to summary
public MutableSetMultimap<K, V> asSynchronized()

Implements org.eclipse.collections.api.multimap.set.MutableSetMultimap.asSynchronized, org.eclipse.collections.api.multimap.MutableMultimap.asSynchronized.

Doc from org.eclipse.collections.api.multimap.MutableMultimap.asSynchronized.

Returns a synchronized wrapper backed by this multimap. The preferred way of iterating over a synchronized multimap is to use the forEachKey(), forEachValue(), forEachKeyValue() and forEachKeyMultiValues methods which are properly synchronized internally.

 MutableMultimap synchedMultimap = multimap.asSynchronized();

 synchedMultimap.forEachKey(key -> ... );
 synchedMultimap.forEachValue(value -> ... );
 synchedMultimap.forEachKeyValue((key, value) -> ... );
 synchedMultimap.forEachKeyMultiValues((key, values) -> ... );

If you want to iterate imperatively over the keySet(), keysView(), valuesView(), or other views, you will need to protect the iteration by wrapping the code in a synchronized block on the multimap.

Annotations
@Override
collectKeyMultiValuesback to summary
public <K2, V2> MutableBagMultimap<K2, V2> collectKeyMultiValues(Function<? super K, ? extends K2> keyFunction, Function<? super V, ? extends V2> valueFunction)

Implements org.eclipse.collections.api.multimap.set.MutableSetMultimap.collectKeyMultiValues, org.eclipse.collections.api.multimap.MutableMultimap.collectKeyMultiValues, org.eclipse.collections.api.multimap.Multimap.collectKeyMultiValues.

Doc from org.eclipse.collections.api.multimap.Multimap.collectKeyMultiValues.

Returns a new multimap with the results of applying the specified keyFunction and valueFunction on each key and corresponding values of the source multimap. This method is also commonly called transform or map.

e.g.
return multimap.collectKeyMultiValues(each -> each + 1, Person::getLastName);
Annotations
@Override
collectKeysValuesback to summary
public <K2, V2> MutableBagMultimap<K2, V2> collectKeysValues(Function2<? super K, ? super V, Pair<K2, V2>> function)

Implements org.eclipse.collections.api.multimap.set.MutableSetMultimap.collectKeysValues, org.eclipse.collections.api.multimap.MutableMultimap.collectKeysValues, org.eclipse.collections.api.multimap.Multimap.collectKeysValues.

Doc from org.eclipse.collections.api.multimap.Multimap.collectKeysValues.

Returns a new multimap with the results of applying the specified function on each key and value of the source multimap. This method is also commonly called transform or map.

e.g.
return multimap.collectKeysValues(new Function2<Integer, Person, Pair<String, String>>()
{
    public Pair<String, String> valueOf(Integer age, Person person)
    {
        return Tuples.pair(age.toString(), person.getLastName());
    }
});
Annotations
@Override
collectValuesback to summary
public <V2> MutableBagMultimap<K, V2> collectValues(Function<? super V, ? extends V2> function)

Implements org.eclipse.collections.api.multimap.set.MutableSetMultimap.collectValues, org.eclipse.collections.api.multimap.MutableMultimap.collectValues, org.eclipse.collections.api.multimap.Multimap.collectValues.

Doc from org.eclipse.collections.api.multimap.Multimap.collectValues.

Returns a new multimap with the results of applying the specified function on each value of the source multimap. This method is also commonly called transform or map.

e.g.
return multimap.collectValues(new Function<Person, String>()
{
    public String valueOf(Person person)
    {
        return person.getLastName();
    }
});
Annotations
@Override
forEachKeyMutableSetback to summary
public void forEachKeyMutableSet(Procedure2<? super K, ? super MutableSet<V>> procedure)

Implements org.eclipse.collections.api.multimap.set.MutableSetMultimap.forEachKeyMutableSet.

Annotations
@Override
toImmutableback to summary
public ImmutableSetMultimap<K, V> toImmutable()

Implements org.eclipse.collections.api.multimap.set.UnsortedSetMultimap.toImmutable, org.eclipse.collections.api.multimap.Multimap.toImmutable.

Doc from org.eclipse.collections.api.multimap.Multimap.toImmutable.

Returns an immutable copy of this Multimap if it is not already immutable. If the Multimap is immutable, it will return itself.

The returned Multimap will be Serializable if this Multimap is Serializable.

Annotations
@Override
toMutableback to summary
public MutableSetMultimap<K, V> toMutable()

Implements org.eclipse.collections.api.multimap.set.UnsortedSetMultimap.toMutable, org.eclipse.collections.api.multimap.Multimap.toMutable.

Doc from org.eclipse.collections.api.multimap.Multimap.toMutable.

Returns a mutable copy of this Multimap.

Annotations
@Override