class MapDecorator[C, M <: IsMap[C]] extends AnyRef
- Alphabetic
- By Inheritance
- MapDecorator
- AnyRef
- Any
- by seqDecorator
- by iterableDecorator
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new MapDecorator(coll: C)(implicit map: M)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toany2stringadd[MapDecorator[C, M]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (MapDecorator[C, M], B)
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toArrowAssoc[MapDecorator[C, M]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def ensuring(cond: (MapDecorator[C, M]) => Boolean, msg: => Any): MapDecorator[C, M]
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toEnsuring[MapDecorator[C, M]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (MapDecorator[C, M]) => Boolean): MapDecorator[C, M]
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toEnsuring[MapDecorator[C, M]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): MapDecorator[C, M]
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toEnsuring[MapDecorator[C, M]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): MapDecorator[C, M]
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toEnsuring[MapDecorator[C, M]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def foldSomeLeft[B]: ([B](z: B)(op: (B, _1.it.A) => Option[B]): B) forSome {val _1: IterableDecorator[MapDecorator[C, M], it.type]}
Left to right fold that stops if the combination function
opreturnsNoneLeft to right fold that stops if the combination function
opreturnsNone- B
the result type of the binary operator
- returns
the result of inserting
opbetween consecutive elements of the collection, going left to right with the start valuezon the left, and stopping when all the elements have been traversed or earlier if the operator returnsNone
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toIterableDecorator[MapDecorator[C, M], it.type] performed by method iterableDecorator in scala.collection.decorators.This conversion will take place only if an implicit value of type IsIterable[MapDecorator[C, M]] is in scope.
- Definition Classes
- IterableDecorator
- final def fullOuterJoin[W, That](other: Map[M.K, W])(implicit bf: BuildFrom[C, (M.K, (Option[M.V], Option[W])), That]): That
Alias for
mergeByKeyAlias for
mergeByKey- Annotations
- @inline()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def intersperse[B >: SeqDecorator.S.A, That]: ([B, That](start: B, sep: B, end: B)(implicit bf: scala.collection.BuildFrom[scala.collection.decorators.MapDecorator[C,M],B,That]): That) forSome {val _1: SeqDecorator[MapDecorator[C, M], seq.type]}
Adds the element
sepbetween each element of the sequence, prependingstartand appendingend.Adds the element
sepbetween each element of the sequence, prependingstartand appendingend. If the sequence has less than two elements, returnsstart +: this :+ end.- B
the element type of the returned collection
- returns
a new collection consisting of all elements of this collection interspersed with the element
sep, beginning withstartand ending withend
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toSeqDecorator[MapDecorator[C, M], seq.type] performed by method seqDecorator in scala.collection.decorators.This conversion will take place only if an implicit value of type IsSeq[MapDecorator[C, M]] is in scope.
- Definition Classes
- SeqDecorator
List(1, 2, 3, 4).intersperse(-1, 0, 5) => List(-1, 1, 0, 2, 0, 3, 0, 4, 5)
Example: - def intersperse[B >: SeqDecorator.S.A, That]: ([B, That](sep: B)(implicit bf: scala.collection.BuildFrom[scala.collection.decorators.MapDecorator[C,M],B,That]): That) forSome {val _1: SeqDecorator[MapDecorator[C, M], seq.type]}
Adds the element
sepbetween each element of the sequence.Adds the element
sepbetween each element of the sequence. If the sequence has less than two elements, the collection is unchanged.- B
the element type of the returned collection
- returns
a new collection consisting of all elements of this collection interspersed with the element
sep
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toSeqDecorator[MapDecorator[C, M], seq.type] performed by method seqDecorator in scala.collection.decorators.This conversion will take place only if an implicit value of type IsSeq[MapDecorator[C, M]] is in scope.
- Definition Classes
- SeqDecorator
List(1, 2, 3, 4).intersperse(0) = List(1, 0, 2, 0, 3, 0, 4)
Example: - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- implicit val it: it.type
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toIterableDecorator[MapDecorator[C, M], it.type] performed by method iterableDecorator in scala.collection.decorators.This conversion will take place only if an implicit value of type IsIterable[MapDecorator[C, M]] is in scope.
- Definition Classes
- IterableDecorator
- final def join[W, That](other: Map[M.K, W])(implicit bf: BuildFrom[C, (M.K, (M.V, W)), That]): That
Alias for
zipByKeyAlias for
zipByKey- Annotations
- @inline()
- def lazyFoldLeft[B]: ([B](z: B)(op: (B, => _1.it.A) => B): B) forSome {val _1: IterableDecorator[MapDecorator[C, M], it.type]}
Lazy left to right fold.
Lazy left to right fold. Like
foldLeftbut the combination functionopis non-strict in its second parameter. Ifop(b, a)chooses not to evaluateaand returnsb, this terminates the traversal early.- B
the result type of the binary operator
- returns
the result of inserting
opbetween consecutive elements of the collection, going left to right with the start valuezon the left, and stopping when all the elements have been traversed or earlier ifop(b, a)choose not to evaluateaand returnsb
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toIterableDecorator[MapDecorator[C, M], it.type] performed by method iterableDecorator in scala.collection.decorators.This conversion will take place only if an implicit value of type IsIterable[MapDecorator[C, M]] is in scope.
- Definition Classes
- IterableDecorator
- def lazyFoldRight[B]: ([B](z: B)(op: _1.it.A => scala.util.Either[B,B => B]): B) forSome {val _1: IterableDecorator[MapDecorator[C, M], it.type]}
Right to left fold that can be interrupted before traversing the whole collection.
Right to left fold that can be interrupted before traversing the whole collection.
- B
the result type
- returns
the result of applying the operator between consecutive elements of the collection, going right to left, with the start value
zon the right. The result of the application of the functionopto each element drives the process: if it returnsLeft(result), thenresultis returned without iterating further; if it returnsRight(f), the functionfis applied to the previous result to produce the new result and the fold continues.
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toIterableDecorator[MapDecorator[C, M], it.type] performed by method iterableDecorator in scala.collection.decorators.This conversion will take place only if an implicit value of type IsIterable[MapDecorator[C, M]] is in scope.
- Definition Classes
- IterableDecorator
- def leftOuterJoin[W, That](other: Map[M.K, W])(implicit bf: BuildFrom[C, (M.K, (M.V, Option[W])), That]): That
Perform a left outer join of
thisandthat.Perform a left outer join of
thisandthat.Equivalent to
mergeByKeyWith(that) { case (Some(v), maybeW) => (v, maybeW) }.- W
Type of values of
that- That
Type of the resulting collection
- bf
Builder for the resulting collection
- returns
A Map that associates all the keys
kofthisto pairs(v, Some(w))ifthatassociatesktow, or(v, None)ifthatdoesn’t containk
- implicit val map: M
- final def mergeByKey[W, That](other: Map[M.K, W])(implicit bf: BuildFrom[C, (M.K, (Option[M.V], Option[W])), That]): That
Perform a full outer join of
thisandthat.Perform a full outer join of
thisandthat.Equivalent to
mergeByKeyWith(that) { case any => any }.- W
Type of values of
that(e.g.String)- That
Type of the resulting collection (e.g.
Map[Int, (Option[Boolean], Option[String])])- bf
Builder for the resulting collection
- returns
A Map that associates all the keys
kofthisorthatto pairs(Some(v), Some(w))ifthisassociatesktovandthatassociatesktow, or pairs(None, Some(w))ifthisdoesn’t containk, or pairs(Some(v), None)ifthatdoesn’t containk
- Annotations
- @inline()
- def mergeByKeyWith[W, X, That](other: Map[M.K, W])(f: PartialFunction[(Option[M.V], Option[W]), X])(implicit bf: BuildFrom[C, (M.K, X), That]): That
- W
Type of values of the other Map (e.g.
Int,String)- X
Type of values of the resulting Map
- That
Type of the result (e.g.
Map[Int, (String, Option[Boolean])])- other
Map to merge
- f
Combination function
- bf
Builder driven by the type of
thisMap- returns
A Map associating all the keys from
thisandthatwith values returned by the partial functionf, when this one is defined.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def replaced[B >: SeqDecorator.S.A, That]: ([B, That](elem: B, replacement: B)(implicit bf: scala.collection.BuildFrom[scala.collection.decorators.MapDecorator[C,M],B,That]): That) forSome {val _1: SeqDecorator[MapDecorator[C, M], seq.type]}
Produces a new sequence where all occurrences of some element are replaced by a different element.
Produces a new sequence where all occurrences of some element are replaced by a different element.
- B
the element type of the returned collection.
- returns
a new sequence consisting of all elements of this sequence except that all occurrences of
elemare replaced byreplacement
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toSeqDecorator[MapDecorator[C, M], seq.type] performed by method seqDecorator in scala.collection.decorators.This conversion will take place only if an implicit value of type IsSeq[MapDecorator[C, M]] is in scope.
- Definition Classes
- SeqDecorator
- def rightOuterJoin[W, That](other: Map[M.K, W])(implicit bf: BuildFrom[C, (M.K, (Option[M.V], W)), That]): That
Perform a right outer join of
thisandthat.Perform a right outer join of
thisandthat.Equivalent to
mergeByKeyWith(that) { case (maybeV, Some(w)) => (maybeV, w) }.- W
Type of values of
that(e.g.String)- That
Type of the resulting collection (e.g.
Map[Int, (Option[Boolean], String)])- bf
Builder for the resulting collection
- returns
A Map that associates all the keys
kofthatto pairs(Some(v), w)ifthisassociatesktov, or(None, w)ifthisdoesn’t containk
- implicit val seq: seq.type
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toSeqDecorator[MapDecorator[C, M], seq.type] performed by method seqDecorator in scala.collection.decorators.This conversion will take place only if an implicit value of type IsSeq[MapDecorator[C, M]] is in scope.
- Definition Classes
- SeqDecorator
- def splitBy[K, CC1, CC2]: ([K, CC1, CC2](f: _1.it.A => K)(implicit bf: scala.collection.BuildFrom[scala.collection.decorators.MapDecorator[C,M],_1.it.A,CC1], bff: scala.collection.BuildFrom[scala.collection.decorators.MapDecorator[C,M],CC1,CC2]): CC2) forSome {val _1: IterableDecorator[MapDecorator[C, M], it.type]}
Constructs a collection where consecutive elements are accumulated as long as the output of f for each element doesn't change.
Constructs a collection where consecutive elements are accumulated as long as the output of f for each element doesn't change.
Vector(1,2,2,3,3,3,2,2) .splitBy(identity)
producesVector(Vector(1), Vector(2,2), Vector(3,3,3), Vector(2,2))
- K
the type of the computed key
- returns
a collection of collections of the consecutive elements with the same key in the original collection
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toIterableDecorator[MapDecorator[C, M], it.type] performed by method iterableDecorator in scala.collection.decorators.This conversion will take place only if an implicit value of type IsIterable[MapDecorator[C, M]] is in scope.
- Definition Classes
- IterableDecorator
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def zipByKey[W, That](other: Map[M.K, W])(implicit bf: BuildFrom[C, (M.K, (M.V, W)), That]): That
Combines the entries of
thisMap with the entries ofthatMap that have the same key, tupling their values.Combines the entries of
thisMap with the entries ofthatMap that have the same key, tupling their values.xs.zipByKey(ys)is a shorthand forxs.zipByKeyWith(ys)((_, _)).- W
Type of values of the other Map (e.g.
Int,String)- That
Type of the result (e.g.
Map[Int, (String, Boolean)],TreeMap[String, (Int, Int)])- other
Other Map
- bf
Builder driven by the type of
thisMap- returns
A Map that associates all the keys
kcontained by boththisandthatto pairs(v, w)wherevis the value associated bythistokandwthe value associated bythattok
- def zipByKeyWith[W, X, That](other: Map[M.K, W])(f: (M.V, W) => X)(implicit bf: BuildFrom[C, (M.K, X), That]): That
Combines entries of
thisMap with entries ofthatMap that have the same key, using the combination functionfCombines entries of
thisMap with entries ofthatMap that have the same key, using the combination functionf- W
Type of values of the other Map (e.g.
Int,String)- X
Type of values of the resulting Map
- That
Type of the resulting Map
- other
Other Map
- f
Combination function
- bf
Builder driven by the type of
thisMap- returns
A Map that associates all the keys
kcontained by boththisandthatto the result of the application offto the valuesvandwrespectively associated bythisandthattok
Deprecated Value Members
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toStringFormat[MapDecorator[C, M]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)instead ofvalue.formatted(formatString), or use thef""string interpolator. In Java 15 and later,formattedresolves to the new method in String which has reversed parameters.
- def →[B](y: B): (MapDecorator[C, M], B)
- Implicit
- This member is added by an implicit conversion from MapDecorator[C, M] toArrowAssoc[MapDecorator[C, M]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.