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

public Class SynchronizedBiMap<K, V>

extends AbstractSynchronizedMapIterable<K, V>
implements MutableBiMap<K, V>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, 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
Imports
java.io.Serializable, java.util.Collection, .Map, .Set, org.eclipse.collections.api.bimap.ImmutableBiMap, .MutableBiMap, org.eclipse.collections.api.block.function.Function, .Function0, .Function2, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.map.MapIterable, .MutableMap, 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.collection.mutable.SynchronizedMutableCollection, org.eclipse.collections.impl.list.fixed.ArrayAdapter, org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable, org.eclipse.collections.impl.map.mutable.SynchronizedBiMapSerializationProxy, org.eclipse.collections.impl.set.mutable.SynchronizedMutableSet

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
protected
protected
SynchronizedBiMap(MutableBiMap<K, V> delegate, Object lock)

Method Summary

Modifier and TypeMethod and Description
public <KK, VV> MutableMap<KK, VV>
aggregateBy(Function<? super V, ? extends KK> groupBy, Function0<? extends VV> zeroValueFactory, Function2<? super VV, ? super V, ? extends VV> nonMutatingAggregator)

Overrides org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable.aggregateBy.

Overrides default org.eclipse.collections.api.bimap.MutableBiMap.aggregateBy, org.eclipse.collections.api.map.MutableMapIterable.aggregateBy, org.eclipse.collections.api.RichIterable.aggregateBy.

Applies an aggregate function over the iterable grouping results into a map based on the specific groupBy function.

public <K1, V1, V2> MutableMap<K1, V2>
aggregateBy(Function<? super K, ? extends K1> keyFunction, Function<? super V, ? extends V1> valueFunction, Function0<? extends V2> zeroValueFactory, Function2<? super V2, ? super V1, ? extends V2> nonMutatingAggregator)

Overrides org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable.aggregateBy.

Overrides default org.eclipse.collections.api.bimap.MutableBiMap.aggregateBy, org.eclipse.collections.api.map.MutableMapIterable.aggregateBy.

Applies an aggregate function over the map grouping results into a map based on the specific key and value groupBy functions.

public MutableBiMap<K, V>
public MutableBiMap<K, V>
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> MutableBiMap<K2, V2>
collect(Function2<? super K, ? super V, Pair<K2, V2>> function)

Implements org.eclipse.collections.api.bimap.MutableBiMap.collect, org.eclipse.collections.api.map.MutableMapIterable.collect.

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

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.map.MutableMapIterable.collectKeysUnique.

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

public <R> MutableBiMap<K, R>
collectValues(Function2<? super K, ? super V, ? extends R> function)

Implements org.eclipse.collections.api.bimap.MutableBiMap.collectValues, org.eclipse.collections.api.map.MutableMapIterable.collectValues.

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

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

Implements java.util.Map.entrySet.

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

public MutableSetMultimap<V, K>
flip()

Implements org.eclipse.collections.api.bimap.MutableBiMap.flip, org.eclipse.collections.api.map.MutableMapIterable.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.map.MutableMapIterable.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.

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

Overrides org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable.groupBy.

Implements org.eclipse.collections.api.bimap.MutableBiMap.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 <V1> MutableSetMultimap<V1, V>
public <VV> MutableBiMap<VV, V>
groupByUniqueKey(Function<? super V, ? extends VV> function)

Overrides org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable.groupByUniqueKey.

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

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

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

public Set<K>
keySet()

Implements java.util.Map.keySet.

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

public MutableBiMap<K, V>
newEmpty()

Implements org.eclipse.collections.api.bimap.MutableBiMap.newEmpty, org.eclipse.collections.api.map.MutableMapIterable.newEmpty.

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

public static <K, V> SynchronizedBiMap<K, V>
of(MutableBiMap<K, V> map)

This method will take a MutableBiMap and wrap it directly in a SynchronizedBiMap.

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

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.partitionWith.

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

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

public void
public <KK> MutableMap<KK, V>
reduceBy(Function<? super V, ? extends KK> groupBy, Function2<? super V, ? super V, ? extends V> reduceFunction)

Overrides org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable.reduceBy.

Overrides default org.eclipse.collections.api.bimap.MutableBiMap.reduceBy, org.eclipse.collections.api.map.MutableMapIterable.reduceBy, org.eclipse.collections.api.RichIterable.reduceBy.

Applies an aggregate function over the iterable grouping results into a map based on the specific groupBy function.

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.reject, org.eclipse.collections.api.map.MutableMapIterable.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 <P> MutableSet<V>
public MutableSet<V>
public MutableBiMap<K, V>
select(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.bimap.MutableBiMap.select, org.eclipse.collections.api.map.MutableMapIterable.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 <S> MutableSet<S>
public <P> MutableSet<V>
public MutableBiMap<K, V>
public ImmutableBiMap<K, V>
public Collection<V>
values()

Implements java.util.Map.values.

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

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

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.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 MutableBiMap<K, V>
withMap(Map<? extends K, ? extends V> map)

Overrides default org.eclipse.collections.api.bimap.MutableBiMap.withMap, org.eclipse.collections.api.map.MutableMapIterable.withMap.

Similar to putAll(Map), but returns this instead of void

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

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

Implements org.eclipse.collections.api.bimap.MutableBiMap.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.

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

Overrides org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable.zip.

Implements org.eclipse.collections.api.bimap.MutableBiMap.zip, org.eclipse.collections.api.map.MutableMapIterable.zip, org.eclipse.collections.api.RichIterable.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.map.AbstractSynchronizedMapIterable:
addaggregateInPlaceByclearcontainsKeycontainsValuecountBycountByEachcountByWithdetectdetectOptionalforEachKeyforEachKeyValueforEachValuegetgetIfAbsentgetIfAbsentPutgetIfAbsentPutgetIfAbsentPutWithgetIfAbsentPutWithKeygetIfAbsentValuegetIfAbsentWithifPresentApplykeysViewkeyValuesViewmergeputputAllputPairremoveremoveAllKeysremoveIfremoveKeysumByDoublesumByFloatsumByIntsumByLongupdateValueupdateValueWithvaluesView