public class SynchronizedMutableMap<K,V> extends AbstractSynchronizedMapIterable<K,V> implements MutableMap<K,V>, Serializable
MutableMap. It is imperative that the user manually synchronize on the collection when iterating over it using the
standard JDK iterator or JDK 5 for loop, as per Collections.synchronizedCollection(Collection).MutableMap.asSynchronized(),
Serialized Form| Constructor and Description |
|---|
SynchronizedMutableMap(MutableMap<K,V> newMap) |
SynchronizedMutableMap(MutableMap<K,V> newMap,
Object newLock) |
| Modifier and Type | Method and 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) |
MutableMap<K,V> |
asSynchronized() |
MutableMap<K,V> |
asUnmodifiable() |
MutableMap<K,V> |
clone() |
<A> MutableBag<A> |
collect(Function<? super V,? extends A> function) |
<K2,V2> MutableMap<K2,V2> |
collect(Function2<? super K,? super V,Pair<K2,V2>> pairFunction) |
MutableBooleanBag |
collectBoolean(BooleanFunction<? super V> booleanFunction) |
MutableByteBag |
collectByte(ByteFunction<? super V> byteFunction) |
MutableCharBag |
collectChar(CharFunction<? super V> charFunction) |
MutableDoubleBag |
collectDouble(DoubleFunction<? super V> doubleFunction) |
MutableFloatBag |
collectFloat(FloatFunction<? super V> floatFunction) |
<A> MutableBag<A> |
collectIf(Predicate<? super V> predicate,
Function<? super V,? extends A> function) |
MutableIntBag |
collectInt(IntFunction<? super V> intFunction) |
<E> MutableMap<K,V> |
collectKeysAndValues(Iterable<E> iterable,
Function<? super E,? extends K> keyFunction,
Function<? super E,? extends V> function) |
MutableLongBag |
collectLong(LongFunction<? super V> longFunction) |
MutableShortBag |
collectShort(ShortFunction<? super V> shortFunction) |
<R> MutableMap<K,R> |
collectValues(Function2<? super K,? super V,? extends R> function) |
<P,A> MutableBag<A> |
collectWith(Function2<? super V,? super P,? extends A> function,
P parameter) |
Set<Map.Entry<K,V>> |
entrySet() |
<A> MutableBag<A> |
flatCollect(Function<? super V,? extends Iterable<A>> function) |
MutableSetMultimap<V,K> |
flip() |
MutableMap<V,K> |
flipUniqueValues() |
<KK> MutableBagMultimap<KK,V> |
groupBy(Function<? super V,? extends KK> function) |
<KK> MutableBagMultimap<KK,V> |
groupByEach(Function<? super V,? extends Iterable<KK>> function) |
<VV> MutableMap<VV,V> |
groupByUniqueKey(Function<? super V,? extends VV> function) |
Set<K> |
keySet() |
MutableMap<K,V> |
newEmpty() |
static <K,V,M extends Map<K,V>> |
of(M map)
This method will take a MutableMap and wrap it directly in a SynchronizedMutableMap.
|
static <K,V,M extends Map<K,V>> |
of(M map,
Object lock)
This method will take a MutableMap and wrap it directly in a SynchronizedMutableMap.
|
PartitionMutableBag<V> |
partition(Predicate<? super V> predicate) |
<P> PartitionMutableBag<V> |
partitionWith(Predicate2<? super V,? super P> predicate,
P parameter) |
void |
putAllMapIterable(MapIterable<? extends K,? extends V> mapIterable) |
MutableBag<V> |
reject(Predicate<? super V> predicate) |
MutableMap<K,V> |
reject(Predicate2<? super K,? super V> predicate) |
<P> MutableBag<V> |
rejectWith(Predicate2<? super V,? super P> predicate,
P parameter) |
MutableBag<V> |
select(Predicate<? super V> predicate) |
MutableMap<K,V> |
select(Predicate2<? super K,? super V> predicate) |
<S> MutableBag<S> |
selectInstancesOf(Class<S> clazz) |
<P> MutableBag<V> |
selectWith(Predicate2<? super V,? super P> predicate,
P parameter) |
MutableMap<K,V> |
tap(Procedure<? super V> procedure) |
ImmutableMap<K,V> |
toImmutable() |
Collection<V> |
values() |
MutableMap<K,V> |
withAllKeyValueArguments(Pair<? extends K,? extends V>... keyValuePairs) |
MutableMap<K,V> |
withAllKeyValues(Iterable<? extends Pair<? extends K,? extends V>> keyValues) |
MutableMap<K,V> |
withKeyValue(K key,
V value) |
MutableMap<K,V> |
withMap(Map<? extends K,? extends V> map) |
MutableMap<K,V> |
withMapIterable(MapIterable<? extends K,? extends V> mapIterable) |
MutableMap<K,V> |
withoutAllKeys(Iterable<? extends K> keys) |
MutableMap<K,V> |
withoutKey(K key) |
<S> MutableBag<Pair<V,S>> |
zip(Iterable<S> that)
Deprecated.
in 6.0. Use
OrderedIterable.zip(Iterable) instead. |
MutableSet<Pair<V,Integer>> |
zipWithIndex()
Deprecated.
in 6.0. Use
OrderedIterable.zipWithIndex() instead. |
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, valuesViewallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, equals, 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, zipWithIndexequals, getClass, hashCode, notify, notifyAll, wait, wait, waitaggregateInPlaceBy, flatCollectWithadd, countBy, countByEach, countByWith, getIfAbsentPut, getIfAbsentPut, getIfAbsentPutWith, getIfAbsentPutWithKey, getOrDefault, putPair, removeAllKeys, removeIf, removeKey, sumByDouble, sumByFloat, sumByInt, sumByLong, updateValue, updateValueWithclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, sizecontainsKey, containsValue, detect, detectOptional, equals, forEachKey, forEachKeyValue, forEachValue, get, getIfAbsent, getIfAbsentValue, getIfAbsentWith, hashCode, ifPresentApply, injectIntoKeyValue, keysView, keyValuesView, parallelStream, spliterator, stream, toString, valuesViewaggregateBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, 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, zipWithIndexforEach, forEachWith, forEachWithIndexpublic SynchronizedMutableMap(MutableMap<K,V> newMap)
public SynchronizedMutableMap(MutableMap<K,V> newMap, Object newLock)
public static <K,V,M extends Map<K,V>> SynchronizedMutableMap<K,V> of(M map)
public static <K,V,M extends Map<K,V>> SynchronizedMutableMap<K,V> of(M map, Object lock)
public MutableMap<K,V> withKeyValue(K key, V value)
withKeyValue in interface MutableMap<K,V>withKeyValue in interface MutableMapIterable<K,V>public MutableMap<K,V> withMap(Map<? extends K,? extends V> map)
withMap in interface MutableMap<K,V>withMap in interface MutableMapIterable<K,V>public MutableMap<K,V> withMapIterable(MapIterable<? extends K,? extends V> mapIterable)
withMapIterable in interface MutableMap<K,V>withMapIterable in interface MutableMapIterable<K,V>public void putAllMapIterable(MapIterable<? extends K,? extends V> mapIterable)
putAllMapIterable in interface MutableMapIterable<K,V>public MutableMap<K,V> withAllKeyValueArguments(Pair<? extends K,? extends V>... keyValuePairs)
withAllKeyValueArguments in interface MutableMap<K,V>withAllKeyValueArguments in interface MutableMapIterable<K,V>public MutableMap<K,V> withAllKeyValues(Iterable<? extends Pair<? extends K,? extends V>> keyValues)
withAllKeyValues in interface MutableMap<K,V>withAllKeyValues in interface MutableMapIterable<K,V>public MutableMap<K,V> withoutKey(K key)
withoutKey in interface MutableMap<K,V>withoutKey in interface MutableMapIterable<K,V>public MutableMap<K,V> withoutAllKeys(Iterable<? extends K> keys)
withoutAllKeys in interface MutableMap<K,V>withoutAllKeys in interface MutableMapIterable<K,V>public MutableMap<K,V> newEmpty()
newEmpty in interface MutableMap<K,V>newEmpty in interface MutableMapIterable<K,V>public MutableMap<K,V> clone()
public <E> MutableMap<K,V> collectKeysAndValues(Iterable<E> iterable, Function<? super E,? extends K> keyFunction, Function<? super E,? extends V> function)
collectKeysAndValues in interface MutableMap<K,V>public MutableMap<K,V> select(Predicate2<? super K,? super V> predicate)
select in interface MapIterable<K,V>select in interface MutableMap<K,V>select in interface MutableMapIterable<K,V>select in interface UnsortedMapIterable<K,V>public MutableMap<K,V> reject(Predicate2<? super K,? super V> predicate)
reject in interface MapIterable<K,V>reject in interface MutableMap<K,V>reject in interface MutableMapIterable<K,V>reject in interface UnsortedMapIterable<K,V>public <K2,V2> MutableMap<K2,V2> collect(Function2<? super K,? super V,Pair<K2,V2>> pairFunction)
collect in interface MapIterable<K,V>collect in interface MutableMap<K,V>collect in interface MutableMapIterable<K,V>collect in interface UnsortedMapIterable<K,V>public <R> MutableMap<K,R> collectValues(Function2<? super K,? super V,? extends R> function)
collectValues in interface MapIterable<K,V>collectValues in interface MutableMap<K,V>collectValues in interface MutableMapIterable<K,V>collectValues in interface UnsortedMapIterable<K,V>public MutableMap<K,V> tap(Procedure<? super V> procedure)
tap in interface MapIterable<K,V>tap in interface MutableMap<K,V>tap in interface MutableMapIterable<K,V>tap in interface UnsortedMapIterable<K,V>tap in interface RichIterable<V>tap in class AbstractSynchronizedMapIterable<K,V>public MutableBag<V> select(Predicate<? super V> predicate)
select in interface MutableMap<K,V>select in interface MutableMapIterable<K,V>select in interface UnsortedMapIterable<K,V>select in interface RichIterable<V>select in class AbstractSynchronizedMapIterable<K,V>public <P> MutableBag<V> selectWith(Predicate2<? super V,? super P> predicate, P parameter)
selectWith in interface MutableMap<K,V>selectWith in interface MutableMapIterable<K,V>selectWith in interface UnsortedMapIterable<K,V>selectWith in interface RichIterable<V>selectWith in class AbstractSynchronizedMapIterable<K,V>public MutableBag<V> reject(Predicate<? super V> predicate)
reject in interface MutableMap<K,V>reject in interface MutableMapIterable<K,V>reject in interface UnsortedMapIterable<K,V>reject in interface RichIterable<V>reject in class AbstractSynchronizedMapIterable<K,V>public <P> MutableBag<V> rejectWith(Predicate2<? super V,? super P> predicate, P parameter)
rejectWith in interface MutableMap<K,V>rejectWith in interface MutableMapIterable<K,V>rejectWith in interface UnsortedMapIterable<K,V>rejectWith in interface RichIterable<V>rejectWith in class AbstractSynchronizedMapIterable<K,V>public PartitionMutableBag<V> partition(Predicate<? super V> predicate)
partition in interface MutableMap<K,V>partition in interface MutableMapIterable<K,V>partition in interface UnsortedMapIterable<K,V>partition in interface RichIterable<V>partition in class AbstractSynchronizedMapIterable<K,V>@Deprecated public MutableSet<Pair<V,Integer>> zipWithIndex()
OrderedIterable.zipWithIndex() instead.zipWithIndex in interface MutableMap<K,V>zipWithIndex in interface MutableMapIterable<K,V>zipWithIndex in interface UnsortedMapIterable<K,V>zipWithIndex in interface RichIterable<V>zipWithIndex in class AbstractSynchronizedMapIterable<K,V>public <P> PartitionMutableBag<V> partitionWith(Predicate2<? super V,? super P> predicate, P parameter)
partitionWith in interface MutableMap<K,V>partitionWith in interface UnsortedMapIterable<K,V>partitionWith in interface RichIterable<V>partitionWith in class AbstractSynchronizedRichIterable<V>public <S> MutableBag<S> selectInstancesOf(Class<S> clazz)
selectInstancesOf in interface MutableMap<K,V>selectInstancesOf in interface MutableMapIterable<K,V>selectInstancesOf in interface UnsortedMapIterable<K,V>selectInstancesOf in interface RichIterable<V>selectInstancesOf in class AbstractSynchronizedMapIterable<K,V>public <A> MutableBag<A> collect(Function<? super V,? extends A> function)
collect in interface MutableMap<K,V>collect in interface UnsortedMapIterable<K,V>collect in interface RichIterable<V>collect in class AbstractSynchronizedRichIterable<V>public MutableBooleanBag collectBoolean(BooleanFunction<? super V> booleanFunction)
collectBoolean in interface MutableMap<K,V>collectBoolean in interface UnsortedMapIterable<K,V>collectBoolean in interface RichIterable<V>collectBoolean in class AbstractSynchronizedRichIterable<V>public MutableByteBag collectByte(ByteFunction<? super V> byteFunction)
collectByte in interface MutableMap<K,V>collectByte in interface UnsortedMapIterable<K,V>collectByte in interface RichIterable<V>collectByte in class AbstractSynchronizedRichIterable<V>public MutableCharBag collectChar(CharFunction<? super V> charFunction)
collectChar in interface MutableMap<K,V>collectChar in interface UnsortedMapIterable<K,V>collectChar in interface RichIterable<V>collectChar in class AbstractSynchronizedRichIterable<V>public MutableDoubleBag collectDouble(DoubleFunction<? super V> doubleFunction)
collectDouble in interface MutableMap<K,V>collectDouble in interface UnsortedMapIterable<K,V>collectDouble in interface RichIterable<V>collectDouble in class AbstractSynchronizedRichIterable<V>public MutableFloatBag collectFloat(FloatFunction<? super V> floatFunction)
collectFloat in interface MutableMap<K,V>collectFloat in interface UnsortedMapIterable<K,V>collectFloat in interface RichIterable<V>collectFloat in class AbstractSynchronizedRichIterable<V>public MutableIntBag collectInt(IntFunction<? super V> intFunction)
collectInt in interface MutableMap<K,V>collectInt in interface UnsortedMapIterable<K,V>collectInt in interface RichIterable<V>collectInt in class AbstractSynchronizedRichIterable<V>public MutableLongBag collectLong(LongFunction<? super V> longFunction)
collectLong in interface MutableMap<K,V>collectLong in interface UnsortedMapIterable<K,V>collectLong in interface RichIterable<V>collectLong in class AbstractSynchronizedRichIterable<V>public MutableShortBag collectShort(ShortFunction<? super V> shortFunction)
collectShort in interface MutableMap<K,V>collectShort in interface UnsortedMapIterable<K,V>collectShort in interface RichIterable<V>collectShort in class AbstractSynchronizedRichIterable<V>public <P,A> MutableBag<A> collectWith(Function2<? super V,? super P,? extends A> function, P parameter)
collectWith in interface MutableMap<K,V>collectWith in interface UnsortedMapIterable<K,V>collectWith in interface RichIterable<V>collectWith in class AbstractSynchronizedRichIterable<V>public <A> MutableBag<A> collectIf(Predicate<? super V> predicate, Function<? super V,? extends A> function)
collectIf in interface MutableMap<K,V>collectIf in interface UnsortedMapIterable<K,V>collectIf in interface RichIterable<V>collectIf in class AbstractSynchronizedRichIterable<V>public <A> MutableBag<A> flatCollect(Function<? super V,? extends Iterable<A>> function)
flatCollect in interface MutableMap<K,V>flatCollect in interface UnsortedMapIterable<K,V>flatCollect in interface RichIterable<V>flatCollect in class AbstractSynchronizedRichIterable<V>public <KK> MutableBagMultimap<KK,V> groupBy(Function<? super V,? extends KK> function)
groupBy in interface MutableMap<K,V>groupBy in interface MutableMapIterable<K,V>groupBy in interface UnsortedMapIterable<K,V>groupBy in interface RichIterable<V>groupBy in class AbstractSynchronizedMapIterable<K,V>public <KK> MutableBagMultimap<KK,V> groupByEach(Function<? super V,? extends Iterable<KK>> function)
groupByEach in interface MutableMap<K,V>groupByEach in interface MutableMapIterable<K,V>groupByEach in interface UnsortedMapIterable<K,V>groupByEach in interface RichIterable<V>groupByEach in class AbstractSynchronizedMapIterable<K,V>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)
aggregateBy in interface MutableMap<K,V>aggregateBy in interface MutableMapIterable<K,V>aggregateBy in interface RichIterable<V>aggregateBy in class AbstractSynchronizedMapIterable<K,V>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)
aggregateBy in interface MapIterable<K,V>aggregateBy in interface MutableMap<K,V>aggregateBy in interface MutableMapIterable<K,V>aggregateBy in class AbstractSynchronizedMapIterable<K,V>@Deprecated public <S> MutableBag<Pair<V,S>> zip(Iterable<S> that)
OrderedIterable.zip(Iterable) instead.zip in interface MutableMap<K,V>zip in interface MutableMapIterable<K,V>zip in interface UnsortedMapIterable<K,V>zip in interface RichIterable<V>zip in class AbstractSynchronizedMapIterable<K,V>public <VV> MutableMap<VV,V> groupByUniqueKey(Function<? super V,? extends VV> function)
groupByUniqueKey in interface MutableMap<K,V>groupByUniqueKey in interface MutableMapIterable<K,V>groupByUniqueKey in interface UnsortedMapIterable<K,V>groupByUniqueKey in interface RichIterable<V>groupByUniqueKey in class AbstractSynchronizedMapIterable<K,V>public MutableMap<V,K> flipUniqueValues()
flipUniqueValues in interface MapIterable<K,V>flipUniqueValues in interface MutableMap<K,V>flipUniqueValues in interface MutableMapIterable<K,V>flipUniqueValues in interface UnsortedMapIterable<K,V>public MutableSetMultimap<V,K> flip()
flip in interface MapIterable<K,V>flip in interface MutableMap<K,V>flip in interface MutableMapIterable<K,V>flip in interface UnsortedMapIterable<K,V>public MutableMap<K,V> asUnmodifiable()
asUnmodifiable in interface MutableMap<K,V>asUnmodifiable in interface MutableMapIterable<K,V>public MutableMap<K,V> asSynchronized()
asSynchronized in interface MutableMap<K,V>asSynchronized in interface MutableMapIterable<K,V>public ImmutableMap<K,V> toImmutable()
toImmutable in interface MapIterable<K,V>toImmutable in interface MutableMapIterable<K,V>toImmutable in interface UnsortedMapIterable<K,V>Copyright © 2004–2022. All rights reserved.