Top Description Inners Fields Constructors Methods
org.eclipse.collections.impl.multimap.list

public final Class ImmutableListMultimapImpl<K, V>

extends AbstractImmutableMultimap<K, V, ImmutableList<V>>
implements ImmutableListMultimap<K, V>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.eclipse.collections.api.multimap.list.ImmutableListMultimap, org.eclipse.collections.api.multimap.ImmutableMultimap, org.eclipse.collections.api.multimap.Multimap, org.eclipse.collections.api.multimap.list.ListMultimap, org.eclipse.collections.api.multimap.ordered.ReversibleIterableMultimap, org.eclipse.collections.api.multimap.ordered.OrderedIterableMultimap
Imports
java.io.Externalizable, .Serializable, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.block.function.Function, .Function2, org.eclipse.collections.api.block.predicate.Predicate2, org.eclipse.collections.api.block.procedure.Procedure2, org.eclipse.collections.api.factory.Lists, .Maps, org.eclipse.collections.api.list.ImmutableList, .MutableList, org.eclipse.collections.api.map.ImmutableMap, .MutableMap, org.eclipse.collections.api.multimap.bag.ImmutableBagMultimap, .MutableBagMultimap, org.eclipse.collections.api.multimap.list.ImmutableListMultimap, .MutableListMultimap, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.multimap.AbstractImmutableMultimap, .AbstractMutableMultimap, .ImmutableMultimapSerializationProxy, org.eclipse.collections.impl.multimap.bag.HashBagMultimap, org.eclipse.collections.impl.utility.Iterate

The default ImmutableListMultimap implementation.
Since
1.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from org.eclipse.collections.impl.multimap.AbstractImmutableMultimap:
map

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

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

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.collectKeyMultiValues, org.eclipse.collections.api.multimap.ImmutableMultimap.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> ImmutableBagMultimap<K2, V2>
collectKeysValues(Function2<? super K, ? super V, Pair<K2, V2>> function)

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.collectKeysValues, org.eclipse.collections.api.multimap.ImmutableMultimap.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> ImmutableListMultimap<K, V2>
collectValues(Function<? super V, ? extends V2> function)

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.collectValues, org.eclipse.collections.api.multimap.ImmutableMultimap.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.

protected ImmutableList<V>
createCollection()

Implements abstract org.eclipse.collections.impl.multimap.AbstractMultimap.createCollection.

Creates the collection of values for a single key.

public ImmutableBagMultimap<V, K>
public void
public ImmutableListMultimap<K, V>
public ImmutableListMultimap<K, V>
public ImmutableListMultimap<K, V>
public ImmutableListMultimap<K, V>
public ImmutableListMultimap<K, V>
public ImmutableListMultimap<K, V>
public ImmutableListMultimap<K, V>
public ImmutableListMultimap<K, V>
public ImmutableListMultimap<K, V>
public ImmutableListMultimap<K, V>
public MutableListMultimap<K, V>
private Object
Inherited from org.eclipse.collections.impl.multimap.AbstractImmutableMultimap:
getgetMapisEmptykeySetreadResolvesizesizeDistincttoMaptoMap

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ImmutableListMultimapImplback to summary
public ImmutableListMultimapImpl(MutableMap<K, ImmutableList<V>> map)
ImmutableListMultimapImplback to summary
public ImmutableListMultimapImpl(ImmutableMap<K, ImmutableList<V>> map)

Method Detail

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

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.collectKeyMultiValues, org.eclipse.collections.api.multimap.ImmutableMultimap.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> ImmutableBagMultimap<K2, V2> collectKeysValues(Function2<? super K, ? super V, Pair<K2, V2>> function)

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.collectKeysValues, org.eclipse.collections.api.multimap.ImmutableMultimap.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> ImmutableListMultimap<K, V2> collectValues(Function<? super V, ? extends V2> function)

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.collectValues, org.eclipse.collections.api.multimap.ImmutableMultimap.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
createCollectionback to summary
protected ImmutableList<V> createCollection()

Implements abstract org.eclipse.collections.impl.multimap.AbstractMultimap.createCollection.

Doc from org.eclipse.collections.impl.multimap.AbstractMultimap.createCollection.

Creates the collection of values for a single key.

Collections with weak, soft, or phantom references are not supported. Each call to createCollection should create a new instance.

The returned collection class determines whether duplicate key-value pairs are allowed.

Annotations
@Override
flipback to summary
public ImmutableBagMultimap<V, K> flip()

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.flip, org.eclipse.collections.api.multimap.ImmutableMultimap.flip, org.eclipse.collections.api.multimap.Multimap.flip.

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

Given a Multimap from Domain -> Range return a multimap from Range -> Domain.

Annotations
@Override
forEachKeyImmutableListback to summary
public void forEachKeyImmutableList(Procedure2<? super K, ? super ImmutableList<V>> procedure)

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.forEachKeyImmutableList.

Annotations
@Override
newEmptyback to summary
public ImmutableListMultimap<K, V> newEmpty()

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.newEmpty, org.eclipse.collections.api.multimap.ImmutableMultimap.newEmpty, org.eclipse.collections.api.multimap.Multimap.newEmpty.

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

Creates a new instance of the same implementation type, using the default capacity and growth parameters.

Annotations
@Override
newWithback to summary
public ImmutableListMultimap<K, V> newWith(K key, V value)

Overrides default org.eclipse.collections.api.multimap.ImmutableMultimap.newWith.

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.newWith.

Annotations
@Override
newWithAllback to summary
public ImmutableListMultimap<K, V> newWithAll(K key, Iterable<? extends V> values)

Overrides default org.eclipse.collections.api.multimap.ImmutableMultimap.newWithAll.

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.newWithAll.

Annotations
@Override
newWithoutback to summary
public ImmutableListMultimap<K, V> newWithout(Object key, Object value)

Overrides default org.eclipse.collections.api.multimap.ImmutableMultimap.newWithout.

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.newWithout.

Annotations
@Override
newWithoutAllback to summary
public ImmutableListMultimap<K, V> newWithoutAll(Object key)

Overrides default org.eclipse.collections.api.multimap.ImmutableMultimap.newWithoutAll.

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.newWithoutAll.

Annotations
@Override
rejectKeysMultiValuesback to summary
public ImmutableListMultimap<K, V> rejectKeysMultiValues(Predicate2<? super K, ? super RichIterable<V>> predicate)

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.rejectKeysMultiValues, org.eclipse.collections.api.multimap.ImmutableMultimap.rejectKeysMultiValues, org.eclipse.collections.api.multimap.Multimap.rejectKeysMultiValues.

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

Returns all elements of the source multimap that don't satisfy the predicate.

e.g.
return multimap.rejectKeysMultiValues(new Predicate2<Integer, Iterable<Person>>()
{
    public boolean accept(Integer age, Iterable<Person> values)
    {
        return (age >= 18)
                 && ((RichIterable<Person>)values.size() >= 2);
    }
});
Annotations
@Override
rejectKeysValuesback to summary
public ImmutableListMultimap<K, V> rejectKeysValues(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.rejectKeysValues, org.eclipse.collections.api.multimap.ImmutableMultimap.rejectKeysValues, org.eclipse.collections.api.multimap.Multimap.rejectKeysValues.

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

Returns all elements of the source multimap that don't satisfy the predicate.

e.g.
return multimap.rejectKeysValues(new Predicate2<Integer, Person>()
{
    public boolean accept(Integer age, Person person)
    {
        return (age >= 18)
                 && (person.getAddress().getCity().equals("Metuchen"));
    }
});
Annotations
@Override
selectKeysMultiValuesback to summary
public ImmutableListMultimap<K, V> selectKeysMultiValues(Predicate2<? super K, ? super RichIterable<V>> predicate)

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.selectKeysMultiValues, org.eclipse.collections.api.multimap.ImmutableMultimap.selectKeysMultiValues, org.eclipse.collections.api.multimap.Multimap.selectKeysMultiValues.

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

Returns all elements of the source multimap that satisfies the predicate. This method is also commonly called filter.

e.g.
return multimap.selectKeysMultiValues(new Predicate2<Integer, Iterable<Person>>()
{
    public boolean accept(Integer age, Iterable<Person> values)
    {
        return (age >= 18)
                 && ((RichIterable<Person>)values.size() >= 2);
    }
});
Annotations
@Override
selectKeysValuesback to summary
public ImmutableListMultimap<K, V> selectKeysValues(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.multimap.list.ImmutableListMultimap.selectKeysValues, org.eclipse.collections.api.multimap.ImmutableMultimap.selectKeysValues, org.eclipse.collections.api.multimap.Multimap.selectKeysValues.

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

Returns all elements of the source multimap that satisfies the predicate. This method is also commonly called filter.

e.g.
return multimap.selectKeysValues(new Predicate2<Integer, Person>()
{
    public boolean accept(Integer age, Person person)
    {
        return (age >= 18)
                 && (person.getAddress().getCity().equals("Metuchen"));
    }
});
Annotations
@Override
toImmutableback to summary
public ImmutableListMultimap<K, V> toImmutable()

Overrides org.eclipse.collections.impl.multimap.AbstractImmutableMultimap.toImmutable.

Implements org.eclipse.collections.api.multimap.list.ListMultimap.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 MutableListMultimap<K, V> toMutable()

Implements org.eclipse.collections.api.multimap.list.ListMultimap.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
writeReplaceback to summary
private Object writeReplace()
org.eclipse.collections.impl.multimap.list back to summary

public Class ImmutableListMultimapImpl.ImmutableListMultimapSerializationProxy<K, V>

extends ImmutableMultimapSerializationProxy<K, V, ImmutableList<V>>
implements Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected AbstractMutableMultimap<K, V, MutableList<V>>
Inherited from org.eclipse.collections.impl.multimap.ImmutableMultimapSerializationProxy:
readExternalreadResolvewriteExternal

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ImmutableListMultimapSerializationProxyback to summary
public ImmutableListMultimapSerializationProxy()
ImmutableListMultimapSerializationProxyback to summary
public ImmutableListMultimapSerializationProxy(ImmutableMap<K, ImmutableList<V>> map)

Method Detail

createEmptyMutableMultimapback to summary
protected AbstractMutableMultimap<K, V, MutableList<V>> createEmptyMutableMultimap()

Implements abstract org.eclipse.collections.impl.multimap.ImmutableMultimapSerializationProxy.createEmptyMutableMultimap.

Annotations
@Override