|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object akka.japi.pf.Match<I,R>
I
- the input type, that this PartialFunction will be applied toR
- the return type, that the results of the application will havepublic class Match<I,R>
Version of PartialFunction
that can be built during
runtime from Java.
Field Summary | |
---|---|
protected scala.PartialFunction<I,R> |
statements
|
Method Summary | ||
---|---|---|
scala.PartialFunction<I,R> |
asPF()
Turn this Match into a PartialFunction . |
|
static
|
create(PFBuilder<F,T> builder)
Create a Match from the builder. |
|
static
|
match(java.lang.Class<P> type,
FI.Apply<P,T> apply)
Convenience function to create a PFBuilder with the first
case statement added. |
|
static
|
match(java.lang.Class<P> type,
FI.TypedPredicate<P> predicate,
FI.Apply<P,T> apply)
Convenience function to create a PFBuilder with the first
case statement added. |
|
R |
match(I i)
Convenience function to make the Java code more readable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final scala.PartialFunction<I,R> statements
Method Detail |
---|
public static final <F,T,P> PFBuilder<F,T> match(java.lang.Class<P> type, FI.Apply<P,T> apply)
PFBuilder
with the first
case statement added.
type
- a type to match the argument againstapply
- an action to apply to the argument if the type matches
PFBuilder.match(Class, FI.Apply)
public static <F,T,P> PFBuilder<F,T> match(java.lang.Class<P> type, FI.TypedPredicate<P> predicate, FI.Apply<P,T> apply)
PFBuilder
with the first
case statement added.
type
- a type to match the argument againstpredicate
- a predicate that will be evaluated on the argument if the type matchesapply
- an action to apply to the argument if the type matches
PFBuilder.match(Class, FI.TypedPredicate, FI.Apply)
public static final <F,T> Match<F,T> create(PFBuilder<F,T> builder)
Match
from the builder.
builder
- a builder representing the partial function
Match
that can be reusedpublic R match(I i) throws scala.MatchError
Matcher<X, Y> matcher = Matcher.create(...);
Y someY = matcher.match(obj);
i
- the argument to apply the match to
scala.MatchError
- if there is no matchpublic scala.PartialFunction<I,R> asPF()
Match
into a PartialFunction
.
Match
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |