Class SynchronizedBiMap<K,V>
- java.lang.Object
-
- org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable<V>
-
- org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable<K,V>
-
- org.eclipse.collections.impl.bimap.mutable.SynchronizedBiMap<K,V>
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<V>
,Map<K,V>
,BiMap<K,V>
,MutableBiMap<K,V>
,InternalIterable<V>
,MapIterable<K,V>
,MutableMapIterable<K,V>
,RichIterable<V>
public class SynchronizedBiMap<K,V> extends AbstractSynchronizedMapIterable<K,V> implements MutableBiMap<K,V>, Serializable
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <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)
<KK,VV>
MutableMap<KK,VV>aggregateBy(Function<? super V,? extends KK> groupBy, Function0<? extends VV> zeroValueFactory, Function2<? super VV,? super V,? extends VV> nonMutatingAggregator)
MutableBiMap<K,V>
asSynchronized()
MutableBiMap<K,V>
asUnmodifiable()
MutableBiMap<K,V>
clone()
<K2,V2>
MutableBiMap<K2,V2>collect(Function2<? super K,? super V,Pair<K2,V2>> function)
<R> MutableBiMap<K,R>
collectValues(Function2<? super K,? super V,? extends R> function)
Set<Map.Entry<K,V>>
entrySet()
MutableSetMultimap<V,K>
flip()
MutableBiMap<V,K>
flipUniqueValues()
V
forcePut(K key, V value)
<V1> MutableSetMultimap<V1,V>
groupBy(Function<? super V,? extends V1> function)
<V1> MutableSetMultimap<V1,V>
groupByEach(Function<? super V,? extends Iterable<V1>> function)
<VV> MutableBiMap<VV,V>
groupByUniqueKey(Function<? super V,? extends VV> function)
MutableBiMap<V,K>
inverse()
Set<K>
keySet()
MutableBiMap<K,V>
newEmpty()
static <K,V>
SynchronizedBiMap<K,V>of(MutableBiMap<K,V> map)
This method will take a MutableBiMap and wrap it directly in a SynchronizedBiMap.PartitionMutableSet<V>
partition(Predicate<? super V> predicate)
<P> PartitionMutableSet<V>
partitionWith(Predicate2<? super V,? super P> predicate, P parameter)
void
putAllMapIterable(MapIterable<? extends K,? extends V> mapIterable)
MutableSet<V>
reject(Predicate<? super V> predicate)
MutableBiMap<K,V>
reject(Predicate2<? super K,? super V> predicate)
<P> MutableSet<V>
rejectWith(Predicate2<? super V,? super P> predicate, P parameter)
MutableSet<V>
select(Predicate<? super V> predicate)
MutableBiMap<K,V>
select(Predicate2<? super K,? super V> predicate)
<S> MutableSet<S>
selectInstancesOf(Class<S> clazz)
<P> MutableSet<V>
selectWith(Predicate2<? super V,? super P> predicate, P parameter)
MutableBiMap<K,V>
tap(Procedure<? super V> procedure)
ImmutableBiMap<K,V>
toImmutable()
Collection<V>
values()
MutableBiMap<K,V>
withAllKeyValueArguments(Pair<? extends K,? extends V>... keyValuePairs)
MutableBiMap<K,V>
withAllKeyValues(Iterable<? extends Pair<? extends K,? extends V>> keyValues)
MutableBiMap<K,V>
withKeyValue(K key, V value)
MutableBiMap<K,V>
withMap(Map<? extends K,? extends V> map)
MutableBiMap<K,V>
withMapIterable(MapIterable<? extends K,? extends V> mapIterable)
MutableBiMap<K,V>
withoutAllKeys(Iterable<? extends K> keys)
MutableBiMap<K,V>
withoutKey(K key)
<S> MutableSet<Pair<V,S>>
zip(Iterable<S> that)
Deprecated.in 8.0.MutableSet<Pair<V,Integer>>
zipWithIndex()
Deprecated.in 8.0.-
Methods inherited from class org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable
add, aggregateInPlaceBy, clear, containsKey, containsValue, countBy, countByEach, countByWith, detect, detectOptional, forEachKey, forEachKeyValue, forEachValue, get, getIfAbsent, getIfAbsentPut, getIfAbsentPut, getIfAbsentPutWith, getIfAbsentPutWithKey, getIfAbsentValue, getIfAbsentWith, ifPresentApply, keysView, keyValuesView, put, putAll, putPair, remove, removeAllKeys, removeIf, removeKey, sumByDouble, sumByFloat, sumByInt, sumByLong, updateValue, updateValueWith, valuesView
-
Methods inherited from class org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collect, collectBoolean, collectBoolean, collectByte, collectByte, collectChar, collectChar, collectDouble, collectDouble, collectFloat, collectFloat, collectIf, collectIf, collectInt, collectInt, collectLong, collectLong, collectShort, collectShort, collectWith, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, equals, flatCollect, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, forEachWith, forEachWithIndex, getFirst, getLast, getOnly, groupBy, groupByEach, groupByUniqueKey, hashCode, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, iterator, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reject, rejectWith, select, selectWith, size, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableList, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toString, zip, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndex
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, get, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
-
Methods inherited from interface org.eclipse.collections.api.map.MapIterable
containsKey, containsValue, detect, detectOptional, equals, forEachKey, forEachKeyValue, forEachValue, get, getIfAbsent, getIfAbsentValue, getIfAbsentWith, hashCode, ifPresentApply, injectIntoKeyValue, keysView, keyValuesView, parallelStream, spliterator, stream, toString, valuesView
-
Methods inherited from interface org.eclipse.collections.api.bimap.MutableBiMap
put
-
Methods inherited from interface org.eclipse.collections.api.map.MutableMapIterable
add, aggregateInPlaceBy, countBy, countByEach, countByWith, forEach, getIfAbsentPut, getIfAbsentPut, getIfAbsentPutWith, getIfAbsentPutWithKey, getOrDefault, putPair, removeAllKeys, removeIf, removeKey, sumByDouble, sumByFloat, sumByInt, sumByLong, updateValue, updateValueWith
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collect, collectBoolean, collectBoolean, collectByte, collectByte, collectChar, collectChar, collectDouble, collectDouble, collectFloat, collectFloat, collectIf, collectIf, collectInt, collectInt, collectLong, collectLong, collectShort, collectShort, collectWith, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, flatCollectWith, forEach, getAny, getFirst, getLast, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndex
-
-
-
-
Method Detail
-
of
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.
-
asSynchronized
public MutableBiMap<K,V> asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableBiMap<K,V>
- Specified by:
asSynchronized
in interfaceMutableMapIterable<K,V>
-
asUnmodifiable
public MutableBiMap<K,V> asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableBiMap<K,V>
- Specified by:
asUnmodifiable
in interfaceMutableMapIterable<K,V>
-
clone
public MutableBiMap<K,V> clone()
- Specified by:
clone
in interfaceMutableBiMap<K,V>
-
tap
public MutableBiMap<K,V> tap(Procedure<? super V> procedure)
- Specified by:
tap
in interfaceBiMap<K,V>
- Specified by:
tap
in interfaceMapIterable<K,V>
- Specified by:
tap
in interfaceMutableBiMap<K,V>
- Specified by:
tap
in interfaceMutableMapIterable<K,V>
- Specified by:
tap
in interfaceRichIterable<K>
- Overrides:
tap
in classAbstractSynchronizedMapIterable<K,V>
-
collect
public <K2,V2> MutableBiMap<K2,V2> collect(Function2<? super K,? super V,Pair<K2,V2>> function)
-
collectValues
public <R> MutableBiMap<K,R> collectValues(Function2<? super K,? super V,? extends R> function)
- Specified by:
collectValues
in interfaceBiMap<K,V>
- Specified by:
collectValues
in interfaceMapIterable<K,V>
- Specified by:
collectValues
in interfaceMutableBiMap<K,V>
- Specified by:
collectValues
in interfaceMutableMapIterable<K,V>
-
select
public MutableSet<V> select(Predicate<? super V> predicate)
- Specified by:
select
in interfaceBiMap<K,V>
- Specified by:
select
in interfaceMutableBiMap<K,V>
- Specified by:
select
in interfaceMutableMapIterable<K,V>
- Specified by:
select
in interfaceRichIterable<K>
- Overrides:
select
in classAbstractSynchronizedMapIterable<K,V>
-
select
public MutableBiMap<K,V> select(Predicate2<? super K,? super V> predicate)
-
selectWith
public <P> MutableSet<V> selectWith(Predicate2<? super V,? super P> predicate, P parameter)
- Specified by:
selectWith
in interfaceBiMap<K,V>
- Specified by:
selectWith
in interfaceMutableBiMap<K,V>
- Specified by:
selectWith
in interfaceMutableMapIterable<K,V>
- Specified by:
selectWith
in interfaceRichIterable<K>
- Overrides:
selectWith
in classAbstractSynchronizedMapIterable<K,V>
-
selectInstancesOf
public <S> MutableSet<S> selectInstancesOf(Class<S> clazz)
- Specified by:
selectInstancesOf
in interfaceBiMap<K,V>
- Specified by:
selectInstancesOf
in interfaceMutableBiMap<K,V>
- Specified by:
selectInstancesOf
in interfaceMutableMapIterable<K,V>
- Specified by:
selectInstancesOf
in interfaceRichIterable<K>
- Overrides:
selectInstancesOf
in classAbstractSynchronizedMapIterable<K,V>
-
reject
public MutableSet<V> reject(Predicate<? super V> predicate)
- Specified by:
reject
in interfaceBiMap<K,V>
- Specified by:
reject
in interfaceMutableBiMap<K,V>
- Specified by:
reject
in interfaceMutableMapIterable<K,V>
- Specified by:
reject
in interfaceRichIterable<K>
- Overrides:
reject
in classAbstractSynchronizedMapIterable<K,V>
-
reject
public MutableBiMap<K,V> reject(Predicate2<? super K,? super V> predicate)
-
rejectWith
public <P> MutableSet<V> rejectWith(Predicate2<? super V,? super P> predicate, P parameter)
- Specified by:
rejectWith
in interfaceBiMap<K,V>
- Specified by:
rejectWith
in interfaceMutableBiMap<K,V>
- Specified by:
rejectWith
in interfaceMutableMapIterable<K,V>
- Specified by:
rejectWith
in interfaceRichIterable<K>
- Overrides:
rejectWith
in classAbstractSynchronizedMapIterable<K,V>
-
partition
public PartitionMutableSet<V> partition(Predicate<? super V> predicate)
- Specified by:
partition
in interfaceBiMap<K,V>
- Specified by:
partition
in interfaceMutableBiMap<K,V>
- Specified by:
partition
in interfaceMutableMapIterable<K,V>
- Specified by:
partition
in interfaceRichIterable<K>
- Overrides:
partition
in classAbstractSynchronizedMapIterable<K,V>
-
partitionWith
public <P> PartitionMutableSet<V> partitionWith(Predicate2<? super V,? super P> predicate, P parameter)
- Specified by:
partitionWith
in interfaceBiMap<K,V>
- Specified by:
partitionWith
in interfaceMutableBiMap<K,V>
- Specified by:
partitionWith
in interfaceRichIterable<K>
- Overrides:
partitionWith
in classAbstractSynchronizedRichIterable<V>
-
groupBy
public <V1> MutableSetMultimap<V1,V> groupBy(Function<? super V,? extends V1> function)
- Specified by:
groupBy
in interfaceBiMap<K,V>
- Specified by:
groupBy
in interfaceMutableBiMap<K,V>
- Specified by:
groupBy
in interfaceMutableMapIterable<K,V>
- Specified by:
groupBy
in interfaceRichIterable<K>
- Overrides:
groupBy
in classAbstractSynchronizedMapIterable<K,V>
-
groupByEach
public <V1> MutableSetMultimap<V1,V> groupByEach(Function<? super V,? extends Iterable<V1>> function)
- Specified by:
groupByEach
in interfaceBiMap<K,V>
- Specified by:
groupByEach
in interfaceMutableBiMap<K,V>
- Specified by:
groupByEach
in interfaceMutableMapIterable<K,V>
- Specified by:
groupByEach
in interfaceRichIterable<K>
- Overrides:
groupByEach
in classAbstractSynchronizedMapIterable<K,V>
-
aggregateBy
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)
- Specified by:
aggregateBy
in interfaceMutableBiMap<K,V>
- Specified by:
aggregateBy
in interfaceMutableMapIterable<K,V>
- Specified by:
aggregateBy
in interfaceRichIterable<K>
- Overrides:
aggregateBy
in classAbstractSynchronizedMapIterable<K,V>
- Since:
- 11.0
-
aggregateBy
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)
- Specified by:
aggregateBy
in interfaceMapIterable<K,V>
- Specified by:
aggregateBy
in interfaceMutableBiMap<K,V>
- Specified by:
aggregateBy
in interfaceMutableMapIterable<K,V>
- Overrides:
aggregateBy
in classAbstractSynchronizedMapIterable<K,V>
- Since:
- 11.0
-
flip
public MutableSetMultimap<V,K> flip()
-
newEmpty
public MutableBiMap<K,V> newEmpty()
- Specified by:
newEmpty
in interfaceMutableBiMap<K,V>
- Specified by:
newEmpty
in interfaceMutableMapIterable<K,V>
-
inverse
public MutableBiMap<V,K> inverse()
-
flipUniqueValues
public MutableBiMap<V,K> flipUniqueValues()
- Specified by:
flipUniqueValues
in interfaceBiMap<K,V>
- Specified by:
flipUniqueValues
in interfaceMapIterable<K,V>
- Specified by:
flipUniqueValues
in interfaceMutableBiMap<K,V>
- Specified by:
flipUniqueValues
in interfaceMutableMapIterable<K,V>
-
toImmutable
public ImmutableBiMap<K,V> toImmutable()
- Specified by:
toImmutable
in interfaceBiMap<K,V>
- Specified by:
toImmutable
in interfaceMapIterable<K,V>
- Specified by:
toImmutable
in interfaceMutableMapIterable<K,V>
-
zipWithIndex
@Deprecated public MutableSet<Pair<V,Integer>> zipWithIndex()
Deprecated.in 8.0. UseOrderedIterable.zipWithIndex()
instead.- Specified by:
zipWithIndex
in interfaceBiMap<K,V>
- Specified by:
zipWithIndex
in interfaceMutableBiMap<K,V>
- Specified by:
zipWithIndex
in interfaceMutableMapIterable<K,V>
- Specified by:
zipWithIndex
in interfaceRichIterable<K>
- Overrides:
zipWithIndex
in classAbstractSynchronizedMapIterable<K,V>
-
groupByUniqueKey
public <VV> MutableBiMap<VV,V> groupByUniqueKey(Function<? super V,? extends VV> function)
- Specified by:
groupByUniqueKey
in interfaceBiMap<K,V>
- Specified by:
groupByUniqueKey
in interfaceMutableBiMap<K,V>
- Specified by:
groupByUniqueKey
in interfaceMutableMapIterable<K,V>
- Specified by:
groupByUniqueKey
in interfaceRichIterable<K>
- Overrides:
groupByUniqueKey
in classAbstractSynchronizedMapIterable<K,V>
-
zip
@Deprecated public <S> MutableSet<Pair<V,S>> zip(Iterable<S> that)
Deprecated.in 8.0. UseOrderedIterable.zip(Iterable)
instead.- Specified by:
zip
in interfaceBiMap<K,V>
- Specified by:
zip
in interfaceMutableBiMap<K,V>
- Specified by:
zip
in interfaceMutableMapIterable<K,V>
- Specified by:
zip
in interfaceRichIterable<K>
- Overrides:
zip
in classAbstractSynchronizedMapIterable<K,V>
-
withKeyValue
public MutableBiMap<K,V> withKeyValue(K key, V value)
- Specified by:
withKeyValue
in interfaceMutableBiMap<K,V>
- Specified by:
withKeyValue
in interfaceMutableMapIterable<K,V>
-
withMap
public MutableBiMap<K,V> withMap(Map<? extends K,? extends V> map)
- Specified by:
withMap
in interfaceMutableBiMap<K,V>
- Specified by:
withMap
in interfaceMutableMapIterable<K,V>
-
withMapIterable
public MutableBiMap<K,V> withMapIterable(MapIterable<? extends K,? extends V> mapIterable)
- Specified by:
withMapIterable
in interfaceMutableBiMap<K,V>
- Specified by:
withMapIterable
in interfaceMutableMapIterable<K,V>
-
putAllMapIterable
public void putAllMapIterable(MapIterable<? extends K,? extends V> mapIterable)
- Specified by:
putAllMapIterable
in interfaceMutableMapIterable<K,V>
-
withAllKeyValues
public MutableBiMap<K,V> withAllKeyValues(Iterable<? extends Pair<? extends K,? extends V>> keyValues)
- Specified by:
withAllKeyValues
in interfaceMutableBiMap<K,V>
- Specified by:
withAllKeyValues
in interfaceMutableMapIterable<K,V>
-
withAllKeyValueArguments
public MutableBiMap<K,V> withAllKeyValueArguments(Pair<? extends K,? extends V>... keyValuePairs)
- Specified by:
withAllKeyValueArguments
in interfaceMutableBiMap<K,V>
- Specified by:
withAllKeyValueArguments
in interfaceMutableMapIterable<K,V>
-
withoutKey
public MutableBiMap<K,V> withoutKey(K key)
- Specified by:
withoutKey
in interfaceMutableBiMap<K,V>
- Specified by:
withoutKey
in interfaceMutableMapIterable<K,V>
-
withoutAllKeys
public MutableBiMap<K,V> withoutAllKeys(Iterable<? extends K> keys)
- Specified by:
withoutAllKeys
in interfaceMutableBiMap<K,V>
- Specified by:
withoutAllKeys
in interfaceMutableMapIterable<K,V>
-
-