scala

PartialFunction

trait PartialFunction[-A, +B] extends (A) ⇒ B

A partial function of type PartialFunction[A, B] is a unary function where the domain does not necessarily include all values of type A. The function isDefinedAt allows to test dynamically if a value is in the domain of the function.

go to: companion
known subclasses: Seq, MapLike, Reactions, Wrapper
source: PartialFunction.scala
    version
  1. 1.0, 16/07/2003

    authors:
  1. Martin Odersky

Inherited
  1. Hide All
  2. Show all
  1. Function1
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Value Members

  1. def !=(arg0: AnyRef): Boolean

  2. def !=(arg0: Any): Boolean

    o != arg0 is the same as !(o == (arg0)).

  3. def ##(): Int

  4. def $asInstanceOf[T0](): T0

  5. def $isInstanceOf[T0](): Boolean

  6. def ==(arg0: AnyRef): Boolean

    o == arg0 is the same as if (o eq null) arg0 eq null else o.equals(arg0).

  7. def ==(arg0: Any): Boolean

    o == arg0 is the same as o.equals(arg0).

  8. def andThen[C](k: (B) ⇒ C): PartialFunction[A, C]

    Composes this partial function with a transformation function that gets applied to results of this partial function.

  9. def apply(v1: A): B

  10. def asInstanceOf[T0]: T0

    This method is used to cast the receiver object to be of type T0.

  11. def clone(): AnyRef

    This method creates and returns a copy of the receiver object.

  12. def compose[A](g: (A) ⇒ A): (A) ⇒ B

    (f compose g)(x) == f(g(x))

  13. def eq(arg0: AnyRef): Boolean

    This method is used to test whether the argument (arg0) is a reference to the receiver object (this).

  14. def equals(arg0: Any): Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

  15. def finalize(): Unit

    This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object.

  16. def getClass(): java.lang.Class[_ <: java.lang.Object]

    Returns a representation that corresponds to the dynamic class of the receiver object.

  17. def hashCode(): Int

    Returns a hash code value for the object.

  18. def isDefinedAt(x: A): Boolean

    Checks if a value is contained in the function's domain.

  19. def isInstanceOf[T0]: Boolean

    This method is used to test whether the dynamic type of the receiver object is T0.

  20. def lift: (A) ⇒ Option[B]

    Turns this partial function into an plain function returning an Option result.

  21. def ne(arg0: AnyRef): Boolean

    o.ne(arg0) is the same as !(o.eq(arg0)).

  22. def notify(): Unit

    Wakes up a single thread that is waiting on the receiver object's monitor.

  23. def notifyAll(): Unit

    Wakes up all threads that are waiting on the receiver object's monitor.

  24. def orElse[A1 <: A, B1 >: B](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]

    Composes this partial function with a fallback partial function which gets applied where this partial function is not defined.

  25. def synchronized[T0](arg0: T0): T0

  26. def toString(): String

    Returns a string representation of the object.

  27. def wait(): Unit

  28. def wait(arg0: Long, arg1: Int): Unit

  29. def wait(arg0: Long): Unit