Class 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 Detail

      • hashCode

        public abstract int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.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.