|
Scala 2
|
||
class
Map
[ A , B ]
extends
java.lang.Object with
Map with
ScalaObjectfactory
, update
, and -.Class Summary | |
class
MapTo
|
Def Summary | |
def
+
( key : A )
: MapTo
This method defines syntactic sugar for adding a mapping. It is typically used in the following way: map + key -> value; |
|
def
-
( key : A )
: Map
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.
|
|
def
empty
[ C& ]
: Map
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 : scala.<repeated> )
: Map
This method will return a map where all the mappings for the given sequence of keys are removed from the map. |
|
def
excl
( keys : Iterable )
: Map
This method removes all the mappings for keys provided by an iterator over the elements of the keys object.
|
|
def
filter
( p : Function2 )
: Map
This method removes all the mappings for which the predicate p returns false .
|
|
override
|
def
hashCode
: scala.Int
|
def
incl
( map : Iterable )
: Map
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.<repeated> )
: Map
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 : Function2 )
: Map
This function transforms all the values of mappings contained in this map with function f .
|
|
def
mappingToString
( p : Tuple2 )
: 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. |
def
update
( key : A , value : B )
: Map
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 Detail |
def
+
( key : A ) : MapTo
map + key -> value;
def
-
( key : A ) : Map
key
.
If the map does not contain a mapping for the given key, the
method returns the same map.def
empty
[ C& ] : Map
C
.def
excl
( keys : scala.<repeated> ) : Map
def
excl
( keys : Iterable ) : Map
keys
object.def
filter
( p : Function2 ) : Map
p
returns false
.def
hashCode
: scala.Int
def
incl
( map : Iterable ) : Map
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.<repeated> ) : Map
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 : Function2 ) : Map
f
.def
mappingToString
( p : Tuple2 ) : java.lang.String
toString
.def
toString
: java.lang.String
def
update
( key : A , value : B ) : Map
key
to value
. If the map contains already a
mapping for key
, it will be overridden by this
function.