|
Scala 2.3.1
|
abstract
trait
Map
[A, B]
extends
java.lang.Object
with
scala.collection.Map[A, B]
with
scala.ScalaObject
This class extends the Map
interface of collections
that unambiguously map keys to values (i.e. a key is mapped to at
least one value).
This class defines the interface for functional map implementations relying on immutable data structures.
Concrete map implementations have to provide functionality for
the abstract methods in
scala.collection.Map
as well as for
factory
, update
, and -
.
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 |
|
abstract
|
def
-
(key: A)
: scala.collection.immutable.Map[A, B]
This creates a new mapping without the given key .
If the map does not contain a mapping for the given key, the
method returns the same 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.
|
|
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 .
|
|
override
|
def
hashCode
: scala.Int
|
def
incl
(map: scala.Iterable[scala.Tuple2[A, B]])
: scala.collection.immutable.Map[A, B]
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
(mappings: scala.Tuple2[A,B]*)
: scala.collection.immutable.Map[A, B]
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
map
[C]
(f: (scala.Tuple2[A, B]) => C)
: scala.collection.immutable.Map[A, C]
This function transforms all the values of mappings contained in this map with function f .
|
|
def
mappingToString
(p: scala.Tuple2[A, B])
: java.lang.String
This method controls how a mapping is represented in the string representation provided by method toString .
|
|
override
|
def
toString
: java.lang.String
Returns a string representation of this map which shows all the mappings. |
abstract
|
def
update
(key: A, value: B)
: scala.collection.immutable.Map[A, B]
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, 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
abstract
def
-
(key: A): scala.collection.immutable.Map[A, B]
key
.
If the map does not contain a mapping for the given key, the
method returns the same map.
abstract
def
empty
[C]: scala.collection.immutable.Map[A, C]
C
.
def
excl
(keys: A*): scala.collection.immutable.Map[A, B]
keys -
...
def
excl
(keys: scala.Iterable[A]): scala.collection.immutable.Map[A, B]
keys
object.keys -
...
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
override
def
hashCode
: scala.Int
def
incl
(map: scala.Iterable[scala.Tuple2[A, B]]): scala.collection.immutable.Map[A, B]
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.map -
...
def
incl
(mappings: scala.Tuple2[A,B]*): scala.collection.immutable.Map[A, B]
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 -
...
def
map
[C](f: (scala.Tuple2[A, B]) => C): scala.collection.immutable.Map[A, C]
f
.f -
A function over key-value pairs
def
mappingToString
(p: scala.Tuple2[A, B]): java.lang.String
toString
.p -
...
override
def
toString
: java.lang.String
abstract
def
update
(key: A, value: B): scala.collection.immutable.Map[A, B]
key
to value
. If the map contains already a
mapping for key
, it will be overridden by this
function.key -
...
value -
...