Package org.eclipse.collections.impl.map
Class AbstractSynchronizedMapIterable<K,V>
- java.lang.Object
-
- org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable<V>
-
- org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable<K,V>
-
- All Implemented Interfaces:
Iterable<V>,Map<K,V>,InternalIterable<V>,MapIterable<K,V>,MutableMapIterable<K,V>,RichIterable<V>
- Direct Known Subclasses:
SynchronizedBiMap,SynchronizedMutableMap,SynchronizedSortedMap
public abstract class AbstractSynchronizedMapIterable<K,V> extends AbstractSynchronizedRichIterable<V> implements MutableMapIterable<K,V>
A synchronized view of a map.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vadd(Pair<? extends K,? extends V> keyValuePair)<K1,V1,V2>
MutableMapIterable<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>
MutableMapIterable<KK,VV>aggregateBy(Function<? super V,? extends KK> groupBy, Function0<? extends VV> zeroValueFactory, Function2<? super VV,? super V,? extends VV> nonMutatingAggregator)<KK,VV>
MutableMapIterable<KK,VV>aggregateInPlaceBy(Function<? super V,? extends KK> groupBy, Function0<? extends VV> zeroValueFactory, Procedure2<? super VV,? super V> mutatingAggregator)voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)<V1> MutableBag<V1>countBy(Function<? super V,? extends V1> function)<V1> MutableBag<V1>countByEach(Function<? super V,? extends Iterable<V1>> function)<V1,P>
MutableBag<V1>countByWith(Function2<? super V,? super P,? extends V1> function, P parameter)Pair<K,V>detect(Predicate2<? super K,? super V> predicate)Optional<Pair<K,V>>detectOptional(Predicate2<? super K,? super V> predicate)voidforEachKey(Procedure<? super K> procedure)voidforEachKeyValue(Procedure2<? super K,? super V> procedure2)voidforEachValue(Procedure<? super V> procedure)Vget(Object key)VgetIfAbsent(K key, Function0<? extends V> function)VgetIfAbsentPut(K key, Function0<? extends V> function)VgetIfAbsentPut(K key, V value)<P> VgetIfAbsentPutWith(K key, Function<? super P,? extends V> function, P parameter)VgetIfAbsentPutWithKey(K key, Function<? super K,? extends V> function)VgetIfAbsentValue(K key, V value)<P> VgetIfAbsentWith(K key, Function<? super P,? extends V> function, P parameter)<V1> MutableMultimap<V1,V>groupBy(Function<? super V,? extends V1> function)<V1> MutableMultimap<V1,V>groupByEach(Function<? super V,? extends Iterable<V1>> function)<VV> MutableMapIterable<VV,V>groupByUniqueKey(Function<? super V,? extends VV> function)<A> AifPresentApply(K key, Function<? super V,? extends A> function)RichIterable<K>keysView()RichIterable<Pair<K,V>>keyValuesView()Vmerge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)PartitionMutableCollection<V>partition(Predicate<? super V> predicate)Vput(K key, V value)voidputAll(Map<? extends K,? extends V> map)VputPair(Pair<? extends K,? extends V> keyValuePair)<KK> MutableMapIterable<KK,V>reduceBy(Function<? super V,? extends KK> groupBy, Function2<? super V,? super V,? extends V> reduceFunction)MutableCollection<V>reject(Predicate<? super V> predicate)<P> MutableCollection<V>rejectWith(Predicate2<? super V,? super P> predicate, P parameter)Vremove(Object key)booleanremoveAllKeys(Set<? extends K> keys)booleanremoveIf(Predicate2<? super K,? super V> predicate)VremoveKey(K key)MutableCollection<V>select(Predicate<? super V> predicate)<S> MutableCollection<S>selectInstancesOf(Class<S> clazz)<P> MutableCollection<V>selectWith(Predicate2<? super V,? super P> predicate, P parameter)<V1> MutableObjectDoubleMap<V1>sumByDouble(Function<? super V,? extends V1> groupBy, DoubleFunction<? super V> function)<V1> MutableObjectDoubleMap<V1>sumByFloat(Function<? super V,? extends V1> groupBy, FloatFunction<? super V> function)<V1> MutableObjectLongMap<V1>sumByInt(Function<? super V,? extends V1> groupBy, IntFunction<? super V> function)<V1> MutableObjectLongMap<V1>sumByLong(Function<? super V,? extends V1> groupBy, LongFunction<? super V> function)MutableMapIterable<K,V>tap(Procedure<? super V> procedure)VupdateValue(K key, Function0<? extends V> factory, Function<? super V,? extends V> function)<P> VupdateValueWith(K key, Function0<? extends V> factory, Function2<? super V,? super P,? extends V> function, P parameter)RichIterable<V>valuesView()<S> MutableCollection<Pair<V,S>>zip(Iterable<S> that)MutableCollection<Pair<V,Integer>>zipWithIndex()-
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, partitionWith, 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
compute, computeIfAbsent, computeIfPresent, entrySet, equals, hashCode, isEmpty, keySet, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Methods inherited from interface org.eclipse.collections.api.map.MapIterable
equals, hashCode, injectIntoKeyValue, parallelStream, spliterator, stream, toString
-
Methods inherited from interface org.eclipse.collections.api.map.MutableMapIterable
asSynchronized, asUnmodifiable, collect, collectKeysUnique, collectValues, flip, flipUniqueValues, forEach, getOrDefault, newEmpty, putAllMapIterable, reject, select, toImmutable, withAllKeyValueArguments, withAllKeyValues, withKeyValue, withMap, withMapIterable, withoutAllKeys, withoutKey
-
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, partitionWith, reduce, reduceBy, 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
-
getIfAbsent
public V getIfAbsent(K key, Function0<? extends V> function)
- Specified by:
getIfAbsentin interfaceMapIterable<K,V>
-
getIfAbsentValue
public V getIfAbsentValue(K key, V value)
- Specified by:
getIfAbsentValuein interfaceMapIterable<K,V>
-
getIfAbsentWith
public <P> V getIfAbsentWith(K key, Function<? super P,? extends V> function, P parameter)
- Specified by:
getIfAbsentWithin interfaceMapIterable<K,V>
-
ifPresentApply
public <A> A ifPresentApply(K key, Function<? super V,? extends A> function)
- Specified by:
ifPresentApplyin interfaceMapIterable<K,V>
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<K,V>- Specified by:
containsKeyin interfaceMapIterable<K,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<K,V>- Specified by:
containsValuein interfaceMapIterable<K,V>
-
forEachValue
public void forEachValue(Procedure<? super V> procedure)
- Specified by:
forEachValuein interfaceMapIterable<K,V>
-
forEachKey
public void forEachKey(Procedure<? super K> procedure)
- Specified by:
forEachKeyin interfaceMapIterable<K,V>
-
forEachKeyValue
public void forEachKeyValue(Procedure2<? super K,? super V> procedure2)
- Specified by:
forEachKeyValuein interfaceMapIterable<K,V>
-
detect
public Pair<K,V> detect(Predicate2<? super K,? super V> predicate)
- Specified by:
detectin interfaceMapIterable<K,V>
-
detectOptional
public Optional<Pair<K,V>> detectOptional(Predicate2<? super K,? super V> predicate)
- Specified by:
detectOptionalin interfaceMapIterable<K,V>
-
getIfAbsentPut
public V getIfAbsentPut(K key, Function0<? extends V> function)
- Specified by:
getIfAbsentPutin interfaceMutableMapIterable<K,V>
-
getIfAbsentPut
public V getIfAbsentPut(K key, V value)
- Specified by:
getIfAbsentPutin interfaceMutableMapIterable<K,V>
-
getIfAbsentPutWithKey
public V getIfAbsentPutWithKey(K key, Function<? super K,? extends V> function)
- Specified by:
getIfAbsentPutWithKeyin interfaceMutableMapIterable<K,V>
-
getIfAbsentPutWith
public <P> V getIfAbsentPutWith(K key, Function<? super P,? extends V> function, P parameter)
- Specified by:
getIfAbsentPutWithin interfaceMutableMapIterable<K,V>
-
removeAllKeys
public boolean removeAllKeys(Set<? extends K> keys)
- Specified by:
removeAllKeysin interfaceMutableMapIterable<K,V>
-
removeIf
public boolean removeIf(Predicate2<? super K,? super V> predicate)
- Specified by:
removeIfin interfaceMutableMapIterable<K,V>
-
putPair
public V putPair(Pair<? extends K,? extends V> keyValuePair)
- Specified by:
putPairin interfaceMutableMapIterable<K,V>
-
add
public V add(Pair<? extends K,? extends V> keyValuePair)
- Specified by:
addin interfaceMutableMapIterable<K,V>
-
updateValue
public V updateValue(K key, Function0<? extends V> factory, Function<? super V,? extends V> function)
- Specified by:
updateValuein interfaceMutableMapIterable<K,V>
-
updateValueWith
public <P> V updateValueWith(K key, Function0<? extends V> factory, Function2<? super V,? super P,? extends V> function, P parameter)
- Specified by:
updateValueWithin interfaceMutableMapIterable<K,V>
-
merge
public V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
-
groupByUniqueKey
public <VV> MutableMapIterable<VV,V> groupByUniqueKey(Function<? super V,? extends VV> function)
- Specified by:
groupByUniqueKeyin interfaceMutableMapIterable<K,V>- Specified by:
groupByUniqueKeyin interfaceRichIterable<K>- Overrides:
groupByUniqueKeyin classAbstractSynchronizedRichIterable<V>
-
aggregateInPlaceBy
public <KK,VV> MutableMapIterable<KK,VV> aggregateInPlaceBy(Function<? super V,? extends KK> groupBy, Function0<? extends VV> zeroValueFactory, Procedure2<? super VV,? super V> mutatingAggregator)
- Specified by:
aggregateInPlaceByin interfaceMutableMapIterable<K,V>- Specified by:
aggregateInPlaceByin interfaceRichIterable<K>- Overrides:
aggregateInPlaceByin classAbstractSynchronizedRichIterable<V>
-
aggregateBy
public <KK,VV> MutableMapIterable<KK,VV> aggregateBy(Function<? super V,? extends KK> groupBy, Function0<? extends VV> zeroValueFactory, Function2<? super VV,? super V,? extends VV> nonMutatingAggregator)
- Specified by:
aggregateByin interfaceMutableMapIterable<K,V>- Specified by:
aggregateByin interfaceRichIterable<K>- Overrides:
aggregateByin classAbstractSynchronizedRichIterable<V>
-
aggregateBy
public <K1,V1,V2> MutableMapIterable<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 interfaceMutableMapIterable<K,V>
-
reduceBy
public <KK> MutableMapIterable<KK,V> reduceBy(Function<? super V,? extends KK> groupBy, Function2<? super V,? super V,? extends V> reduceFunction)
- Specified by:
reduceByin interfaceMutableMapIterable<K,V>- Specified by:
reduceByin interfaceRichIterable<K>- Overrides:
reduceByin classAbstractSynchronizedRichIterable<V>
-
keysView
public RichIterable<K> keysView()
- Specified by:
keysViewin interfaceMapIterable<K,V>
-
valuesView
public RichIterable<V> valuesView()
- Specified by:
valuesViewin interfaceMapIterable<K,V>
-
keyValuesView
public RichIterable<Pair<K,V>> keyValuesView()
- Specified by:
keyValuesViewin interfaceMapIterable<K,V>
-
sumByInt
public <V1> MutableObjectLongMap<V1> sumByInt(Function<? super V,? extends V1> groupBy, IntFunction<? super V> function)
- Specified by:
sumByIntin interfaceMutableMapIterable<K,V>- Specified by:
sumByIntin interfaceRichIterable<K>- Overrides:
sumByIntin classAbstractSynchronizedRichIterable<V>
-
sumByFloat
public <V1> MutableObjectDoubleMap<V1> sumByFloat(Function<? super V,? extends V1> groupBy, FloatFunction<? super V> function)
- Specified by:
sumByFloatin interfaceMutableMapIterable<K,V>- Specified by:
sumByFloatin interfaceRichIterable<K>- Overrides:
sumByFloatin classAbstractSynchronizedRichIterable<V>
-
sumByLong
public <V1> MutableObjectLongMap<V1> sumByLong(Function<? super V,? extends V1> groupBy, LongFunction<? super V> function)
- Specified by:
sumByLongin interfaceMutableMapIterable<K,V>- Specified by:
sumByLongin interfaceRichIterable<K>- Overrides:
sumByLongin classAbstractSynchronizedRichIterable<V>
-
sumByDouble
public <V1> MutableObjectDoubleMap<V1> sumByDouble(Function<? super V,? extends V1> groupBy, DoubleFunction<? super V> function)
- Specified by:
sumByDoublein interfaceMutableMapIterable<K,V>- Specified by:
sumByDoublein interfaceRichIterable<K>- Overrides:
sumByDoublein classAbstractSynchronizedRichIterable<V>
-
groupBy
public <V1> MutableMultimap<V1,V> groupBy(Function<? super V,? extends V1> function)
- Specified by:
groupByin interfaceMutableMapIterable<K,V>- Specified by:
groupByin interfaceRichIterable<K>- Overrides:
groupByin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
groupByEach
public <V1> MutableMultimap<V1,V> groupByEach(Function<? super V,? extends Iterable<V1>> function)
- Specified by:
groupByEachin interfaceMutableMapIterable<K,V>- Specified by:
groupByEachin interfaceRichIterable<K>- Overrides:
groupByEachin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
zip
public <S> MutableCollection<Pair<V,S>> zip(Iterable<S> that)
- Specified by:
zipin interfaceMutableMapIterable<K,V>- Specified by:
zipin interfaceRichIterable<K>- Overrides:
zipin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
zipWithIndex
public MutableCollection<Pair<V,Integer>> zipWithIndex()
- Specified by:
zipWithIndexin interfaceMutableMapIterable<K,V>- Specified by:
zipWithIndexin interfaceRichIterable<K>- Overrides:
zipWithIndexin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
select
public MutableCollection<V> select(Predicate<? super V> predicate)
- Specified by:
selectin interfaceMutableMapIterable<K,V>- Specified by:
selectin interfaceRichIterable<K>- Overrides:
selectin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
selectInstancesOf
public <S> MutableCollection<S> selectInstancesOf(Class<S> clazz)
- Specified by:
selectInstancesOfin interfaceMutableMapIterable<K,V>- Specified by:
selectInstancesOfin interfaceRichIterable<K>- Overrides:
selectInstancesOfin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
selectWith
public <P> MutableCollection<V> selectWith(Predicate2<? super V,? super P> predicate, P parameter)
- Specified by:
selectWithin interfaceMutableMapIterable<K,V>- Specified by:
selectWithin interfaceRichIterable<K>- Overrides:
selectWithin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
rejectWith
public <P> MutableCollection<V> rejectWith(Predicate2<? super V,? super P> predicate, P parameter)
- Specified by:
rejectWithin interfaceMutableMapIterable<K,V>- Specified by:
rejectWithin interfaceRichIterable<K>- Overrides:
rejectWithin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
partition
public PartitionMutableCollection<V> partition(Predicate<? super V> predicate)
- Specified by:
partitionin interfaceMutableMapIterable<K,V>- Specified by:
partitionin interfaceRichIterable<K>- Overrides:
partitionin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
countBy
public <V1> MutableBag<V1> countBy(Function<? super V,? extends V1> function)
- Specified by:
countByin interfaceMutableMapIterable<K,V>- Specified by:
countByin interfaceRichIterable<K>- Overrides:
countByin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
countByWith
public <V1,P> MutableBag<V1> countByWith(Function2<? super V,? super P,? extends V1> function, P parameter)
- Specified by:
countByWithin interfaceMutableMapIterable<K,V>- Specified by:
countByWithin interfaceRichIterable<K>- Overrides:
countByWithin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
countByEach
public <V1> MutableBag<V1> countByEach(Function<? super V,? extends Iterable<V1>> function)
- Specified by:
countByEachin interfaceMutableMapIterable<K,V>- Specified by:
countByEachin interfaceRichIterable<K>- Overrides:
countByEachin classAbstractSynchronizedRichIterable<V>- Since:
- 10.0.0
-
reject
public MutableCollection<V> reject(Predicate<? super V> predicate)
- Specified by:
rejectin interfaceMutableMapIterable<K,V>- Specified by:
rejectin interfaceRichIterable<K>- Overrides:
rejectin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
tap
public MutableMapIterable<K,V> tap(Procedure<? super V> procedure)
- Specified by:
tapin interfaceMapIterable<K,V>- Specified by:
tapin interfaceMutableMapIterable<K,V>- Specified by:
tapin interfaceRichIterable<K>- Overrides:
tapin classAbstractSynchronizedRichIterable<V>- Since:
- 9.0
-
-