public class SMap<K,V> extends Object
| Modifier and Type | Method and Description |
|---|---|
static <K,V> SMap<K,V> |
apply()
Retrieves the value which is associated with the given key.
|
V |
apply(K key)
Retrieves the value which is associated with the given key.
|
static <K,V> SMap<K,V> |
apply(Map<K,V> map) |
static <K,V> SMap<K,V> |
apply(Seq<Tuple2<K,V>> tuples) |
SMap<K,V> |
copy()
[Original] Copy Map instance (elements are not copied)
|
SMap<K,V> |
filter(Function1<Tuple2<K,V>,Boolean> f)
Selects all elements of this immutable map which satisfy a predicate.
|
void |
foreach(VoidFunction1<Tuple2<K,V>> f)
Applies a function f to all elements of this immutable map.
|
V |
getOrElse(K key,
V defaultValue)
Returns the value associated with a key, or a default value if the key is
not contained in the map.
|
boolean |
isEmpty() |
Iterator<Tuple2<K,V>> |
iterator() |
<L,M> SMap<L,M> |
map(Function1<Tuple2<K,V>,Tuple2<L,M>> f)
Builds a new collection by applying a function to all elements of this
immutable map.
|
SMap<K,V> |
minus(K... keys)
Creates a new immutable map from this immutable map with some elements
removed.
|
SMap<K,V> |
plus(Tuple2<K,V>... elems)
Adds two or more elements to this collection and returns a new
collection.
|
List<Tuple2<K,V>> |
toList()
[Original] Provides as java.util.List object
|
Map<K,V> |
toMap()
[Original] Provides as java.util.Map object
|
Seq<Tuple2<K,V>> |
toSeq() |
String |
toString() |
Tuple2<Seq<K>,Seq<V>> |
unzip()
Converts this immutable map of pairs into two collections of the first
and second half of each pair.
|
SMap<K,V> |
updated(K key,
V value)
A new immutable map containing updating this map with a given key/value
mapping.
|
public static <K,V> SMap<K,V> apply()
public boolean isEmpty()
public V getOrElse(K key, V defaultValue)
public SMap<K,V> filter(Function1<Tuple2<K,V>,Boolean> f)
public void foreach(VoidFunction1<Tuple2<K,V>> f)
public <L,M> SMap<L,M> map(Function1<Tuple2<K,V>,Tuple2<L,M>> f)
public SMap<K,V> minus(K... keys)
public SMap<K,V> plus(Tuple2<K,V>... elems)
public SMap<K,V> updated(K key, V value)
public Tuple2<Seq<K>,Seq<V>> unzip()
Copyright © 2015. All rights reserved.