package japi
- Alphabetic
- Public
- All
Type Members
-
trait
Creator
[T] extends Serializable
A constructor/factory, takes no parameters but creates a new value of type T every call.
A constructor/factory, takes no parameters but creates a new value of type T every call.
- Annotations
- @SerialVersionUID()
-
trait
Effect
extends AnyRef
An executable piece of code that takes no parameters and doesn't return any value.
-
trait
Function
[T, R] extends AnyRef
A Function interface.
A Function interface. Used to create first-class-functions is Java.
-
trait
Function2
[T1, T2, R] extends AnyRef
A Function interface.
A Function interface. Used to create 2-arg first-class-functions is Java.
- class JAPI extends AnyRef
-
abstract
class
JavaPartialFunction
[A, B] extends AbstractPartialFunction[A, B]
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.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).new JavaPartialFunction<Object, String>() { public String apply(Object in, boolean isCheck) { if (in instanceof TheThing) { if (isCheck) return null; // to spare the expensive or side-effecting code return doSomethingWithTheThing((TheThing) in); } else { throw noMatch(); } } }
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)
. -
sealed abstract
class
Option
[A] extends Iterable[A]
This class represents optional values.
This class represents optional values. Instances of
Option
are either instances of case classSome
or it is case objectNone
. -
case class
Pair
[A, B](first: A, second: B) extends Product with Serializable
Java API Represents a pair (tuple) of two elements.
Java API Represents a pair (tuple) of two elements.
Additional tuple types for 3 to 22 values are defined in the
akka.japi.tuple
package, e.g. akka.japi.tuple.Tuple3.- Annotations
- @SerialVersionUID()
-
trait
Predicate
[T] extends AnyRef
Java API: Defines a criteria and determines whether the parameter meets this criteria.
-
trait
Procedure
[T] extends AnyRef
A Procedure is like a Function, but it doesn't produce a return value.
Value Members
- object JavaPartialFunction
- object Option
- object Pair extends Serializable
-
object
Util
This class hold common utilities for Java