Copyright Tony Morris 2008

This software is released under an open source BSD licence.

fj
Class P3<A,B,C>

java.lang.Object
  extended by fj.P3<A,B,C>

public abstract class P3<A,B,C>
extends Object

A product-3.

Version:
2.19

Constructor Summary
P3()
           
 
Method Summary
static
<A,B,C> F<P3<A,B,C>,A>
__1()
          Returns a function that returns the first element of a product.
static
<A,B,C> F<P3<A,B,C>,B>
__2()
          Returns a function that returns the second element of a product.
static
<A,B,C> F<P3<A,B,C>,C>
__3()
          Returns a function that returns the third element of a product.
abstract  A _1()
          Access the first element of the product.
abstract  B _2()
          Access the second element of the product.
abstract  C _3()
          Access the third element of the product.
<X> P3<X,B,C>
map1(F<A,X> f)
          Map the first element of the product.
<X> P3<A,X,C>
map2(F<B,X> f)
          Map the second element of the product.
<X> P3<A,B,X>
map3(F<C,X> f)
          Map the third element of the product.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

P3

public P3()
Method Detail

_1

public abstract A _1()
Access the first element of the product.

Returns:
The first element of the product.

_2

public abstract B _2()
Access the second element of the product.

Returns:
The second element of the product.

_3

public abstract C _3()
Access the third element of the product.

Returns:
The third element of the product.

map1

public <X> P3<X,B,C> map1(F<A,X> f)
Map the first element of the product.

Parameters:
f - The function to map with.
Returns:
A product with the given function applied.

map2

public <X> P3<A,X,C> map2(F<B,X> f)
Map the second element of the product.

Parameters:
f - The function to map with.
Returns:
A product with the given function applied.

map3

public <X> P3<A,B,X> map3(F<C,X> f)
Map the third element of the product.

Parameters:
f - The function to map with.
Returns:
A product with the given function applied.

__1

public static <A,B,C> F<P3<A,B,C>,A> __1()
Returns a function that returns the first element of a product.

Returns:
A function that returns the first element of a product.

__2

public static <A,B,C> F<P3<A,B,C>,B> __2()
Returns a function that returns the second element of a product.

Returns:
A function that returns the second element of a product.

__3

public static <A,B,C> F<P3<A,B,C>,C> __3()
Returns a function that returns the third element of a product.

Returns:
A function that returns the third element of a product.

Copyright Tony Morris 2008

This software is released under an open source BSD licence.