c

org.rogach.scallop

ScallopOption

abstract class ScallopOption[A] extends AnyRef

A class to hold a reference to not-yet-computed option values.

Basically, this is a lazy option - it batches up all operations, and evaluates the value only as the last resort.

Self Type
ScallopOption[A]
Source
ScallopOption.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ScallopOption
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ScallopOption(nm: () ⇒ String, _transformCount: Int = 0)

    nm

    Name for the option

    _transformCount

    Count of .map, .filter, etc. operations applied to this option

Type Members

  1. class WithFilter extends AnyRef

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val _transformCount: Int
  5. def apply(): A

    Retreive the underlying value.

    Retreive the underlying value. Use only if you are completely sure that there is a value.

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  8. def collect[B](pf: PartialFunction[A, B]): ScallopOption[B]

    Returns ScallopOption, that contains the result of applying pf to the value, if this option is non-empty and pf is defined for that value.

    Returns ScallopOption, that contains the result of applying pf to the value, if this option is non-empty and pf is defined for that value. Returns empty ScallopOption otherwise.

    pf

    the partial function

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def filter(p: (A) ⇒ Boolean): ScallopOption[A]

    Returns ScallopOption, that contains the value if applying predicate p to this value returned true.

    Returns ScallopOption, that contains the value if applying predicate p to this value returned true. No value otherwise.

    p

    the predicate used for testing

  12. def filterNot(p: (A) ⇒ Boolean): ScallopOption[A]

    Returns ScallopOption, that contains the value if applying predicate p to this value returned false.

    Returns ScallopOption, that contains the value if applying predicate p to this value returned false. No value otherwise.

    p

    the predicate used for testing

  13. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def flatMap[B](f: (A) ⇒ ScallopOption[B]): ScallopOption[B]

    Returns the result of applying f th this options value if this option is non-empty.

  15. lazy val fn: (String) ⇒ Option[A]
  16. def foreach(f: (A) ⇒ Unit): Unit

    Apply the given procedure f to the option's value, if it is nonempty.

  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def getOrElse(default: ⇒ A): A

    Retrieve the underlying value if the option is nonempty, otherwise return the result of evaluating default.

  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def isDefined: Boolean

    A convenience method to check whether the underlying option is defined.

    A convenience method to check whether the underlying option is defined. Just an alias for opt.get.isDefined.

  21. def isEmpty: Boolean

    A convenience method to check whether the underlying option is empty.

    A convenience method to check whether the underlying option is empty. Just an alias for !opt.isDefined.

  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def isSupplied: Boolean

    Tests whether the underlying value was explicitly supplied by user.

  24. def map[B](f: (A) ⇒ B): ScallopOption[B]

    Returns ScallopOption, that contains the result of applying f to this option's value, if this option is non-empty.

    Returns ScallopOption, that contains the result of applying f to this option's value, if this option is non-empty. Returns ScallopOption with no value otherwise.

    f

    the function to apply

  25. def name: String

    Name for the option

  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. def orElse[B >: A](alternative: ⇒ Option[B]): ScallopOption[B]

    Returns ScallopOption with this value if it is non-empty, or with the value of the alternative option.

    Returns ScallopOption with this value if it is non-empty, or with the value of the alternative option. If it is empty too, the resulting ScallopOption will contain None.

    alternative

    the alternative expression

  30. lazy val supplied: (String) ⇒ Boolean
  31. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  32. def toOption: Option[A]

    Retreive the underlying value as a scala Option

  33. def toString(): String
    Definition Classes
    ScallopOption → AnyRef → Any
  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  37. def withFilter(p: (A) ⇒ Boolean): WithFilter

Deprecated Value Members

  1. def get: Option[A]

    Retreive the underlying value as an option

    Retreive the underlying value as an option

    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.2) use .toOption instead

Inherited from AnyRef

Inherited from Any

Ungrouped