Class/Object

scala.scalajs.js

UndefOrOps

Related Docs: object UndefOrOps | package js

Permalink

final class UndefOrOps[A] extends AnyVal

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. UndefOrOps
  2. AnyVal
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new UndefOrOps(self: UndefOr[A])

    Permalink

Value Members

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

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

    Permalink
    Definition Classes
    Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from UndefOrOps[A] to any2stringadd[UndefOrOps[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (UndefOrOps[A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from UndefOrOps[A] to ArrowAssoc[UndefOrOps[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: scala.Any): Boolean

    Permalink
    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. final def collect[B](pf: PartialFunction[A, B]): UndefOr[B]

    Permalink

    Returns the result of applying pf to this UndefOr's contained value, if this option is nonempty and pf is defined for that value.

    Returns the result of applying pf to this UndefOr's contained value, if this option is nonempty and pf is defined for that value. Returns undefined otherwise.

    pf

    the partial function.

    returns

    the result of applying pf to this UndefOr's value (if possible), or undefined.

    Annotations
    @inline()
  8. final def contains[A1 >: A](elem: A1): Boolean

    Permalink

    Tests whether the UndefOr contains a given value as an element.

    Tests whether the UndefOr contains a given value as an element.

    x.contains(y) differs from x == y only in the fact that it will return false when x and y are both undefined.

    elem

    the element to test.

    returns

    true if the UndefOr has an element that is equal (as determined by ==) to elem, false otherwise.

    Annotations
    @inline()
  9. def ensuring(cond: (UndefOrOps[A]) ⇒ Boolean, msg: ⇒ scala.Any): UndefOrOps[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from UndefOrOps[A] to Ensuring[UndefOrOps[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (UndefOrOps[A]) ⇒ Boolean): UndefOrOps[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from UndefOrOps[A] to Ensuring[UndefOrOps[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: ⇒ scala.Any): UndefOrOps[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from UndefOrOps[A] to Ensuring[UndefOrOps[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): UndefOrOps[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from UndefOrOps[A] to Ensuring[UndefOrOps[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def exists(p: (A) ⇒ Boolean): Boolean

    Permalink

    Returns true if this option is nonempty and the predicate p returns true when applied to this UndefOr's value.

    Returns true if this option is nonempty and the predicate p returns true when applied to this UndefOr's value. Otherwise, returns false.

    p

    the predicate to test

    Annotations
    @inline()
  14. final def filter(p: (A) ⇒ Boolean): UndefOr[A]

    Permalink

    Returns this UndefOr if it is nonempty and applying the predicate p to this UndefOr's value returns true.

    Returns this UndefOr if it is nonempty and applying the predicate p to this UndefOr's value returns true. Otherwise, return undefined.

    p

    the predicate used for testing.

    Annotations
    @inline()
  15. final def filterNot(p: (A) ⇒ Boolean): UndefOr[A]

    Permalink

    Returns this UndefOr if it is nonempty and applying the predicate p to this UndefOr's value returns false.

    Returns this UndefOr if it is nonempty and applying the predicate p to this UndefOr's value returns false. Otherwise, return undefined.

    p

    the predicate used for testing.

    Annotations
    @inline()
  16. final def flatMap[B](f: (A) ⇒ UndefOr[B]): UndefOr[B]

    Permalink

    Returns the result of applying f to this UndefOr's value if this UndefOr is nonempty.

    Returns the result of applying f to this UndefOr's value if this UndefOr is nonempty. Returns undefined if this UndefOr is empty. Slightly different from map in that f is expected to return an UndefOr (which could be undefined).

    f

    the function to apply

    Annotations
    @inline()
    See also

    foreach

    map

  17. def flatten[B](implicit ev: <:<[A, UndefOr[B]]): UndefOr[B]

    Permalink
  18. final def fold[B](ifEmpty: ⇒ B)(f: (A) ⇒ B): B

    Permalink

    Returns the result of applying f to this UndefOr's value if the UndefOr is nonempty.

    Returns the result of applying f to this UndefOr's value if the UndefOr is nonempty. Otherwise, evaluates expression ifEmpty.

    ifEmpty

    the expression to evaluate if empty.

    f

    the function to apply if nonempty.

    Annotations
    @inline()
    Note

    This is equivalent to UndefOr map f getOrElse ifEmpty.

  19. final def forall(p: (A) ⇒ Boolean): Boolean

    Permalink

    Returns true if this option is empty or the predicate p returns true when applied to this UndefOr's value.

    Returns true if this option is empty or the predicate p returns true when applied to this UndefOr's value.

    p

    the predicate to test

    Annotations
    @inline()
  20. final def foreach[U](f: (A) ⇒ U): Unit

    Permalink

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

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

    f

    the procedure to apply.

    Annotations
    @inline()
    See also

    flatMap

    map

  21. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from UndefOrOps[A] to StringFormat[UndefOrOps[A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  22. final def get: A

    Permalink

    Returns the option's value.

    Returns the option's value.

    Annotations
    @inline()
    Exceptions thrown

    java.util.NoSuchElementException if the option is empty.

    Note

    The option must be nonEmpty.

  23. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  24. final def getOrElse[B >: A](default: ⇒ B): B

    Permalink

    Returns the option's value if the option is nonempty, otherwise return the result of evaluating default.

    Returns the option's value if the option is nonempty, otherwise return the result of evaluating default.

    default

    the default expression.

    Annotations
    @inline()
  25. final def isDefined: Boolean

    Permalink

    Returns true if the option is not undefined, false otherwise.

    Returns true if the option is not undefined, false otherwise.

    Annotations
    @inline()
  26. final def isEmpty: Boolean

    Permalink

    Returns true if the option is undefined, false otherwise.

    Returns true if the option is undefined, false otherwise.

    Annotations
    @inline()
  27. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  28. def iterator: collection.Iterator[A]

    Permalink

    Returns a singleton iterator returning the UndefOr's value if it is nonempty, or an empty iterator if the option is empty.

  29. final def map[B](f: (A) ⇒ B): UndefOr[B]

    Permalink

    Returns the result of applying f to this UndefOr's value if this UndefOr is nonempty.

    Returns the result of applying f to this UndefOr's value if this UndefOr is nonempty. Otherwise return undefined.

    f

    the function to apply

    Annotations
    @inline()
    Note

    This is similar to flatMap except here, f does not need to wrap its result in an UndefOr.

    See also

    foreach

    flatMap

  30. final def nonEmpty: Boolean

    Permalink

    Returns false if the option is undefined, true otherwise.

    Returns false if the option is undefined, true otherwise.

    Note

    Implemented here to avoid the implicit conversion to Iterable.

  31. final def orElse[B >: A](alternative: ⇒ UndefOr[B]): UndefOr[B]

    Permalink

    Returns this UndefOr if it is nonempty, otherwise return the result of evaluating alternative.

    Returns this UndefOr if it is nonempty, otherwise return the result of evaluating alternative.

    alternative

    the alternative expression.

    Annotations
    @inline()
  32. final def orNull[A1 >: A](implicit ev: <:<[Null, A1]): A1

    Permalink

    Returns the option's value if it is nonempty, or null if it is empty.

    Returns the option's value if it is nonempty, or null if it is empty. Although the use of null is discouraged, code written to use UndefOr must often interface with code that expects and returns nulls.

    Annotations
    @inline()
    Example:
    1. val initalText: Option[String] = getInitialText
      val textField = new JComponent(initalText.orNull,20)
  33. val self: UndefOr[A]

    Permalink
  34. final def toLeft[X](right: ⇒ X): Either[A, X]

    Permalink

    Returns a Right containing the given argument right if this is empty, or a Left containing this UndefOr's value if this UndefOr is nonempty.

    Returns a Right containing the given argument right if this is empty, or a Left containing this UndefOr's value if this UndefOr is nonempty.

    right

    the expression to evaluate and return if this is empty

    Annotations
    @inline()
    See also

    toRight

  35. def toList: List[A]

    Permalink

    Returns a singleton list containing the UndefOr's value if it is nonempty, or the empty list if the UndefOr is empty.

  36. final def toOption: Option[A]

    Permalink

    Returns a Some containing this UndefOr's value if this UndefOr is nonempty, None otherwise.

    Returns a Some containing this UndefOr's value if this UndefOr is nonempty, None otherwise.

    Annotations
    @inline()
  37. final def toRight[X](left: ⇒ X): Either[X, A]

    Permalink

    Returns a Left containing the given argument left if this UndefOr is empty, or a Right containing this UndefOr's value if this is nonempty.

    Returns a Left containing the given argument left if this UndefOr is empty, or a Right containing this UndefOr's value if this is nonempty.

    left

    the expression to evaluate and return if this is empty

    Annotations
    @inline()
    See also

    toLeft

  38. def toString(): String

    Permalink
    Definition Classes
    Any
  39. final def withFilter(p: (A) ⇒ Boolean): WithFilter[A]

    Permalink

    Necessary to keep UndefOr from being implicitly converted to scala.collection.Iterable in for comprehensions.

    Necessary to keep UndefOr from being implicitly converted to scala.collection.Iterable in for comprehensions.

    Annotations
    @inline()
  40. def [B](y: B): (UndefOrOps[A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from UndefOrOps[A] to ArrowAssoc[UndefOrOps[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyVal

Inherited from scala.Any

Inherited by implicit conversion any2stringadd from UndefOrOps[A] to any2stringadd[UndefOrOps[A]]

Inherited by implicit conversion StringFormat from UndefOrOps[A] to StringFormat[UndefOrOps[A]]

Inherited by implicit conversion Ensuring from UndefOrOps[A] to Ensuring[UndefOrOps[A]]

Inherited by implicit conversion ArrowAssoc from UndefOrOps[A] to ArrowAssoc[UndefOrOps[A]]

Ungrouped