Top Fields Constructors Methods
org.eclipse.collections.impl.multimap.bag.strategy

public final Class HashBagMultimapWithHashingStrategy<K, V>

extends AbstractMutableBagMultimap<K, V>
implements Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.block.HashingStrategy, org.eclipse.collections.api.block.function.Function, org.eclipse.collections.api.block.predicate.Predicate2, 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.bag.mutable.HashBag, org.eclipse.collections.impl.map.strategy.mutable.UnifiedMapWithHashingStrategy, org.eclipse.collections.impl.multimap.bag.AbstractMutableBagMultimap, org.eclipse.collections.impl.utility.Iterate

Field Summary

Modifier and TypeField and Description
private HashingStrategy<? super K>
private static final long

Constructor Summary

AccessConstructor and Description
public
HashBagMultimapWithHashingStrategy()
Deprecated Empty default constructor used for serialization. Instantiating an HashBagMultimapWithHashingStrategy with this constructor will have a null multimapHashingStrategy, and throw NullPointerException when used.

public
public
public
HashBagMultimapWithHashingStrategy(HashingStrategy<? super K> hashingStrategy, Multimap<? extends K, ? extends V> multimap)

public
HashBagMultimapWithHashingStrategy(HashingStrategy<? super K> hashingStrategy, Pair<K, V>... pairs)

public
HashBagMultimapWithHashingStrategy(HashingStrategy<? super K> hashingStrategy, Iterable<Pair<K, V>> inputIterable)

Method Summary

Modifier and TypeMethod and Description
public <V2> HashBagMultimapWithHashingStrategy<K, V2>
collectValues(Function<? super V, ? extends V2> function)

Implements org.eclipse.collections.api.multimap.bag.MutableBagMultimap.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.

protected MutableBag<V>
createCollection()

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

Creates the collection of values for a single key.

protected MutableMap<K, MutableBag<V>>
protected MutableMap<K, MutableBag<V>>
public MutableBagMultimap<V, K>
public HashingStrategy<? super K>
public HashBagMultimapWithHashingStrategy<K, V>
public static <K, V> HashBagMultimapWithHashingStrategy<K, V>
public static <K, V> HashBagMultimapWithHashingStrategy<K, V>
newMultimap(HashingStrategy<? super K> multimapHashingStrategy, Multimap<? extends K, ? extends V> multimap)

public static <K, V> HashBagMultimapWithHashingStrategy<K, V>
newMultimap(HashingStrategy<? super K> multimapHashingStrategy)

public static <K, V> HashBagMultimapWithHashingStrategy<K, V>
newMultimap(HashingStrategy<? super K> multimapHashingStrategy, Pair<K, V>... pairs)

public static <K, V> HashBagMultimapWithHashingStrategy<K, V>
newMultimap(HashingStrategy<? super K> multimapHashingStrategy, Iterable<Pair<K, V>> inputIterable)

public void
readExternal(ObjectInput in)

Overrides org.eclipse.collections.impl.multimap.bag.AbstractMutableBagMultimap.readExternal.

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public HashBagMultimapWithHashingStrategy<K, V>
public HashBagMultimapWithHashingStrategy<K, V>
public HashBagMultimapWithHashingStrategy<K, V>
public HashBagMultimapWithHashingStrategy<K, V>
public void
writeExternal(ObjectOutput out)

Overrides org.eclipse.collections.impl.multimap.bag.AbstractMutableBagMultimap.writeExternal.

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from org.eclipse.collections.impl.multimap.bag.AbstractMutableBagMultimap:
asSynchronizedcollectKeyMultiValuescollectKeysValuesforEachKeyMutableBagputOccurrencestoImmutabletoMutable

Field Detail

hashingStrategyback to summary
private HashingStrategy<? super K> hashingStrategy
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

HashBagMultimapWithHashingStrategyback to summary
public HashBagMultimapWithHashingStrategy()

Deprecated

Empty default constructor used for serialization. Instantiating an HashBagMultimapWithHashingStrategy with this constructor will have a null multimapHashingStrategy, and throw NullPointerException when used.

Annotations
@SuppressWarnings:UnusedDeclaration
@Deprecated
HashBagMultimapWithHashingStrategyback to summary
public HashBagMultimapWithHashingStrategy(HashingStrategy<? super K> hashingStrategy)
HashBagMultimapWithHashingStrategyback to summary
public HashBagMultimapWithHashingStrategy(HashBagMultimapWithHashingStrategy<K, V> multimap)
HashBagMultimapWithHashingStrategyback to summary
public HashBagMultimapWithHashingStrategy(HashingStrategy<? super K> hashingStrategy, Multimap<? extends K, ? extends V> multimap)
HashBagMultimapWithHashingStrategyback to summary
public HashBagMultimapWithHashingStrategy(HashingStrategy<? super K> hashingStrategy, Pair<K, V>... pairs)
HashBagMultimapWithHashingStrategyback to summary
public HashBagMultimapWithHashingStrategy(HashingStrategy<? super K> hashingStrategy, Iterable<Pair<K, V>> inputIterable)

Method Detail

collectValuesback to summary
public <V2> HashBagMultimapWithHashingStrategy<K, V2> collectValues(Function<? super V, ? extends V2> function)

Implements org.eclipse.collections.api.multimap.bag.MutableBagMultimap.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
createCollectionback to summary
protected MutableBag<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, MutableBag<V>> createMap()

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

Annotations
@Override
createMapWithKeyCountback to summary
protected MutableMap<K, MutableBag<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.bag.MutableBagMultimap.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
getKeyHashingStrategyback to summary
public HashingStrategy<? super K> getKeyHashingStrategy()
newEmptyback to summary
public HashBagMultimapWithHashingStrategy<K, V> newEmpty()

Implements org.eclipse.collections.api.multimap.bag.MutableBagMultimap.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> HashBagMultimapWithHashingStrategy<K, V> newMultimap(HashBagMultimapWithHashingStrategy<K, V> multimap)
newMultimapback to summary
public static <K, V> HashBagMultimapWithHashingStrategy<K, V> newMultimap(HashingStrategy<? super K> multimapHashingStrategy, Multimap<? extends K, ? extends V> multimap)
newMultimapback to summary
public static <K, V> HashBagMultimapWithHashingStrategy<K, V> newMultimap(HashingStrategy<? super K> multimapHashingStrategy)
newMultimapback to summary
public static <K, V> HashBagMultimapWithHashingStrategy<K, V> newMultimap(HashingStrategy<? super K> multimapHashingStrategy, Pair<K, V>... pairs)
Annotations
@SafeVarargs
newMultimapback to summary
public static <K, V> HashBagMultimapWithHashingStrategy<K, V> newMultimap(HashingStrategy<? super K> multimapHashingStrategy, Iterable<Pair<K, V>> inputIterable)
readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Overrides org.eclipse.collections.impl.multimap.bag.AbstractMutableBagMultimap.readExternal.

Implements java.io.Externalizable.readExternal.

Doc from java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Annotations
@Override
Exceptions
IOException:
if I/O errors occur
ClassNotFoundException:
If the class for an object being restored cannot be found.
rejectKeysMultiValuesback to summary
public HashBagMultimapWithHashingStrategy<K, V> rejectKeysMultiValues(Predicate2<? super K, ? super RichIterable<V>> predicate)

Implements org.eclipse.collections.api.multimap.bag.MutableBagMultimap.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 HashBagMultimapWithHashingStrategy<K, V> rejectKeysValues(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.multimap.bag.MutableBagMultimap.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 HashBagMultimapWithHashingStrategy<K, V> selectKeysMultiValues(Predicate2<? super K, ? super RichIterable<V>> predicate)

Implements org.eclipse.collections.api.multimap.bag.MutableBagMultimap.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 HashBagMultimapWithHashingStrategy<K, V> selectKeysValues(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.multimap.bag.MutableBagMultimap.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
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Overrides org.eclipse.collections.impl.multimap.bag.AbstractMutableBagMultimap.writeExternal.

Implements java.io.Externalizable.writeExternal.

Doc from java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Annotations
@Override
Exceptions
IOException:
Includes any I/O exceptions that may occur