|
Scala 2.3.2
|
abstract
trait
Map
[A, B]
extends
java.lang.Object
with
scala.collection.Map[A, B]
with
scala.ScalaObject
Class Summary | |
class
MapTo
|
Def Summary | |
def
+
(key: A)
: Map.this.MapTo
This method defines syntactic sugar for adding a mapping. It is typically used in the following way: map + key -> value |
|
def
+
[B1 >: B]
(kv1: scala.Tuple2[A, B1], kv2: scala.Tuple2[A, B1], kvs: {A, B1}*)
: scala.collection.immutable.Map[A, B1]
Add two or more key/value pairs to this map. |
|
def
+
[B1 >: B]
(kv: scala.Tuple2[A, B1])
: scala.collection.immutable.Map[A, B1]
Add a key/value pair to this map. |
|
def
++
[B1 >: B]
(kvs: scala.Iterable[scala.Tuple2[A, B1]])
: scala.collection.immutable.Map[A, B1]
Add a sequence of key/value pairs to this map. |
|
def
++
[B1 >: B]
(kvs: scala.Iterator[scala.Tuple2[A, B1]])
: scala.collection.immutable.Map[A, B1]
Add a sequence of key/value pairs to this map. |
|
def
-
(key1: A, key2: A, keys: A*)
: scala.collection.immutable.Map[A, B]
Remove two or more keys from this map |
|
abstract
|
def
-
(key: A)
: scala.collection.immutable.Map[A, B]
Remove a key from this map |
def
--
(keys: scala.Iterable[A])
: scala.collection.immutable.Map[A, B]
Remove a sequence of keys from this map |
|
def
--
(keys: scala.Iterator[A])
: scala.collection.immutable.Map[A, B]
Remove a sequence of keys from this map |
|
abstract
|
def
empty
[C]
: scala.collection.immutable.Map[A, C]
This method returns a new map instance of the same class mapping keys of the same type to values of type C .
|
def
excl
(keys: A*)
: scala.collection.immutable.Map[A, B]
This method will return a map where all the mappings for the given sequence of keys are removed from the map. |
|
def
excl
(keys: scala.Iterable[A])
: scala.collection.immutable.Map[A, B]
This method removes all the mappings for keys provided by an iterator over the elements of the keys object.
|
|
override
|
def
filter
(p: (scala.Tuple2[A, B]) => scala.Boolean)
: scala.collection.immutable.Map[A, B]
This method removes all the mappings for which the predicate p returns false .
|
def
incl
[B1 >: B]
(map: scala.Iterable[scala.Tuple2[A, B1]])
: scala.collection.immutable.Map[A, B1]
incl can be used to add many mappings at the same time
to the map. The method assumes that each mapping is represented
by an Iterator over Pair objects who's first component
denotes the key, and who's second component refers to the value.
|
|
def
incl
[B1 >: B]
(mappings: {A, B1}*)
: scala.collection.immutable.Map[A, B1]
incl can be used to add many mappings at the same time
to the map. The method assumes that a mapping is represented
by a Pair object who's first component denotes the
key, and who's second component refers to the value.
|
|
def
mappingToString
[B1 >: B]
(p: scala.Tuple2[A, B1])
: java.lang.String
This method controls how a mapping is represented in the string representation provided by method toString .
|
|
def
transform
[C]
(f: (A, B) => C)
: scala.collection.immutable.Map[A, C]
This function transforms all the values of mappings contained in this map with function f .
|
|
abstract
|
def
update
[B1 >: B]
(key: A, value: B1)
: scala.collection.immutable.Map[A, B1]
This method allows one to create a new map with an additional mapping from key
to value . If the map contains already a
mapping for key , it will be overridden by this
function.
|
Def inherited from scala.collection.Map[A, B] | |
apply , contains, default, equals, get, hashCode, isDefinedAt, isEmpty, keySet, keys, size, toString, values |
Def Detail |
def
+
(key: A): Map.this.MapTo
This method defines syntactic sugar for adding a mapping. It is typically used in the following way:
map + key -> value
+({A, B})
instead
def
+
[B1 >: B](kv1: scala.Tuple2[A, B1], kv2: scala.Tuple2[A, B1], kvs: {A, B1}*): scala.collection.immutable.Map[A, B1]
kv1 -
the first key/value pair.
kv2 -
the second key/value pair.
kvs -
the remaining key/value pairs.
def
+
[B1 >: B](kv: scala.Tuple2[A, B1]): scala.collection.immutable.Map[A, B1]
kv -
the key/value pair.
def
++
[B1 >: B](kvs: scala.Iterable[scala.Tuple2[A, B1]]): scala.collection.immutable.Map[A, B1]
kvs -
the iterable object containing all key/value pairs.
def
++
[B1 >: B](kvs: scala.Iterator[scala.Tuple2[A, B1]]): scala.collection.immutable.Map[A, B1]
kvs -
the iterator containing all key/value pairs.
key1 -
the first key to be removed
key2 -
the second key to be removed
keys -
the remaining keys to be removed
keys
If the map is mutable, the bindings are removed in place
and the map itself is returned.
If the map is immutable, a new map with the bindings removed is returned.
abstract
def
-
(key: A): scala.collection.immutable.Map[A, B]
key -
the key to be removed
key
it is returned unchanged. Otherwise, return a new map
without a binding for key
def
--
(keys: scala.Iterable[A]): scala.collection.immutable.Map[A, B]
keys -
the keys to be removed
def
--
(keys: scala.Iterator[A]): scala.collection.immutable.Map[A, B]
keys -
the keys to be removed
abstract
def
empty
[C]: scala.collection.immutable.Map[A, C]
C
.
def
excl
(keys: A*): scala.collection.immutable.Map[A, B]
keys -
...
-
instead
def
excl
(keys: scala.Iterable[A]): scala.collection.immutable.Map[A, B]
keys
object.keys -
...
--
instead
override
def
filter
(p: (scala.Tuple2[A, B]) => scala.Boolean): scala.collection.immutable.Map[A, B]
p
returns false
.p -
A prediacte over key-value pairs
def
incl
[B1 >: B](map: scala.Iterable[scala.Tuple2[A, B1]]): scala.collection.immutable.Map[A, B1]
incl
can be used to add many mappings at the same time
to the map. The method assumes that each mapping is represented
by an Iterator over Pair
objects who's first component
denotes the key, and who's second component refers to the value.++
instead
def
incl
[B1 >: B](mappings: {A, B1}*): scala.collection.immutable.Map[A, B1]
incl
can be used to add many mappings at the same time
to the map. The method assumes that a mapping is represented
by a Pair
object who's first component denotes the
key, and who's second component refers to the value.mappings -
...
+
instead
def
mappingToString
[B1 >: B](p: scala.Tuple2[A, B1]): java.lang.String
toString
.p -
...
f
.f -
A function over keys and values
key
to value
. If the map contains already a
mapping for key
, it will be overridden by this
function.key -
...
value -
...
+({A, B})
instead