Package org.eclipse.collections.api.map
Interface FixedSizeMap<K,V>
-
- All Superinterfaces:
java.lang.Cloneable
,InternalIterable<V>
,java.lang.Iterable<V>
,java.util.Map<K,V>
,MapIterable<K,V>
,MutableMap<K,V>
,MutableMapIterable<K,V>
,RichIterable<V>
,UnsortedMapIterable<K,V>
- All Known Implementing Classes:
AbstractMemoryEfficientMutableMap
,DoubletonMap
,EmptyMap
,SingletonMap
,TripletonMap
public interface FixedSizeMap<K,V> extends MutableMap<K,V>
A FixedSizeMap is a map that may be mutated, but cannot grow or shrink in size.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
clear()
V
put(K key, V value)
void
putAll(java.util.Map<? extends K,? extends V> map)
default void
putAllMapIterable(MapIterable<? extends K,? extends V> mapIterable)
V
remove(java.lang.Object key)
boolean
removeAllKeys(java.util.Set<? extends K> keys)
Remove entries from the map at the specifiedkeys
.boolean
removeIf(Predicate2<? super K,? super V> predicate)
Remove an entry from the map if thepredicate
evaluates to true.V
removeKey(K key)
Remove an entry from the map at the specifiedkey
.FixedSizeMap<K,V>
tap(Procedure<? super V> procedure)
Executes the Procedure for each value of the map and returnsthis
.default FixedSizeMap<K,V>
withMap(java.util.Map<? extends K,? extends V> map)
Similar toMap.putAll(Map)
, but returns this instead of voiddefault FixedSizeMap<K,V>
withMapIterable(MapIterable<? extends K,? extends V> mapIterable)
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndex
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
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.map.MutableMap
aggregateBy, aggregateBy, aggregateInPlaceBy, asSynchronized, asUnmodifiable, clone, collect, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectKeysAndValues, collectLong, collectShort, collectValues, collectWith, flatCollect, flatCollectWith, flip, flipUniqueValues, groupBy, groupByEach, groupByUniqueKey, newEmpty, partition, partitionWith, reject, reject, rejectWith, select, select, selectInstancesOf, selectWith, withAllKeyValueArguments, withAllKeyValues, withKeyValue, withoutAllKeys, withoutKey, zip, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.map.MutableMapIterable
add, countBy, countByEach, countByWith, getIfAbsentPut, getIfAbsentPut, getIfAbsentPutWith, getIfAbsentPutWithKey, getOrDefault, putPair, sumByDouble, sumByFloat, sumByInt, sumByLong, toImmutable, updateValue, updateValueWith
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, 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, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.map.UnsortedMapIterable
toImmutable
-
-
-
-
Method Detail
-
clear
void clear()
-
remove
V remove(java.lang.Object key)
-
removeKey
V removeKey(K key)
Description copied from interface:MutableMapIterable
Remove an entry from the map at the specifiedkey
.- Specified by:
removeKey
in interfaceMutableMapIterable<K,V>
- Returns:
- The value removed from entry at key, or null if not found.
- Throws:
java.lang.UnsupportedOperationException
- theremoveKey
operation is not supported by this map.- See Also:
Map.remove(Object)
-
removeAllKeys
boolean removeAllKeys(java.util.Set<? extends K> keys)
Description copied from interface:MutableMapIterable
Remove entries from the map at the specifiedkeys
.- Specified by:
removeAllKeys
in interfaceMutableMapIterable<K,V>
- Returns:
true
if this map changed as a result of the call- Throws:
java.lang.UnsupportedOperationException
- theremoveAllKeys
operation is not supported by this map.
-
removeIf
boolean removeIf(Predicate2<? super K,? super V> predicate)
Description copied from interface:MutableMapIterable
Remove an entry from the map if thepredicate
evaluates to true.- Specified by:
removeIf
in interfaceMutableMapIterable<K,V>
- Returns:
- true if any entry is removed.
- Throws:
java.lang.UnsupportedOperationException
- theremoveIf
operation is not supported by this map.
-
tap
FixedSizeMap<K,V> tap(Procedure<? super V> procedure)
Description copied from interface:MapIterable
Executes the Procedure for each value of the map and returnsthis
.return peopleByCity.tap(person -> LOGGER.info(person.getName()));
- Specified by:
tap
in interfaceMapIterable<K,V>
- Specified by:
tap
in interfaceMutableMap<K,V>
- Specified by:
tap
in interfaceMutableMapIterable<K,V>
- Specified by:
tap
in interfaceRichIterable<K>
- Specified by:
tap
in interfaceUnsortedMapIterable<K,V>
- See Also:
RichIterable.forEach(Procedure)
-
withMap
default FixedSizeMap<K,V> withMap(java.util.Map<? extends K,? extends V> map)
Description copied from interface:MutableMapIterable
Similar toMap.putAll(Map)
, but returns this instead of void- Specified by:
withMap
in interfaceMutableMap<K,V>
- Specified by:
withMap
in interfaceMutableMapIterable<K,V>
- See Also:
Map.putAll(Map)
-
withMapIterable
default FixedSizeMap<K,V> withMapIterable(MapIterable<? extends K,? extends V> mapIterable)
- Specified by:
withMapIterable
in interfaceMutableMap<K,V>
- Specified by:
withMapIterable
in interfaceMutableMapIterable<K,V>
-
putAllMapIterable
default void putAllMapIterable(MapIterable<? extends K,? extends V> mapIterable)
- Specified by:
putAllMapIterable
in interfaceMutableMapIterable<K,V>
-
-