public class ManMapExt
extends java.lang.Object
| Constructor and Description |
|---|
ManMapExt() |
| Modifier and Type | Method and Description |
|---|---|
static <K,V> java.util.Map<K,V> |
mapOf(manifold.rt.api.util.Pair<K,V>... entries)
For use with the
key and value binding expression syntax using Pair.and. |
static <K,V> V |
set(java.util.Map<K,V> thiz,
K key,
V value)
Implements the indexed assignment operator for Map to enable the syntax:
map[key] = value |
public static <K,V> V set(java.util.Map<K,V> thiz,
K key,
V value)
map[key] = value
key - key with which the specified value is to be associatedvalue - value to be associated with the specified keyjava.lang.UnsupportedOperationException - if the put operation
is not supported by this mapjava.lang.ClassCastException - if the class of the specified key or value
prevents it from being stored in this mapjava.lang.NullPointerException - if the specified key or value is null
and this map does not permit null keys or valuesjava.lang.IllegalArgumentException - if some property of the specified key
or value prevents it from being stored in this map@SafeVarargs public static <K,V> java.util.Map<K,V> mapOf(manifold.rt.api.util.Pair<K,V>... entries)
key and value binding expression syntax using Pair.and.
import static manifold.rt.api.util.Pair.and;
Map<String, Integer> scores =
mapOf("Moe" and 100, "Larry" and 107, "Curly" and 111);
Returns a new read-only map with the specified contents, given as a list of pairs where the first value is the key and the second is the value.
If multiple pairs have the same key, the resulting map will contain the value from the last of those pairs.
Entries of the map are iterated in the order they were specified.
entries - key/value pairs, for use with the key and value binding expression syntax via Pair.and.java.lang.UnsupportedOperationException - if the put operation
is not supported by this mapjava.lang.ClassCastException - if the class of the specified key or value
prevents it from being stored in this mapjava.lang.NullPointerException - if the specified key or value is null
and this map does not permit null keys or valuesjava.lang.IllegalArgumentException - if some property of the specified key
or value prevents it from being stored in this mapCopyright © 2022. All rights reserved.