|
|||||||||
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 have
This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.public 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. |
|
static
|
matchAny(FI.Apply<java.lang.Object,T> apply)
Convenience function to create a PFBuilder with the first
case statement added. |
|
static
|
matchEquals(P object,
FI.Apply<P,T> apply)
Convenience function to create a PFBuilder with the first
case statement added. |
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 <F,T,P> PFBuilder<F,T> matchEquals(P object, FI.Apply<P,T> apply)
PFBuilder
with the first
case statement added.
object
- the object to compare equals withapply
- an action to apply to the argument if the object compares equal
PFBuilder.matchEquals(Object, FI.Apply)
public static <F,T> PFBuilder<F,T> matchAny(FI.Apply<java.lang.Object,T> apply)
PFBuilder
with the first
case statement added.
apply
- an action to apply to the argument
PFBuilder.matchAny(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 |