Adds a key/value binding to this priority map.
Adds a key/value binding to this priority map.
the key/value pair
a new priority map with the new binding added to this priority map
Adds two or more key/value bindings to this priority map.
Adds two or more key/value bindings to this priority map.
the first key/value pair to add
the second key/value pair to add
the remaining key/value pairs to add
a new priority map with the new bindings added to this map
Adds a number of key/value bindings to this priority map.
Adds a number of key/value bindings to this priority map.
a traversable object consisting of key/value pairs
a new priority map with the new bindings added to this map
An empty priority map of the same type as this priority map.
An empty priority map of the same type as this priority map.
Optionally returns the first key of this priority map.
Optionally returns the first key of this priority map.
Optionally returns the first value of this priority map.
Optionally returns the first value of this priority map.
Returns a new priority map of the same type as this priority map that only contains values greater than or equal to the given lower bound.
Returns a new priority map of the same type as this priority map that only contains values greater than or equal to the given lower bound.
the lower-bound (inclusive) on values
(Changed in version 2.8.0) keys
returns Iterable[A]
rather than Iterator[A]
.
Optionally returns the last key of this priority map.
Optionally returns the last key of this priority map.
Optionally returns the last value of this priority map.
Optionally returns the last value of this priority map.
Transforms this map by applying a function to every retrieved value.
Transforms this map by applying a function to every retrieved value.
the function used to transform values of this map
a new priority map that maps every key of this map
to f(this(key))
Merges a number of key/value bindings into this priority map.
Merges a number of key/value bindings into this priority map.
If a key is contained in both this map and the given bindings, computes the new value by applying the given merge function to the existing value and the new value.
a traversable object consisting of key/value pairs
the merge function
a new priority map with the new bindings merged into this map
Returns a new priority map of the same type as this priority map that only contains values between the given bounds.
Returns a new priority map of the same type as this priority map that only contains values between the given bounds.
the lower-bound (inclusive) on values
the upper-bound (exclusive) on values
Returns a new priority map of the same type as this priority map that only contains values between the given optional bounds.
Returns a new priority map of the same type as this priority map that only contains values between the given optional bounds.
the lower-bound (inclusive) on values or
None
if there is no lower bound
the upper-bound (exclusive) on values or
None
if there is no upper bound
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
Returns a new priority map of the same type as this priority map that only contains values smaller than given upper bound.
Returns a new priority map of the same type as this priority map that only contains values smaller than given upper bound.
the upper-bound (exclusive) on values
Add a key/value binding to this priority map.
Add a key/value binding to this priority map.
the key
the value
a new priority map with the new binding added to this map
Returns the values of this priority map as a sorted set.
Returns the values of this priority map as a sorted set.
(Changed in version 2.8.0) values
returns Iterable[B]
rather than Iterator[B]
.
The same priority map with a given default function.
The same priority map with a given default function.
Note: get
, contains
, iterator
, keys
, etc. are not affected by withDefault
.
Invoking transformer methods (e.g. map
) will not preserve the default value.
the function mapping keys to values, used for non-present keys
a wrapper of this priority map with a default function
The same priority map with a given default value.
The same priority map with a given default value.
Note: get
, contains
, iterator
, keys
, etc. are not affected by withDefaultValue
.
Invoking transformer methods (e.g. map
) will not preserve the default value.
default value used for non-present keys
a wrapper of this priority map with a default value
Default implementation of immutable priority maps using two maps: a regular map from keys to values and a sorted map from values to sets of keys.