Top Inners Constructors Methods
org.eclipse.collections.impl.map.mutable

public abstract Class AbstractMutableMap<K, V>

extends AbstractMutableMapIterable<K, V>
implements MutableMap<K, V>
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.api.map.MutableMap, java.lang.Cloneable, org.eclipse.collections.api.map.UnsortedMapIterable, org.eclipse.collections.api.map.MapIterable, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, java.lang.Iterable, org.eclipse.collections.api.map.MutableMapIterable, java.util.Map
Known Direct Subclasses
org.eclipse.collections.impl.map.mutable.ConcurrentHashMap, org.eclipse.collections.impl.map.mutable.ConcurrentHashMapUnsafe, org.eclipse.collections.impl.map.mutable.ConcurrentMutableHashMap, org.eclipse.collections.impl.map.mutable.MapAdapter, org.eclipse.collections.impl.map.mutable.UnifiedMap, org.eclipse.collections.impl.map.strategy.mutable.UnifiedMapWithHashingStrategy, org.eclipse.collections.impl.map.fixed.AbstractMemoryEfficientMutableMap
Imports
java.util.Collection, .Objects, java.util.function.BiFunction, org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.bag.primitive.MutableBooleanBag, .MutableByteBag, .MutableCharBag, .MutableDoubleBag, .MutableFloatBag, .MutableIntBag, .MutableLongBag, .MutableShortBag, org.eclipse.collections.api.block.function.Function, .Function2, org.eclipse.collections.api.block.function.primitive.BooleanFunction, .ByteFunction, .CharFunction, .DoubleFunction, .FloatFunction, .IntFunction, .LongFunction, .ShortFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.factory.Bags, .Maps, org.eclipse.collections.api.factory.primitive.BooleanBags, .ByteBags, .CharBags, .DoubleBags, .FloatBags, .IntBags, .LongBags, .ShortBags, org.eclipse.collections.api.map.ImmutableMap, .MutableMap, org.eclipse.collections.api.multimap.bag.MutableBagMultimap, org.eclipse.collections.api.multimap.set.MutableSetMultimap, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.bag.PartitionMutableBag, org.eclipse.collections.api.set.MutableSet, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.block.factory.Functions, .Predicates, org.eclipse.collections.impl.block.procedure.PartitionPredicate2Procedure, .PartitionProcedure, .SelectInstancesOfProcedure, org.eclipse.collections.impl.list.fixed.ArrayAdapter, org.eclipse.collections.impl.multimap.bag.HashBagMultimap, org.eclipse.collections.impl.partition.bag.PartitionHashBag, org.eclipse.collections.impl.set.mutable.UnifiedSet, org.eclipse.collections.impl.utility.MapIterate

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected abstract static class
AbstractMutableMap.ValuesCollectionCommon<V>

Trait-style class that is used to capture commonalities between ValuesCollection class implementations in order to avoid code duplication.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public MutableMap<K, V>
public MutableMap<K, V>
public abstract MutableMap<K, V>
clone()

Redeclares org.eclipse.collections.api.map.MutableMap.clone.

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public <R> MutableBag<R>
collect(Function<? super V, ? extends R> function)

Implements org.eclipse.collections.api.map.MutableMap.collect, org.eclipse.collections.api.RichIterable.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public MutableBooleanBag
collectBoolean(BooleanFunction<? super V> booleanFunction)

Implements org.eclipse.collections.api.map.MutableMap.collectBoolean, org.eclipse.collections.api.RichIterable.collectBoolean.

Returns a new primitive boolean iterable with the results of applying the specified function on each element of the source collection.

public MutableByteBag
collectByte(ByteFunction<? super V> byteFunction)

Implements org.eclipse.collections.api.map.MutableMap.collectByte, org.eclipse.collections.api.RichIterable.collectByte.

Returns a new primitive byte iterable with the results of applying the specified function on each element of the source collection.

public MutableCharBag
collectChar(CharFunction<? super V> charFunction)

Implements org.eclipse.collections.api.map.MutableMap.collectChar, org.eclipse.collections.api.RichIterable.collectChar.

Returns a new primitive char iterable with the results of applying the specified function on each element of the source collection.

public MutableDoubleBag
collectDouble(DoubleFunction<? super V> doubleFunction)

Implements org.eclipse.collections.api.map.MutableMap.collectDouble, org.eclipse.collections.api.RichIterable.collectDouble.

Returns a new primitive double iterable with the results of applying the specified function on each element of the source collection.

public MutableFloatBag
collectFloat(FloatFunction<? super V> floatFunction)

Implements org.eclipse.collections.api.map.MutableMap.collectFloat, org.eclipse.collections.api.RichIterable.collectFloat.

Returns a new primitive float iterable with the results of applying the specified function on each element of the source collection.

public <R> MutableBag<R>
collectIf(Predicate<? super V> predicate, Function<? super V, ? extends R> function)

Implements org.eclipse.collections.api.map.MutableMap.collectIf, org.eclipse.collections.api.RichIterable.collectIf.

Returns a new collection with the results of applying the specified function on each element of the source collection, but only for those elements which return true upon evaluation of the predicate.

public MutableIntBag
collectInt(IntFunction<? super V> intFunction)

Implements org.eclipse.collections.api.map.MutableMap.collectInt, org.eclipse.collections.api.RichIterable.collectInt.

Returns a new primitive int iterable with the results of applying the specified function on each element of the source collection.

public <R> MutableMap<R, V>
public MutableLongBag
collectLong(LongFunction<? super V> longFunction)

Implements org.eclipse.collections.api.map.MutableMap.collectLong, org.eclipse.collections.api.RichIterable.collectLong.

Returns a new primitive long iterable with the results of applying the specified function on each element of the source collection.

public MutableShortBag
collectShort(ShortFunction<? super V> shortFunction)

Implements org.eclipse.collections.api.map.MutableMap.collectShort, org.eclipse.collections.api.RichIterable.collectShort.

Returns a new primitive short iterable with the results of applying the specified function on each element of the source collection.

public <R> MutableMap<K, R>
public <P, VV> MutableBag<VV>
collectWith(Function2<? super V, ? super P, ? extends VV> function, P parameter)

Implements org.eclipse.collections.api.map.MutableMap.collectWith, org.eclipse.collections.api.RichIterable.collectWith.

Same as collect(Function) with a Function2 and specified parameter which is passed to the block.

public <R> MutableBag<R>
public MutableSetMultimap<V, K>
public <VV> MutableBagMultimap<VV, V>
groupBy(Function<? super V, ? extends VV> function)

Implements org.eclipse.collections.api.map.MutableMap.groupBy, org.eclipse.collections.api.map.MutableMapIterable.groupBy, org.eclipse.collections.api.RichIterable.groupBy.

For each element of the iterable, the function is evaluated and the results of these evaluations are collected into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) species of collection as the source iterable.

public <VV> MutableBagMultimap<VV, V>
groupByEach(Function<? super V, ? extends Iterable<VV>> function)

Implements org.eclipse.collections.api.map.MutableMap.groupByEach, org.eclipse.collections.api.map.MutableMapIterable.groupByEach, org.eclipse.collections.api.RichIterable.groupByEach.

Similar to groupBy(Function), except the result of evaluating function will return a collection of keys for each value.

public <VV> MutableMap<VV, V>
groupByUniqueKey(Function<? super V, ? extends VV> function)

Overrides org.eclipse.collections.impl.map.mutable.AbstractMutableMapIterable.groupByUniqueKey.

Overrides default org.eclipse.collections.api.map.MutableMap.groupByUniqueKey.

Implements org.eclipse.collections.api.map.MutableMapIterable.groupByUniqueKey, org.eclipse.collections.api.RichIterable.groupByUniqueKey.

For each element of the iterable, the function is evaluated, and the results of these evaluations are collected into a new map, where the transformed value is the key.

public abstract <K, V> MutableMap<K, V>
newEmpty(int capacity)

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

public PartitionMutableBag<V>
partition(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.MutableMap.partition, org.eclipse.collections.api.map.MutableMapIterable.partition, org.eclipse.collections.api.RichIterable.partition.

Filters a collection into a PartitionedIterable based on the evaluation of the predicate.

public <P> PartitionMutableBag<V>
partitionWith(Predicate2<? super V, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.map.MutableMap.partitionWith, org.eclipse.collections.api.RichIterable.partitionWith.

Filters a collection into a PartitionIterable based on the evaluation of the predicate.

public MutableMap<K, V>
reject(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.map.MutableMap.reject, org.eclipse.collections.api.map.MutableMapIterable.reject, org.eclipse.collections.api.map.MapIterable.reject.

For each key and value of the map the predicate is evaluated, if the result of the evaluation is false, that key and value are returned in a new map.

public MutableBag<V>
reject(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.MutableMap.reject, org.eclipse.collections.api.map.MutableMapIterable.reject, org.eclipse.collections.api.RichIterable.reject.

Returns all elements of the source collection that return false when evaluating of the predicate.

public <P> MutableBag<V>
rejectWith(Predicate2<? super V, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.map.MutableMap.rejectWith, org.eclipse.collections.api.map.MutableMapIterable.rejectWith, org.eclipse.collections.api.RichIterable.rejectWith.

Similar to reject(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

public void
replaceAll(BiFunction<? super K, ? super V, ? extends V> function)

Overrides default java.util.Map.replaceAll.

Replaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception (optional operation).

public MutableMap<K, V>
select(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.map.MutableMap.select, org.eclipse.collections.api.map.MutableMapIterable.select, org.eclipse.collections.api.map.MapIterable.select.

For each key and value of the map the predicate is evaluated, if the result of the evaluation is true, that key and value are returned in a new map.

public MutableBag<V>
select(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.MutableMap.select, org.eclipse.collections.api.map.MutableMapIterable.select, org.eclipse.collections.api.RichIterable.select.

Returns all elements of the source collection that return true when evaluating the predicate.

public <S> MutableBag<S>
public <P> MutableBag<V>
selectWith(Predicate2<? super V, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.map.MutableMap.selectWith, org.eclipse.collections.api.map.MutableMapIterable.selectWith, org.eclipse.collections.api.RichIterable.selectWith.

Similar to select(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

public MutableMap<K, V>
public ImmutableMap<K, V>
public MutableMap<K, V>
public MutableMap<K, V>
withAllKeyValues(Iterable<? extends Pair<? extends K, ? extends V>> keyValues)

Implements org.eclipse.collections.api.map.MutableMap.withAllKeyValues, org.eclipse.collections.api.map.MutableMapIterable.withAllKeyValues.

This method allows mutable, fixed size, and immutable maps the ability to add elements to their existing elements.

public MutableMap<K, V>
withKeyValue(K key, V value)

Implements org.eclipse.collections.api.map.MutableMap.withKeyValue, org.eclipse.collections.api.map.MutableMapIterable.withKeyValue.

This method allows mutable, fixed size, and immutable maps the ability to add elements to their existing elements.

public MutableMap<K, V>
withoutAllKeys(Iterable<? extends K> keys)

Implements org.eclipse.collections.api.map.MutableMap.withoutAllKeys, org.eclipse.collections.api.map.MutableMapIterable.withoutAllKeys.

This method allows mutable, fixed size, and immutable maps the ability to remove elements from their existing elements.

public MutableMap<K, V>
withoutKey(K key)

Implements org.eclipse.collections.api.map.MutableMap.withoutKey, org.eclipse.collections.api.map.MutableMapIterable.withoutKey.

This method allows mutable, fixed size, and immutable maps the ability to remove elements from their existing elements.

public <S> MutableBag<Pair<V, S>>
zip(Iterable<S> that)

Implements org.eclipse.collections.api.map.MutableMap.zip, org.eclipse.collections.api.map.MutableMapIterable.zip, org.eclipse.collections.api.RichIterable.zip.

Deprecated in 6.0. Use OrderedIterable#zip(Iterable) instead.

Returns a RichIterable formed from this RichIterable and another RichIterable by combining corresponding elements in pairs.

public MutableSet<Pair<V, Integer>>
Inherited from org.eclipse.collections.impl.map.mutable.AbstractMutableMapIterable:
aggregateBycollectcountBycountByEachcountByWithdetectdetectOptionalflipUniqueValuesgetIfAbsentPutgetIfAbsentPutgetIfAbsentPutWithgetIfAbsentPutWithKeyiteratorkeysViewkeyValuesViewreduceBysumByDoublesumByFloatsumByIntsumByLongupdateValueupdateValueWithvaluesView