jfun.parsec

Class Tuples

public class Tuples extends Object

This class is the facade to create various tuple java beans.

Since: version 1.1

Author: Ben Yu Apr 25, 2006 9:28:23 AM

Method Summary
static <A,B> Pair<A,B>pair(A a, B b)
Create a Pair object.
static <A,B,C> Tuple3<A,B,C>tuple(A a, B b, C c)
Create a 3-object tuple.
static <A,B,C,D> Tuple4<A,B,C,D>tuple(A a, B b, C c, D d)
Create a 4-object tuple.
static <A,B,C,D,E> Tuple5<A,B,C,D,E>tuple(A a, B b, C c, D d, E e)
Create a 5-object tuple.

Method Detail

pair

public static <A,B> Pair<A,B> pair(A a, B b)
Create a Pair object.

Parameters: a the first object. b the 2nd object.

Returns: the Pair object.

tuple

public static <A,B,C> Tuple3<A,B,C> tuple(A a, B b, C c)
Create a 3-object tuple.

Parameters: a the 1st object. b the 2nd object. c the 3rd object.

Returns: the tuple.

tuple

public static <A,B,C,D> Tuple4<A,B,C,D> tuple(A a, B b, C c, D d)
Create a 4-object tuple.

Parameters: a the 1st object. b the 2nd object. c the 3rd object. d the 4th object.

Returns: the tuple.

tuple

public static <A,B,C,D,E> Tuple5<A,B,C,D,E> tuple(A a, B b, C c, D d, E e)
Create a 5-object tuple.

Parameters: a the 1st object. b the 2nd object. c the 3rd object. d the 4th object. e the 5th object.

Returns: the tuple.