Class Either<A,B>
- java.lang.Object
-
- org.intermine.webservice.server.core.Either<A,B>
-
- Type Parameters:
A
- The type of Lefts.B
- The type of Rights.
- Direct Known Subclasses:
Either.Left
,Either.Right
public abstract class Either<A,B> extends java.lang.Object
Disjoint type union
Disjoint type union to handle certain features of the way we present results in outer-joined tables, but abstracted to be made more generally useful, and incorportating the visitor pattern for value access.
Obviously the terminology is taken from the worlds of functional programming (Haskell, Scala, et al.).
- Author:
- Alex Kalderimis.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Either.Left<A,B>
static class
Either.Right<A,B>
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <T> T
accept(EitherVisitor<A,B,T> visitor)
How you go about accessing the values.boolean
equals(java.lang.Object obj)
abstract int
hashCode()
-
-
-
Method Detail
-
hashCode
public abstract int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
accept
public abstract <T> T accept(EitherVisitor<A,B,T> visitor)
How you go about accessing the values.- Type Parameters:
T
- The return type.- Parameters:
visitor
- The mapping function.- Returns:
- Whatever the mapping function returns.
-
-