|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.evolvedbinary.functional.Either<L,R>
L - Type of left-hand-side parameterR - Type of right-hand-side parameterpublic abstract class Either<L,R>
A disjunction, more basic than but similar to scala.util.Either
in addition it is also right-biased in a similar way to scalaz.\/
| Nested Class Summary | |
|---|---|
static class |
Either.Left<L,R>
|
class |
Either.LeftProjection<L,R>
|
static class |
Either.Right<L,R>
|
class |
Either.RightProjection<L,R>
|
| Method Summary | ||
|---|---|---|
boolean |
equals(Object obj)
|
|
|
flatMap(Function<R,Either<LL,T>> f)
Bind through on the right-hand-side of this disjunction |
|
|
fold(Function<L,T> lf,
Function<R,T> rf)
Catamorphism. |
|
boolean |
isLeft()
|
|
boolean |
isRight()
|
|
Either.LeftProjection<L,R> |
left()
|
|
static
|
Left(L value)
|
|
|
leftMap(Function<L,T> f)
Map on the left-hand-side of the disjunction |
|
|
map(Function<R,T> f)
Map on the right-hand-side of the disjunction |
|
Either.RightProjection<L,R> |
right()
|
|
static
|
Right(R value)
|
|
|
valueOr(Function<L,RR> lf)
Return the value from the right-hand-side of this disjunction or run the function on the left-hand-side |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public final boolean isLeft()
public final boolean isRight()
public final Either.LeftProjection<L,R> left()
public final Either.RightProjection<L,R> right()
public final <T> Either<L,T> map(Function<R,T> f)
f - The function to map withpublic final <LL extends L,T> Either<LL,T> flatMap(Function<R,Either<LL,T>> f)
f - the function to bind throughpublic final <T> Either<T,R> leftMap(Function<L,T> f)
f - The function to map with
public final <T> T fold(Function<L,T> lf,
Function<R,T> rf)
T - The result type from performing the foldlf - A function that may be applied to the left-hand-siderf - A function that may be applied to the right-hand-sidepublic final <RR extends R> RR valueOr(Function<L,RR> lf)
RR - The result typelf - A function that may be applied to the left-hand-sidepublic boolean equals(Object obj)
equals in class Objectpublic static final <L,R> Either<L,R> Left(L value)
public static final <L,R> Either<L,R> Right(R value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||