Top Description Methods
org.eclipse.collections.api.map

public Interface FixedSizeMap<K, V>

extends MutableMap<K, V>
Imports
java.util.Map, .Set, org.eclipse.collections.api.block.predicate.Predicate2, org.eclipse.collections.api.block.procedure.Procedure

A FixedSizeMap is a map that may be mutated, but cannot grow or shrink in size.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Redeclares java.util.Map.clear.

Removes all of the mappings from this map (optional operation).

public V
put(K key, V value)

Redeclares java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation).

public void
putAll(Map<? extends K, ? extends V> map)

Redeclares java.util.Map.putAll.

Copies all of the mappings from the specified map to this map (optional operation).

public default void
public V
remove(Object key)

Redeclares java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation).

public boolean
removeAllKeys(Set<? extends K> keys)

Redeclares as abstract: org.eclipse.collections.api.map.MutableMapIterable.removeAllKeys.

Remove entries from the map at the specified keys.

public boolean
removeIf(Predicate2<? super K, ? super V> predicate)

Redeclares as abstract: org.eclipse.collections.api.map.MutableMapIterable.removeIf.

Remove an entry from the map if the predicate evaluates to true.

public V
removeKey(K key)

Redeclares org.eclipse.collections.api.map.MutableMapIterable.removeKey.

Remove an entry from the map at the specified key.

public FixedSizeMap<K, V>
tap(Procedure<? super V> procedure)

Redeclares org.eclipse.collections.api.map.MutableMap.tap.

Executes the Procedure for each value of the map and returns this.

public default FixedSizeMap<K, V>
withMap(Map<? extends K, ? extends V> map)

Overrides default org.eclipse.collections.api.map.MutableMap.withMap.

Similar to putAll(Map), but returns this instead of void

public default FixedSizeMap<K, V>
withMapIterable(MapIterable<? extends K, ? extends V> mapIterable)

Overrides default org.eclipse.collections.api.map.MutableMap.withMapIterable.

Inherited from org.eclipse.collections.api.map.MutableMap:
aggregateByaggregateByaggregateInPlaceByasSynchronizedasUnmodifiableclonecollectcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectKeysAndValuescollectKeysUniquecollectLongcollectShortcollectValuescollectWithflatCollectflatCollectWithflipflipUniqueValuesgroupBygroupByEachgroupByUniqueKeynewEmptypartitionpartitionWithreduceByrejectrejectrejectWithselectselectselectInstancesOfselectWithwithAllKeyValueArgumentswithAllKeyValueswithKeyValuewithoutAllKeyswithoutKeyzipzipWithIndex

Method Detail

clearback to summary
public void clear()

Redeclares java.util.Map.clear.

Doc from java.util.Map.clear.

Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.

Annotations
@Override
Exceptions
UnsupportedOperationException:
the clear operation is not supported by this map.
putback to summary
public V put(K key, V value)

Redeclares java.util.Map.put.

Doc from java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)

Annotations
@Override
Exceptions
UnsupportedOperationException:
the put operation is not supported by this map.
putAllback to summary
public void putAll(Map<? extends K, ? extends V> map)

Redeclares java.util.Map.putAll.

Doc from java.util.Map.putAll.

Copies all of the mappings from the specified map to this map (optional operation). The effect of this call is equivalent to that of calling put(k, v) on this map once for each mapping from key k to value v in the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress. If the specified map has a defined encounter order, processing of its mappings generally occurs in that order.

Annotations
@Override
Exceptions
UnsupportedOperationException:
the putAll operation is not supported by this map.
putAllMapIterableback to summary
public default void putAllMapIterable(MapIterable<? extends K, ? extends V> mapIterable)

Overrides default org.eclipse.collections.api.map.MutableMapIterable.putAllMapIterable.

Annotations
@Override
removeback to summary
public V remove(Object key)

Redeclares java.util.Map.remove.

Doc from java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation). More formally, if this map contains a mapping from key k to value v such that Objects.equals(key, k), that mapping is removed. (The map can contain at most one such mapping.)

Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.

If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.

The map will not contain a mapping for the specified key once the call returns.

Annotations
@Override
Exceptions
UnsupportedOperationException:
the remove operation is not supported by this map.
removeAllKeysback to summary
public boolean removeAllKeys(Set<? extends K> keys)

Redeclares as abstract: org.eclipse.collections.api.map.MutableMapIterable.removeAllKeys.

Doc from org.eclipse.collections.api.map.MutableMapIterable.removeAllKeys.

Remove entries from the map at the specified keys.

Annotations
@Override
Exceptions
UnsupportedOperationException:
the removeAllKeys operation is not supported by this map.
removeIfback to summary
public boolean removeIf(Predicate2<? super K, ? super V> predicate)

Redeclares as abstract: org.eclipse.collections.api.map.MutableMapIterable.removeIf.

Doc from org.eclipse.collections.api.map.MutableMapIterable.removeIf.

Remove an entry from the map if the predicate evaluates to true.

Annotations
@Override
Exceptions
UnsupportedOperationException:
the removeIf operation is not supported by this map.
removeKeyback to summary
public V removeKey(K key)

Redeclares org.eclipse.collections.api.map.MutableMapIterable.removeKey.

Doc from org.eclipse.collections.api.map.MutableMapIterable.removeKey.

Remove an entry from the map at the specified key.

Annotations
@Override
Exceptions
UnsupportedOperationException:
the removeKey operation is not supported by this map.
tapback to summary
public FixedSizeMap<K, V> tap(Procedure<? super V> procedure)

Redeclares org.eclipse.collections.api.map.MutableMap.tap.

Doc from org.eclipse.collections.api.map.MapIterable.tap.

Executes the Procedure for each value of the map and returns this.

return peopleByCity.tap(person -> LOGGER.info(person.getName()));
Annotations
@Override
withMapback to summary
public default FixedSizeMap<K, V> withMap(Map<? extends K, ? extends V> map)

Overrides default org.eclipse.collections.api.map.MutableMap.withMap.

Doc from org.eclipse.collections.api.map.MutableMapIterable.withMap.

Similar to putAll(Map), but returns this instead of void

Annotations
@Override
withMapIterableback to summary
public default FixedSizeMap<K, V> withMapIterable(MapIterable<? extends K, ? extends V> mapIterable)

Overrides default org.eclipse.collections.api.map.MutableMap.withMapIterable.

Annotations
@Override