public class XcoreEMapExtensions
extends java.lang.Object
Constructor and Description |
---|
XcoreEMapExtensions() |
Modifier and Type | Method and Description |
---|---|
static <K,V> EMap<K,V> |
filter(EMap<K,V> map,
Returns a filtered view of the map.
|
static <K,V> void |
forEach(EMap<K,V> map,
Applies the given the procedure to each
key-value pair of the given map. |
static <K,V> void |
forEach(EMap<K,V> map,
Applies the given the procedure to each
key-value pair of the given map. |
static <K,V1,V2> EMap<K,V2> |
mapValues(EMap<K,V1> map,
Returns a transformed view of the map that applies the given the transformation to each value of map.
|
public static <K,V> void forEach(EMap<K,V> map,procedure)
key-value pair
of the given map.
The procedure takes the key and the value as arguments.map
- the map. May not be null
.procedure
- the procedure. May not be null
.public static <K,V> void forEach(EMap<K,V> map,procedure)
key-value pair
of the given map.
The procedure takes the key, the value, and a loop counter as arguments.
If the counter would overflow,
Integer.MAX_VALUE
is returned for all subsequent pairs.
The first pair is at index zero.map
- the map. May not be null
.procedure
- the procedure. May not be null
.public static <K,V> EMap<K,V> filter(EMap<K,V> map,predicate)
map
- the original map. May not be null
.predicate
- the predicate for filtering. May not be null
.null
.public static <K,V1,V2> EMap<K,V2> mapValues(EMap<K,V1> map,transformation)
map
- the map to be transformed. May not be null
.transformation
- the transformation to apply. May not be null
.null
.