| Access | Constructor and Description |
|---|---|
| pack-priv |
| AbstractMemoryEfficientMutableMap | back to summary |
|---|---|
| pack-priv AbstractMemoryEfficientMutableMap() | |
| clear | back to summary |
|---|---|
| public void clear() Implements org. Doc from java. Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.
| |
| collect | back to summary |
|---|---|
| public abstract <K2, V2> FixedSizeMap Redeclares org. Overrides org. Doc from org. For each key and value of the map the function is evaluated. The results of these evaluations are returned in a new map. The map returned will use the values projected from the function rather than the original values.
MapIterable<String, String> collected =
peopleByCity.collect((City city, Person person) -> Pair.of(city.getCountry(), person.getAddress().getCity()));
| |
| collectKeysAndValues | back to summary |
|---|---|
| public <E> MutableMap Implements org. Doc from org. Adds all the entries derived from
| |
| collectKeysUnique | back to summary |
|---|---|
| public abstract <R> FixedSizeMap Redeclares org. Overrides org. Doc from org. For each key and value of the map the function is evaluated. The results of these evaluations are returned in a new map. The map returned will use the keys projected from the function rather than the original keys.
| |
| collectValues | back to summary |
|---|---|
| public abstract <R> FixedSizeMap Redeclares org. Overrides org. Doc from org. For each key and value of the map the function is evaluated. The results of these evaluations are returned in a new map. The map returned will use the values projected from the function rather than the original values.
MapIterable<City, String> collected =
peopleByCity.collectValues((City city, Person person) -> person.getFirstName() + " " + person.getLastName());
| |
| merge | back to summary |
|---|---|
| public V merge(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction) Overrides default java. Doc from java. If the specified key is not already associated with a value or is
associated with null, associates it with the given non-null value (optional
operation). Otherwise, replaces the associated value with the results of
the given remapping function, or removes if the result is
If the remapping function returns The remapping function should not modify this map during computation.
| |
| newEmpty | back to summary |
|---|---|
| public MutableMap Implements org. Doc from org. Creates a new instance of the same type, using the default capacity and growth parameters.
| |
| newEmpty | back to summary |
|---|---|
| public MutableMap Implements abstract org. Doc from org. Creates a new instance of the same type, using the given capacity and the default growth parameters.
| |
| put | back to summary |
|---|---|
| public V put(K key, V value) Implements org. Doc from java. 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
| |
| putAll | back to summary |
|---|---|
| public void putAll(Map<? extends K, ? extends V> map) Implements org. Doc from java. 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
| |
| reject | back to summary |
|---|---|
| public abstract FixedSizeMap Redeclares org. Overrides org. Doc from org. For each key and value of the map the predicate is evaluated, if the result of the evaluation is false, that key and value are returned in a new map.
MapIterable<City, Person> rejected =
peopleByCity.reject((city, person) -> city.getName().equals("Anytown") && person.getLastName().equals("Smith"));
| |
| remove | back to summary |
|---|---|
| public V remove(Object key) Implements org. Doc from java. 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 Returns the value to which this map previously associated the key,
or If this map permits null values, then a return value of
The map will not contain a mapping for the specified key once the call returns.
| |
| removeAllKeys | back to summary |
|---|---|
| public boolean removeAllKeys(Set<? extends K> keys) Overrides default org. Implements org. Doc from org. Remove entries from the map at the specified
| |
| removeIf | back to summary |
|---|---|
| public boolean removeIf(Predicate2<? super K, ? super V> predicate) Overrides default org. Implements org. Doc from org. Remove an entry from the map if the
| |
| removeKey | back to summary |
|---|---|
| public V removeKey(K key) Implements org. Doc from org. Remove an entry from the map at the specified
| |
| select | back to summary |
|---|---|
| public abstract FixedSizeMap Redeclares org. Overrides org. Doc from org. For each key and value of the map the predicate is evaluated, if the result of the evaluation is true, that key and value are returned in a new map.
MapIterable<City, Person> selected =
peopleByCity.select((city, person) -> city.getName().equals("Anytown") && person.getLastName().equals("Smith"));
| |
| tap | back to summary |
|---|---|
| public FixedSizeMap Overrides org. Implements org. Doc from org. Executes the Procedure for each value of the map and returns return peopleByCity.tap(person -> LOGGER.info(person.getName()));
| |
| updateValue | back to summary |
|---|---|
| public V updateValue(K key, Function0<? extends V> factory, Function<? super V, ? extends V> function) Overrides org. Implements org. Doc from org. Looks up the value associated with
| |
| updateValueWith | back to summary |
|---|---|
| public <P> V updateValueWith(K key, Function0<? extends V> factory, Function2<? super V, ? super P, ? extends V> function, P parameter) Overrides org. Implements org. Doc from org. Same as
| |
| withAllKeyValueArguments | back to summary |
|---|---|
| public MutableMap Overrides org. Implements org. Doc from org. Convenience var-args version of withAllKeyValues
| |
| withAllKeyValues | back to summary |
|---|---|
| public MutableMap Overrides org. Implements org. Doc from org. This method allows mutable, fixed size, and immutable maps the ability to add elements to their existing elements. In order to support fixed size maps, a new instance of a map would have to be returned including the keys and values of the original plus all the additional keys and values. In the case of mutable maps, the original map is modified and then returned. In order to use this method properly with mutable and fixed size maps the following approach must be taken:
map = map.withAllKeyValues(FastList.newListWith(PairImpl.of("new key", "new value")));
In the case of FixedSizeMap, a new instance will be returned by withAllKeyValues, and any variables that
previously referenced the original map will need to be redirected to reference the new instance. In the case
of a FastMap or UnifiedMap, you will be replacing the reference to map with map, since FastMap and UnifiedMap
will both return "this" after calling put on themselves.
| |
| withoutAllKeys | back to summary |
|---|---|
| public MutableMap Overrides org. Implements org. Doc from org. This method allows mutable, fixed size, and immutable maps the ability to remove elements from their existing elements. In order to support fixed size maps, a new instance of a map would have to be returned including the keys and values of the original minus all the keys and values to be removed. In the case of mutable maps, the original map is modified and then returned. In order to use this method properly with mutable and fixed size maps the following approach must be taken:
map = map.withoutAllKeys(FastList.newListWith("key1", "key2"));
In the case of FixedSizeMap, a new instance will be returned by withoutAllKeys, and any variables that previously
referenced the original map will need to be redirected to reference the new instance. In the case of a FastMap
or UnifiedMap, you will be replacing the reference to map with map, since FastMap and UnifiedMap will both return
"this" after calling remove on themselves.
| |