abstract
class
JavaPartialFunction[A, B] extends AbstractPartialFunction[A, B]
Instance Constructors
-
new
JavaPartialFunction()
Abstract Value Members
-
abstract
def
apply(x: A, isCheck: Boolean): B
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
def
+(other: String): String
-
-
final
def
==(arg0: Any): Boolean
-
def
andThen[C](k: (B) ⇒ C): PartialFunction[A, C]
-
final
def
apply(x: A): B
-
final
def
applyOrElse[A1 <: A, B1 >: B](x: A1, default: (A1) ⇒ B1): B1
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
def
compose[A](g: (A) ⇒ A): (A) ⇒ B
-
-
-
-
-
-
-
def
formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isDefinedAt(x: A): Boolean
-
final
def
isInstanceOf[T0]: Boolean
-
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
-
def
runWith[U](action: (B) ⇒ U): (A) ⇒ Boolean
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
Deprecated Value Members
-
def
finalize(): Unit
Helper for implementing a *pure* partial function: it will possibly be invoked multiple times for a single “application”, because its only abstract method is used for both isDefinedAt() and apply(); the former is mapped to
isCheck == true
and the latter toisCheck == false
for those cases where this is important to know.Failure to match is signaled by throwing
noMatch()
, i.e. not returning normally (the exception used in this case is pre-allocated, hence not that expensive).The typical use of partial functions from Akka looks like the following:
if (pf.isDefinedAt(x)) { pf.apply(x); }
i.e. it will first call
JavaPartialFunction.apply(x, true)
and if that does not thrownoMatch()
it will continue with callingJavaPartialFunction.apply(x, false)
.