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
Learn more about member selection
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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val _transformCount: Int

    Count of .

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

  7. def apply(): A

    Retreive the underlying value.

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

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. 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

  11. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  13. 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

  14. 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

  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. 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.

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

  18. def foreach(f: (A) ⇒ Unit): Unit

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

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

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

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

  21. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  22. 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.

  23. 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.

  24. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  25. def isSupplied: Boolean

    Tests whether the underlying value was explicitly supplied by user.

  26. 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

  27. def name: String

    Name for the option

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

    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  31. 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

  32. lazy val supplied: Boolean

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

    Definition Classes
    AnyRef
  34. def toOption: Option[A]

    Retreive the underlying value as a scala Option

  35. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. 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