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

public final Class FastListMultimap<K, V>

extends AbstractMutableListMultimap<K, V>
implements Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable
Imports
java.io.Externalizable, java.util.Collection, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.block.predicate.Predicate2, org.eclipse.collections.api.factory.Lists, .Maps, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.map.MutableMap, org.eclipse.collections.api.multimap.Multimap, org.eclipse.collections.api.multimap.bag.MutableBagMultimap, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.list.mutable.FastList, org.eclipse.collections.impl.map.mutable.UnifiedMap, org.eclipse.collections.impl.utility.Iterate

Field Summary

Modifier and TypeField and Description
private static final int
private int
private static final long

Constructor Summary

AccessConstructor and Description
public
public
FastListMultimap(int distinctKeys, int valuesPerKey)

public
FastListMultimap(Multimap<? extends K, ? extends V> multimap)

public
FastListMultimap(Pair<K, V>... pairs)

public
FastListMultimap(Iterable<Pair<K, V>> inputIterable)

Method Summary

Modifier and TypeMethod and Description
protected MutableList<V>
createCollection()

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

Creates the collection of values for a single key.

protected MutableMap<K, MutableList<V>>
protected MutableMap<K, MutableList<V>>
public MutableBagMultimap<V, K>
public FastListMultimap<K, V>
public static <K, V> FastListMultimap<K, V>
public static <K, V> FastListMultimap<K, V>
newMultimap(Multimap<? extends K, ? extends V> multimap)

public static <K, V> FastListMultimap<K, V>
newMultimap(Pair<K, V>... pairs)

public static <K, V> FastListMultimap<K, V>
newMultimap(Iterable<Pair<K, V>> inputIterable)

public FastListMultimap<K, V>
public FastListMultimap<K, V>
public FastListMultimap<K, V>
public FastListMultimap<K, V>
public void
Inherited from org.eclipse.collections.impl.multimap.list.AbstractMutableListMultimap:
asSynchronizedcollectKeyMultiValuescollectKeysValuescollectValuesforEachKeyMutableListtoImmutabletoMutable

Field Detail

DEFAULT_CAPACITYback to summary
private static final int DEFAULT_CAPACITY
initialListCapacityback to summary
private int initialListCapacity
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

FastListMultimapback to summary
public FastListMultimap()
FastListMultimapback to summary
public FastListMultimap(int distinctKeys, int valuesPerKey)
FastListMultimapback to summary
public FastListMultimap(Multimap<? extends K, ? extends V> multimap)
FastListMultimapback to summary
public FastListMultimap(Pair<K, V>... pairs)
FastListMultimapback to summary
public FastListMultimap(Iterable<Pair<K, V>> inputIterable)

Method Detail

createCollectionback to summary
protected MutableList<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
createMapback to summary
protected MutableMap<K, MutableList<V>> createMap()

Implements abstract org.eclipse.collections.impl.multimap.AbstractMutableMultimap.createMap.

Annotations
@Override
createMapWithKeyCountback to summary
protected MutableMap<K, MutableList<V>> createMapWithKeyCount(int keyCount)

Implements abstract org.eclipse.collections.impl.multimap.AbstractMutableMultimap.createMapWithKeyCount.

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

Implements org.eclipse.collections.api.multimap.list.MutableListMultimap.flip, org.eclipse.collections.api.multimap.MutableMultimap.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
newEmptyback to summary
public FastListMultimap<K, V> newEmpty()

Implements org.eclipse.collections.api.multimap.list.MutableListMultimap.newEmpty, org.eclipse.collections.api.multimap.MutableMultimap.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
newMultimapback to summary
public static <K, V> FastListMultimap<K, V> newMultimap()
newMultimapback to summary
public static <K, V> FastListMultimap<K, V> newMultimap(Multimap<? extends K, ? extends V> multimap)
newMultimapback to summary
public static <K, V> FastListMultimap<K, V> newMultimap(Pair<K, V>... pairs)
newMultimapback to summary
public static <K, V> FastListMultimap<K, V> newMultimap(Iterable<Pair<K, V>> inputIterable)
rejectKeysMultiValuesback to summary
public FastListMultimap<K, V> rejectKeysMultiValues(Predicate2<? super K, ? super RichIterable<V>> predicate)

Implements org.eclipse.collections.api.multimap.list.MutableListMultimap.rejectKeysMultiValues, org.eclipse.collections.api.multimap.MutableMultimap.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 FastListMultimap<K, V> rejectKeysValues(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.multimap.list.MutableListMultimap.rejectKeysValues, org.eclipse.collections.api.multimap.MutableMultimap.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 FastListMultimap<K, V> selectKeysMultiValues(Predicate2<? super K, ? super RichIterable<V>> predicate)

Implements org.eclipse.collections.api.multimap.list.MutableListMultimap.selectKeysMultiValues, org.eclipse.collections.api.multimap.MutableMultimap.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 FastListMultimap<K, V> selectKeysValues(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.multimap.list.MutableListMultimap.selectKeysValues, org.eclipse.collections.api.multimap.MutableMultimap.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
trimToSizeback to summary
public void trimToSize()