public class MapAdapter<K,V> extends AbstractMutableMap<K,V> implements Serializable
To create a new wrapper around an existing Map instance, use the adapt(Map) factory method.
| Modifier and Type | Method and Description |
|---|---|
static <K,V> MutableMap<K,V> |
adapt(Map<K,V> map) |
void |
clear() |
MutableMap<K,V> |
clone() |
<E> MutableMap<K,V> |
collectKeysAndValues(Iterable<E> iterable,
Function<? super E,? extends K> keyFunction,
Function<? super E,? extends V> valueFunction) |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object o) |
void |
forEachKeyValue(Procedure2<? super K,? super V> procedure) |
V |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Iterator<V> |
iterator() |
Set<K> |
keySet() |
MutableMap<K,V> |
newEmpty() |
<K,V> MutableMap<K,V> |
newEmpty(int capacity)
Creates a new instance of the same type, using the given capacity and the default growth parameters.
|
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> map) |
V |
remove(Object key) |
V |
removeKey(K key) |
int |
size() |
ImmutableMap<K,V> |
toImmutable() |
String |
toString()
Returns a string with the elements of the iterable separated by commas with spaces and
enclosed in square brackets.
|
Collection<V> |
values() |
asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectValues, collectWith, flatCollect, flip, groupBy, groupByEach, groupByUniqueKey, partition, partitionWith, reject, reject, rejectWith, select, select, selectInstancesOf, selectWith, tap, withAllKeyValueArguments, withAllKeyValues, withKeyValue, withoutAllKeys, withoutKey, zip, zipWithIndexaggregateBy, collect, countBy, countByEach, countByWith, detect, detectOptional, flipUniqueValues, getIfAbsentPut, getIfAbsentPut, getIfAbsentPutWith, getIfAbsentPutWithKey, keysView, keyValuesView, sumByDouble, sumByFloat, sumByInt, sumByLong, updateValue, updateValueWith, valuesViewallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, asLazy, chunk, contains, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, forEachKey, forEachValue, forEachWith, forEachWithIndex, getFirst, getIfAbsent, getIfAbsentValue, getIfAbsentWith, getLast, getOnly, getOrDefault, ifPresentApply, noneSatisfy, noneSatisfyWith, toArray, toArrayappendString, appendString, collect, collectIf, collectWith, containsAll, containsAllArguments, containsAllIterable, count, countWith, flatCollect, forEach, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, max, max, maxBy, min, min, minBy, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toBiMap, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndexaggregateBy, aggregateBy, aggregateInPlaceBy, collect, flatCollectWith, flipUniqueValues, withMap, withMapIterableadd, countBy, countByEach, countByWith, getIfAbsentPut, getIfAbsentPut, getIfAbsentPutWith, getIfAbsentPutWithKey, getOrDefault, putAllMapIterable, putPair, removeAllKeys, removeIf, sumByDouble, sumByFloat, sumByInt, sumByLong, updateValue, updateValueWithcompute, computeIfAbsent, computeIfPresent, forEach, merge, putIfAbsent, remove, replace, replace, replaceAlldetect, detectOptional, forEachKey, forEachValue, getIfAbsent, getIfAbsentValue, getIfAbsentWith, ifPresentApply, injectIntoKeyValue, keysView, keyValuesView, parallelStream, spliterator, stream, 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, 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, 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 static <K,V> MutableMap<K,V> adapt(Map<K,V> map)
public String toString()
AbstractRichIterable
Assert.assertEquals("[]", Lists.mutable.empty().toString());
Assert.assertEquals("[1]", Lists.mutable.with(1).toString());
Assert.assertEquals("[1, 2, 3]", Lists.mutable.with(1, 2, 3).toString());
toString in interface MapIterable<K,V>toString in interface RichIterable<V>toString in class AbstractRichIterable<V>AbstractCollection.toString()public MutableMap<K,V> clone()
clone in interface MutableMap<K,V>clone in class AbstractMutableMap<K,V>public <K,V> MutableMap<K,V> newEmpty(int capacity)
AbstractMutableMapnewEmpty in class AbstractMutableMap<K,V>public int size()
public boolean isEmpty()
isEmpty in interface Map<K,V>isEmpty in interface RichIterable<V>isEmpty in class AbstractRichIterable<V>public MutableMap<K,V> newEmpty()
newEmpty in interface MutableMap<K,V>newEmpty in interface MutableMapIterable<K,V>public void forEachKeyValue(Procedure2<? super K,? super V> procedure)
forEachKeyValue in interface MapIterable<K,V>public <E> MutableMap<K,V> collectKeysAndValues(Iterable<E> iterable, Function<? super E,? extends K> keyFunction, Function<? super E,? extends V> valueFunction)
collectKeysAndValues in interface MutableMap<K,V>public boolean containsKey(Object key)
containsKey in interface Map<K,V>containsKey in interface MapIterable<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>containsValue in interface MapIterable<K,V>public boolean equals(Object o)
public int hashCode()
public ImmutableMap<K,V> toImmutable()
toImmutable in interface MapIterable<K,V>toImmutable in interface MutableMapIterable<K,V>toImmutable in interface UnsortedMapIterable<K,V>toImmutable in class AbstractMutableMap<K,V>Copyright © 2004–2022. All rights reserved.