Class

org.rogach.scallop

ScallopOption

Related Doc: package scallop

Permalink

abstract class ScallopOption[A] extends ScallopOptionBase

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
ScallopOptionBase, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ScallopOption
  2. ScallopOptionBase
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ScallopOption(nm: () ⇒ String, cliOption: Option[CliOption], _transformCount: Int = 0)

    Permalink

    nm

    Name for the option

    cliOption

    option descriptor (names, converters, validatiors, etc.)

    _transformCount

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

Type Members

  1. class WithFilter extends AnyRef

    Permalink

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. val _transformCount: Int

    Permalink

    Count of .map, .filter, etc.

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

  5. def apply(): A

    Permalink

    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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def collect[B](pf: PartialFunction[A, B]): ScallopOption[B]

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef → Any
  11. def filter(p: (A) ⇒ Boolean): ScallopOption[A]

    Permalink

    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]

    Permalink

    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

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

    Permalink

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

  15. lazy val fn: (String) ⇒ Option[A]

    Permalink
  16. def foreach(f: (A) ⇒ Unit): Unit

    Permalink

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

  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def getOrElse(default: ⇒ A): A

    Permalink

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

  19. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  20. def isDefined: Boolean

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    Any
  23. def isSupplied: Boolean

    Permalink

    Tests whether the underlying value was explicitly supplied by user.

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

    Permalink

    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

    Permalink

    Name for the option

  26. final def ne(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. def orElse[B >: A](alternative: ⇒ Option[B]): ScallopOption[B]

    Permalink

    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

    Permalink
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. def toOption: Option[A]

    Permalink

    Retreive the underlying value as a scala Option

  33. def toString(): String

    Permalink
    Definition Classes
    ScallopOption → AnyRef → Any
  34. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. def withFilter(p: (A) ⇒ Boolean): WithFilter

    Permalink

Deprecated Value Members

  1. def get: Option[A]

    Permalink

    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 ScallopOptionBase

Inherited from AnyRef

Inherited from Any

Ungrouped