Object/Class

com.thoughtworks.dsl.keywords

Continue

Related Docs: class Continue | package keywords

Permalink

object Continue extends Continue with Keyword[Continue, Nothing] with Product with Serializable

A keyword to skip the current iteration in a collection comprehension block.

Author:

杨博 (Yang Bo)

Source
Continue.scala
Example:
  1. Each and Continue can be used to calculate composite numbers and prime numbers.

    def compositeNumbersBelow(maxNumber: Int) = collection.immutable.HashSet {
      val factor = !Each(2 until math.ceil(math.sqrt(maxNumber)).toInt)
      !Each(2 * factor until maxNumber by factor)
    }
    compositeNumbersBelow(13) should be(Set(4, 6, 8, 9, 10, 12))
    def primeNumbersBelow(maxNumber: Int) = Seq {
      val compositeNumbers = compositeNumbersBelow(maxNumber)
      val i = !Each(2 until maxNumber)
      if (compositeNumbers(i)) !Continue
      i
    }
    primeNumbersBelow(13) should be(Array(2, 3, 5, 7, 11))
Note

This Continue keyword is usually used with Each, to skip an element in the loop.

See also

Each for creating collection comprehensions.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Continue
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Continue
  7. Keyword
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. implicit def OptionContinueDsl[Value, Element](implicit factory: Factory[Element, Option[Element]]): Dsl[Continue, Option[Element], Value]

    Permalink
  5. final def apply[Domain](handler: (Nothing) ⇒ Domain)(implicit dsl: Dsl[Continue, Domain, Nothing]): Domain

    Permalink

    An alias to cpsApply.

    An alias to cpsApply.

    Definition Classes
    Keyword
    Annotations
    @inline()
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  8. implicit def collectionContinueDsl[Value, Element, Collection[_]](implicit factory: Factory[Element, Collection[Element]]): Dsl[Continue, Collection[Element], Value]

    Permalink
  9. implicit def continueUnitDsl[Value]: Dsl[Continue, Unit, Value]

    Permalink
  10. final def cpsApply[Domain](handler: (Nothing) ⇒ Domain)(implicit dsl: Dsl[Continue, Domain, Nothing]): Domain

    Permalink
    Definition Classes
    Keyword
    Annotations
    @inline()
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. final def unary_!: Nothing

    Permalink
    Definition Classes
    Keyword
    Annotations
    @shift() @compileTimeOnly( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Continue

Inherited from Keyword[Continue, Nothing]

Inherited from AnyRef

Inherited from Any

Ungrouped