Scala Library
|
|
scala/PartialFunction.scala
]
trait
PartialFunction[-A, +B]
extends
(A) => BPartialFunction[A, B]
is a
unary function where the domain does not include all values of type
A
. The function isDefinedAt
allows to
test dynamically, if a value is in the domain of the function.Method Summary | |
override def
|
andThen
[C](k : (B) => C) : PartialFunction[A, C]
(f andThen g)(x) == g(f(x))
|
abstract def
|
isDefinedAt
(x : A) : Boolean
Checks if a value is contained in the functions domain.
|
def
|
orElse [A1 <: A, B1 >: B](that : PartialFunction[A1, B1]) : PartialFunction[A1, B1] |
Methods inherited from Function1 | |
apply (abstract), toString, compose |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
x -
the value to testx
is in the domain of this function.
def
orElse[A1 <: A, B1 >: B](that : PartialFunction[A1, B1]) : PartialFunction[A1, B1]
override
def
andThen[C](k : (B) => C) : PartialFunction[A, C]
Scala Library
|
|