Top Inners Fields Constructors Methods
org.eclipse.collections.impl.bimap.mutable

pack-priv abstract Class AbstractMutableBiMap<K, V>

extends AbstractBiMap<K, V>
implements MutableBiMap<K, V>
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.api.bimap.MutableBiMap, java.lang.Cloneable, org.eclipse.collections.api.map.MutableMapIterable, java.util.Map, org.eclipse.collections.api.map.MapIterable, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, java.lang.Iterable, org.eclipse.collections.api.bimap.BiMap
Known Direct Subclasses
org.eclipse.collections.impl.bimap.mutable.AbstractMutableBiMap.Inverse, org.eclipse.collections.impl.bimap.mutable.HashBiMap
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, .Serializable, java.lang.reflect.Array, java.util.Collection, .Iterator, .Map, .Set, java.util.function.Consumer, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.bag.primitive.MutableBooleanBag, .MutableByteBag, .MutableCharBag, .MutableDoubleBag, .MutableFloatBag, .MutableIntBag, .MutableLongBag, .MutableShortBag, org.eclipse.collections.api.bimap.ImmutableBiMap, .MutableBiMap, org.eclipse.collections.api.block.function.Function, .Function0, .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.BiMaps, .Sets, org.eclipse.collections.api.map.primitive.MutableObjectDoubleMap, .MutableObjectLongMap, org.eclipse.collections.api.multimap.set.MutableSetMultimap, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.set.PartitionMutableSet, org.eclipse.collections.api.set.MutableSet, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.bimap.AbstractBiMap, org.eclipse.collections.impl.block.factory.Predicates, org.eclipse.collections.impl.block.procedure.CollectionAddProcedure, .PartitionProcedure, .SelectInstancesOfProcedure, org.eclipse.collections.impl.list.fixed.ArrayAdapter, org.eclipse.collections.impl.map.mutable.UnifiedMap, org.eclipse.collections.impl.multimap.set.UnifiedSetMultimap, org.eclipse.collections.impl.partition.set.PartitionUnifiedSet, org.eclipse.collections.impl.set.mutable.UnifiedSet, org.eclipse.collections.impl.utility.Iterate, .MapIterate

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
private class
private static class
protected class
protected class

Field Summary

Modifier and TypeField and Description
private UnifiedMap<K, V>
private AbstractMutableBiMap<V, K>

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
AbstractMutableBiMap(Map<K, V> delegate, Map<V, K> inverse)

private
AbstractMutableBiMap(Map<K, V> delegate, AbstractMutableBiMap<V, K> valuesToKeys)

Method Summary

Modifier and TypeMethod and Description
public MutableBiMap<K, V>
asSynchronized()

Implements org.eclipse.collections.api.bimap.MutableBiMap.asSynchronized.

Returns a synchronized wrapper backed by this map.

public MutableBiMap<K, V>
asUnmodifiable()

Implements org.eclipse.collections.api.bimap.MutableBiMap.asUnmodifiable.

Returns an unmodifiable view of this map.

private void
checkNull(Map<K, V> delegate, Map<V, K> inverse)

private void
checkSame(Map<K, V> keysToValues, Map<V, K> valuesToKeys)

public void
clear()

Implements java.util.Map.clear.

Removes all of the mappings from this map (optional operation).

public MutableBiMap<K, V>
clone()

Overrides java.lang.Object.clone.

Implements org.eclipse.collections.api.bimap.MutableBiMap.clone.

Creates and returns a copy of this object.

public <K2, V2> HashBiMap<K2, V2>
collect(Function2<? super K, ? super V, Pair<K2, V2>> function)

Implements org.eclipse.collections.api.bimap.MutableBiMap.collect, org.eclipse.collections.api.bimap.BiMap.collect.

For each key and value of the map the function is evaluated.

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

Implements 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.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.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.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.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.RichIterable.collectFloat.

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

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

Implements 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.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> MutableBiMap<R, V>
collectKeysUnique(Function2<? super K, ? super V, ? extends R> function)

Implements org.eclipse.collections.api.bimap.MutableBiMap.collectKeysUnique, org.eclipse.collections.api.bimap.BiMap.collectKeysUnique.

For each key and value of the map the function is evaluated.

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

Implements 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.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> HashBiMap<K, R>
collectValues(Function2<? super K, ? super V, ? extends R> function)

Implements org.eclipse.collections.api.bimap.MutableBiMap.collectValues, org.eclipse.collections.api.bimap.BiMap.collectValues.

For each key and value of the map the function is evaluated.

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

Implements org.eclipse.collections.api.RichIterable.collectWith.

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

public Set<Map.Entry<K, V>>
entrySet()

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.

public <VV> MutableBag<VV>
flatCollect(Function<? super V, ? extends Iterable<VV>> function)

Implements org.eclipse.collections.api.RichIterable.flatCollect.

flatCollect is a special case of collect(Function).

public MutableSetMultimap<V, K>
flip()

Implements org.eclipse.collections.api.bimap.MutableBiMap.flip, org.eclipse.collections.api.bimap.BiMap.flip.

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

public MutableBiMap<V, K>
flipUniqueValues()

Implements org.eclipse.collections.api.bimap.MutableBiMap.flipUniqueValues, org.eclipse.collections.api.bimap.BiMap.flipUniqueValues.

Return the MapIterable that is obtained by flipping the direction of this map and making the associations from value to key.

public V
forcePut(K key, V value)

Implements org.eclipse.collections.api.bimap.MutableBiMap.forcePut.

Similar to put(Object, Object), except that it quietly removes any existing entry with the same value before putting the key-value pair.

public void
forEachValue(Procedure<? super V> procedure)

Overrides org.eclipse.collections.impl.bimap.AbstractBiMap.forEachValue.

Implements org.eclipse.collections.api.map.MapIterable.forEachValue.

Calls the procedure with each value of the map.

protected UnifiedMap<K, V>
public V
getIfAbsentPut(K key, V value)

Implements org.eclipse.collections.api.map.MutableMapIterable.getIfAbsentPut.

Get and return the value in the Map at the specified key.

public V
getIfAbsentPut(K key, Function0<? extends V> function)

Implements org.eclipse.collections.api.map.MutableMapIterable.getIfAbsentPut, org.eclipse.collections.api.map.MutableMapIterable.getIfAbsentPut.

Get and return the value in the Map at the specified key.

public <P> V
getIfAbsentPutWith(K key, Function<? super P, ? extends V> function, P parameter)

Implements org.eclipse.collections.api.map.MutableMapIterable.getIfAbsentPutWith.

Get and return the value in the Map at the specified key.

public V
getIfAbsentPutWithKey(K key, Function<? super K, ? extends V> function)

Implements org.eclipse.collections.api.map.MutableMapIterable.getIfAbsentPutWithKey.

Get and return the value in the Map at the specified key.

protected UnifiedMap<V, K>
public <VV> MutableSetMultimap<VV, V>
groupBy(Function<? super V, ? extends VV> function)

Implements org.eclipse.collections.api.bimap.MutableBiMap.groupBy, org.eclipse.collections.api.bimap.BiMap.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> MutableSetMultimap<VV, V>
groupByEach(Function<? super V, ? extends Iterable<VV>> function)

Implements org.eclipse.collections.api.bimap.MutableBiMap.groupByEach, org.eclipse.collections.api.bimap.BiMap.groupByEach.

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

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

Overrides default org.eclipse.collections.api.bimap.MutableBiMap.groupByUniqueKey.

Implements org.eclipse.collections.api.bimap.BiMap.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 MutableBiMap<V, K>
inverse()

Implements org.eclipse.collections.api.bimap.MutableBiMap.inverse, org.eclipse.collections.api.bimap.BiMap.inverse.

Returns an inversed view of this BiMap, where the associations are in the direction of this bimap's values to keys.

public Iterator<V>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public Set<K>
keySet()

Implements java.util.Map.keySet.

Returns a Set view of the keys contained in this map.

public HashBiMap<K, V>
newEmpty()

Implements org.eclipse.collections.api.bimap.MutableBiMap.newEmpty.

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

private static boolean
public PartitionMutableSet<V>
partition(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.bimap.MutableBiMap.partition, org.eclipse.collections.api.bimap.BiMap.partition.

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

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.partitionWith, org.eclipse.collections.api.bimap.BiMap.partitionWith.

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

public V
put(K key, V value)

Implements org.eclipse.collections.api.bimap.MutableBiMap.put.

Similar to Map#put(Object, Object), except that it throws on the addition of a duplicate value.

public void
putAll(Map<? extends K, ? extends V> map)

Implements java.util.Map.putAll.

Copies all of the mappings from the specified map to this map (optional operation).

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.reject, org.eclipse.collections.api.bimap.BiMap.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 MutableSet<V>
reject(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.bimap.MutableBiMap.reject, org.eclipse.collections.api.bimap.BiMap.reject.

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

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.rejectWith, org.eclipse.collections.api.bimap.BiMap.rejectWith.

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

public V
remove(Object key)

Implements java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation).

public V
removeKey(K key)

Implements org.eclipse.collections.api.map.MutableMapIterable.removeKey.

Remove an entry from the map at the specified key.

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.select, org.eclipse.collections.api.bimap.BiMap.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 MutableSet<V>
select(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.bimap.MutableBiMap.select, org.eclipse.collections.api.bimap.BiMap.select.

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

public <S> MutableSet<S>
selectInstancesOf(Class<S> clazz)

Implements org.eclipse.collections.api.bimap.MutableBiMap.selectInstancesOf, org.eclipse.collections.api.bimap.BiMap.selectInstancesOf.

Returns all elements of the source collection that are instances of the Class clazz.

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.selectWith, org.eclipse.collections.api.bimap.BiMap.selectWith.

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

public <V1> MutableObjectDoubleMap<V1>
sumByDouble(Function<? super V, ? extends V1> groupBy, DoubleFunction<? super V> function)

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

Groups and sums the values using the two specified functions.

public <V1> MutableObjectDoubleMap<V1>
sumByFloat(Function<? super V, ? extends V1> groupBy, FloatFunction<? super V> function)

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

Groups and sums the values using the two specified functions.

public <V1> MutableObjectLongMap<V1>
sumByInt(Function<? super V, ? extends V1> groupBy, IntFunction<? super V> function)

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

Groups and sums the values using the two specified functions.

public <V1> MutableObjectLongMap<V1>
sumByLong(Function<? super V, ? extends V1> groupBy, LongFunction<? super V> function)

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

Groups and sums the values using the two specified functions.

public MutableBiMap<K, V>
tap(Procedure<? super V> procedure)

Implements org.eclipse.collections.api.bimap.MutableBiMap.tap, org.eclipse.collections.api.bimap.BiMap.tap.

Executes the Procedure for each value of the map and returns this.

public ImmutableBiMap<K, V>
public V
updateValue(K key, Function0<? extends V> factory, Function<? super V, ? extends V> function)

Implements org.eclipse.collections.api.map.MutableMapIterable.updateValue.

Looks up the value associated with key, applies the function to it, and replaces the value.

public <P> V
updateValueWith(K key, Function0<? extends V> factory, Function2<? super V, ? super P, ? extends V> function, P parameter)

Implements org.eclipse.collections.api.map.MutableMapIterable.updateValueWith.

Same as updateValue(Object, Function0, Function) with a Function2 and specified parameter which is passed to the function.

public Collection<V>
values()

Implements java.util.Map.values.

Returns a Collection view of the values contained in this map.

public MutableBiMap<K, V>
withAllKeyValueArguments(Pair<? extends K, ? extends V>... keyValuePairs)

Implements org.eclipse.collections.api.bimap.MutableBiMap.withAllKeyValueArguments.

Convenience var-args version of withAllKeyValues

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.withAllKeyValues.

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

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.withKeyValue.

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

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.withoutAllKeys.

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

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.withoutKey.

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

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.zip, org.eclipse.collections.api.bimap.BiMap.zip.

Deprecated in 8.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.bimap.AbstractBiMap:
allSatisfyallSatisfyWithanySatisfyanySatisfyWithappendStringappendStringappendStringasLazychunkcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithcontainscontainsAllcontainsAllArgumentscontainsAllIterablecontainsKeycontainsValuecountcountWithdetectdetectdetectIfNonedetectOptionaldetectOptionaldetectWithdetectWithIfNonedetectWithOptionaleachequalsflatCollectflatCollectBooleanflatCollectByteflatCollectCharflatCollectDoubleflatCollectFloatflatCollectIntflatCollectLongflatCollectShortforEachKeyforEachKeyValueforEachWithforEachWithIndexgetgetFirstgetIfAbsentgetIfAbsentValuegetIfAbsentWithgetLastgetOnlygetOrDefaultgroupBygroupByEachgroupByUniqueKeyhashCodeifPresentApplyinjectIntoinjectIntoinjectIntoinjectIntoinjectIntointoisEmptykeysViewkeyValuesViewmakeStringmakeStringmakeStringmaxmaxmaxByminminminBynoneSatisfynoneSatisfyWithnotEmptyrejectrejectWithselectselectWithsizesumOfDoublesumOfFloatsumOfIntsumOfLongtoArraytoArraytoBagtoBiMaptoListtoMaptoMaptoSettoSortedBagtoSortedBagtoSortedListtoSortedListtoSortedMaptoSortedMaptoSortedSettoSortedSettoStringvaluesViewzipzipWithIndex