implicit final class ApsoMap[A, B] extends AnyVal
Implicit class that provides new methods for maps.
- Alphabetic
- By Inheritance
- ApsoMap
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
ApsoMap(map: Map[A, B])
- map
the map to which the new methods are provided.
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[A, B]
-
def
mapKeys[C](f: (A) ⇒ C): Map[C, B]
Applies a given function to all keys of this map.
Applies a given function to all keys of this map. In case
fis not injective, the behaviour is undefined.- f
the function to apply to all keys of this map
- returns
the resulting map with the keys mapped with function
f.
-
def
merge(that: Map[A, B])(f: (B, B) ⇒ B): Map[A, B]
Merges a given map into this map.
Merges a given map into this map. The map is constructed as follows:
- Keys present in this map but not in
thatmap are present in the merged map; - Keys present in both maps are present in the merged map with a
value given by
f(thisValue, thatValue); - Keys present in
thatmap but not in this map are not present in the merged map.
- that
the map to be merged into this map
- f
the function used to merge two values with the same key
- returns
the merged map.
- To do
check if this method is really useful / needed.
- Keys present in this map but not in
-
def
toString(): String
- Definition Classes
- Any
-
def
twoWayMerge(that: Map[A, B])(f: (B, B) ⇒ B): Map[A, B]
Merges a given map with this map.
Merges a given map with this map. The map is constructed as follows:
- Keys present in one of thw two maps are present in the merged map;
- Keys in both maps are present in the merged map with a value given
by
f(thisValue, thatValue);
- that
the map to be merged with this map
- f
the function used to merge two values with the same key
- returns
the merged map.