final case class Each[Element](elements: Traversable[Element]) extends Keyword[Each[Element], Element] with Product with Serializable
Iterates though each element in elements.
Author:
杨博 (Yang Bo)
- Source
- Each.scala
Each keywords can be used to calculate cartesian product.
def cartesianProduct = List(!Each(Array(1, 2, 3)) * !Each(Vector(1, 10, 100, 1000))) cartesianProduct should be(List(1, 10, 100, 1000, 2, 20, 200, 2000, 3, 30, 300, 3000))
- See also
comprehension if you want to use traditional
for
comprehension instead of !-notation.
- Alphabetic
- By Inheritance
- Each
- Serializable
- Serializable
- Product
- Equals
- Keyword
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Each(elements: Traversable[Element])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Each[Element], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
apply[Domain](handler: (Element) ⇒ Domain)(implicit dsl: Dsl[Each[Element], Domain, Element]): Domain
An alias to cpsApply.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
cpsApply[Domain](handler: (Element) ⇒ Domain)(implicit dsl: Dsl[Each[Element], Domain, Element]): Domain
- Definition Classes
- Keyword
- Annotations
- @inline()
- val elements: Traversable[Element]
- def ensuring(cond: (Each[Element]) ⇒ Boolean, msg: ⇒ Any): Each[Element]
- def ensuring(cond: (Each[Element]) ⇒ Boolean): Each[Element]
- def ensuring(cond: Boolean, msg: ⇒ Any): Each[Element]
- def ensuring(cond: Boolean): Each[Element]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- final def unary_!: Element
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def →[B](y: B): (Each[Element], B)