implicit final class MapValuesWithKey[K, V] extends AnyVal
Augments scala.collection.Map with an mapValuesWithKey
method that allows mapping the
values while having the keys available. Similar to the corresponding RDD operation.
- K
The key type of the map.
- V
The value type of the map.
- Alphabetic
- By Inheritance
- MapValuesWithKey
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
MapValuesWithKey(map: Map[K, V])
- map
The wrapped map.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val map: Map[K, V]
-
def
mapValuesWithKey[V2](f: (K, V) ⇒ V2): Map[K, V2]
Transforms this map by applying a function to every retrieved value.
Transforms this map by applying a function to every retrieved value.
- f
the function used to transform values of this map.
- returns
a map view which maps every key of this map to
f(this(key))
. The resulting map wraps the original map without copying any elements.
-
def
toString(): String
- Definition Classes
- Any