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()VforcePut(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)voidputAllMapIterable(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:
asSynchronizedin interfaceMutableBiMap<K,V>- Specified by:
asSynchronizedin interfaceMutableMapIterable<K,V>
-
asUnmodifiable
public MutableBiMap<K,V> asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableBiMap<K,V>- Specified by:
asUnmodifiablein interfaceMutableMapIterable<K,V>
-
clone
public MutableBiMap<K,V> clone()
- Specified by:
clonein interfaceMutableBiMap<K,V>
-
tap
public MutableBiMap<K,V> tap(Procedure<? super V> procedure)
- Specified by:
tapin interfaceBiMap<K,V>- Specified by:
tapin interfaceMapIterable<K,V>- Specified by:
tapin interfaceMutableBiMap<K,V>- Specified by:
tapin interfaceMutableMapIterable<K,V>- Specified by:
tapin interfaceRichIterable<K>- Overrides:
tapin 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:
collectValuesin interfaceBiMap<K,V>- Specified by:
collectValuesin interfaceMapIterable<K,V>- Specified by:
collectValuesin interfaceMutableBiMap<K,V>- Specified by:
collectValuesin interfaceMutableMapIterable<K,V>
-
select
public MutableSet<V> select(Predicate<? super V> predicate)
- Specified by:
selectin interfaceBiMap<K,V>- Specified by:
selectin interfaceMutableBiMap<K,V>- Specified by:
selectin interfaceMutableMapIterable<K,V>- Specified by:
selectin interfaceRichIterable<K>- Overrides:
selectin 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:
selectWithin interfaceBiMap<K,V>- Specified by:
selectWithin interfaceMutableBiMap<K,V>- Specified by:
selectWithin interfaceMutableMapIterable<K,V>- Specified by:
selectWithin interfaceRichIterable<K>- Overrides:
selectWithin classAbstractSynchronizedMapIterable<K,V>
-
selectInstancesOf
public <S> MutableSet<S> selectInstancesOf(Class<S> clazz)
- Specified by:
selectInstancesOfin interfaceBiMap<K,V>- Specified by:
selectInstancesOfin interfaceMutableBiMap<K,V>- Specified by:
selectInstancesOfin interfaceMutableMapIterable<K,V>- Specified by:
selectInstancesOfin interfaceRichIterable<K>- Overrides:
selectInstancesOfin classAbstractSynchronizedMapIterable<K,V>
-
reject
public MutableSet<V> reject(Predicate<? super V> predicate)
- Specified by:
rejectin interfaceBiMap<K,V>- Specified by:
rejectin interfaceMutableBiMap<K,V>- Specified by:
rejectin interfaceMutableMapIterable<K,V>- Specified by:
rejectin interfaceRichIterable<K>- Overrides:
rejectin 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:
rejectWithin interfaceBiMap<K,V>- Specified by:
rejectWithin interfaceMutableBiMap<K,V>- Specified by:
rejectWithin interfaceMutableMapIterable<K,V>- Specified by:
rejectWithin interfaceRichIterable<K>- Overrides:
rejectWithin classAbstractSynchronizedMapIterable<K,V>
-
partition
public PartitionMutableSet<V> partition(Predicate<? super V> predicate)
- Specified by:
partitionin interfaceBiMap<K,V>- Specified by:
partitionin interfaceMutableBiMap<K,V>- Specified by:
partitionin interfaceMutableMapIterable<K,V>- Specified by:
partitionin interfaceRichIterable<K>- Overrides:
partitionin classAbstractSynchronizedMapIterable<K,V>
-
partitionWith
public <P> PartitionMutableSet<V> partitionWith(Predicate2<? super V,? super P> predicate, P parameter)
- Specified by:
partitionWithin interfaceBiMap<K,V>- Specified by:
partitionWithin interfaceMutableBiMap<K,V>- Specified by:
partitionWithin interfaceRichIterable<K>- Overrides:
partitionWithin classAbstractSynchronizedRichIterable<V>
-
groupBy
public <V1> MutableSetMultimap<V1,V> groupBy(Function<? super V,? extends V1> function)
- Specified by:
groupByin interfaceBiMap<K,V>- Specified by:
groupByin interfaceMutableBiMap<K,V>- Specified by:
groupByin interfaceMutableMapIterable<K,V>- Specified by:
groupByin interfaceRichIterable<K>- Overrides:
groupByin classAbstractSynchronizedMapIterable<K,V>
-
groupByEach
public <V1> MutableSetMultimap<V1,V> groupByEach(Function<? super V,? extends Iterable<V1>> function)
- Specified by:
groupByEachin interfaceBiMap<K,V>- Specified by:
groupByEachin interfaceMutableBiMap<K,V>- Specified by:
groupByEachin interfaceMutableMapIterable<K,V>- Specified by:
groupByEachin interfaceRichIterable<K>- Overrides:
groupByEachin 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:
aggregateByin interfaceMutableBiMap<K,V>- Specified by:
aggregateByin interfaceMutableMapIterable<K,V>- Specified by:
aggregateByin interfaceRichIterable<K>- Overrides:
aggregateByin 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:
aggregateByin interfaceMapIterable<K,V>- Specified by:
aggregateByin interfaceMutableBiMap<K,V>- Specified by:
aggregateByin interfaceMutableMapIterable<K,V>- Overrides:
aggregateByin classAbstractSynchronizedMapIterable<K,V>- Since:
- 11.0
-
flip
public MutableSetMultimap<V,K> flip()
-
newEmpty
public MutableBiMap<K,V> newEmpty()
- Specified by:
newEmptyin interfaceMutableBiMap<K,V>- Specified by:
newEmptyin interfaceMutableMapIterable<K,V>
-
inverse
public MutableBiMap<V,K> inverse()
-
flipUniqueValues
public MutableBiMap<V,K> flipUniqueValues()
- Specified by:
flipUniqueValuesin interfaceBiMap<K,V>- Specified by:
flipUniqueValuesin interfaceMapIterable<K,V>- Specified by:
flipUniqueValuesin interfaceMutableBiMap<K,V>- Specified by:
flipUniqueValuesin interfaceMutableMapIterable<K,V>
-
toImmutable
public ImmutableBiMap<K,V> toImmutable()
- Specified by:
toImmutablein interfaceBiMap<K,V>- Specified by:
toImmutablein interfaceMapIterable<K,V>- Specified by:
toImmutablein interfaceMutableMapIterable<K,V>
-
zipWithIndex
@Deprecated public MutableSet<Pair<V,Integer>> zipWithIndex()
Deprecated.in 8.0. UseOrderedIterable.zipWithIndex()instead.- Specified by:
zipWithIndexin interfaceBiMap<K,V>- Specified by:
zipWithIndexin interfaceMutableBiMap<K,V>- Specified by:
zipWithIndexin interfaceMutableMapIterable<K,V>- Specified by:
zipWithIndexin interfaceRichIterable<K>- Overrides:
zipWithIndexin classAbstractSynchronizedMapIterable<K,V>
-
groupByUniqueKey
public <VV> MutableBiMap<VV,V> groupByUniqueKey(Function<? super V,? extends VV> function)
- Specified by:
groupByUniqueKeyin interfaceBiMap<K,V>- Specified by:
groupByUniqueKeyin interfaceMutableBiMap<K,V>- Specified by:
groupByUniqueKeyin interfaceMutableMapIterable<K,V>- Specified by:
groupByUniqueKeyin interfaceRichIterable<K>- Overrides:
groupByUniqueKeyin 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:
zipin interfaceBiMap<K,V>- Specified by:
zipin interfaceMutableBiMap<K,V>- Specified by:
zipin interfaceMutableMapIterable<K,V>- Specified by:
zipin interfaceRichIterable<K>- Overrides:
zipin classAbstractSynchronizedMapIterable<K,V>
-
withKeyValue
public MutableBiMap<K,V> withKeyValue(K key, V value)
- Specified by:
withKeyValuein interfaceMutableBiMap<K,V>- Specified by:
withKeyValuein interfaceMutableMapIterable<K,V>
-
withMap
public MutableBiMap<K,V> withMap(Map<? extends K,? extends V> map)
- Specified by:
withMapin interfaceMutableBiMap<K,V>- Specified by:
withMapin interfaceMutableMapIterable<K,V>
-
withMapIterable
public MutableBiMap<K,V> withMapIterable(MapIterable<? extends K,? extends V> mapIterable)
- Specified by:
withMapIterablein interfaceMutableBiMap<K,V>- Specified by:
withMapIterablein interfaceMutableMapIterable<K,V>
-
putAllMapIterable
public void putAllMapIterable(MapIterable<? extends K,? extends V> mapIterable)
- Specified by:
putAllMapIterablein interfaceMutableMapIterable<K,V>
-
withAllKeyValues
public MutableBiMap<K,V> withAllKeyValues(Iterable<? extends Pair<? extends K,? extends V>> keyValues)
- Specified by:
withAllKeyValuesin interfaceMutableBiMap<K,V>- Specified by:
withAllKeyValuesin interfaceMutableMapIterable<K,V>
-
withAllKeyValueArguments
public MutableBiMap<K,V> withAllKeyValueArguments(Pair<? extends K,? extends V>... keyValuePairs)
- Specified by:
withAllKeyValueArgumentsin interfaceMutableBiMap<K,V>- Specified by:
withAllKeyValueArgumentsin interfaceMutableMapIterable<K,V>
-
withoutKey
public MutableBiMap<K,V> withoutKey(K key)
- Specified by:
withoutKeyin interfaceMutableBiMap<K,V>- Specified by:
withoutKeyin interfaceMutableMapIterable<K,V>
-
withoutAllKeys
public MutableBiMap<K,V> withoutAllKeys(Iterable<? extends K> keys)
- Specified by:
withoutAllKeysin interfaceMutableBiMap<K,V>- Specified by:
withoutAllKeysin interfaceMutableMapIterable<K,V>
-
-