22 lines
588 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: net/mindview/util/Tuple.java
// Tuple library using type argument inference.
package net.mindview.util;
public class Tuple {
public static <A,B> TwoTuple<A,B> tuple(A a, B b) {
2015-05-05 11:20:13 -07:00
return new TwoTuple<>(a, b);
2015-04-20 15:36:01 -07:00
}
public static <A,B,C> ThreeTuple<A,B,C>
tuple(A a, B b, C c) {
2015-05-05 11:20:13 -07:00
return new ThreeTuple<>(a, b, c);
2015-04-20 15:36:01 -07:00
}
public static <A,B,C,D> FourTuple<A,B,C,D>
tuple(A a, B b, C c, D d) {
2015-05-05 11:20:13 -07:00
return new FourTuple<>(a, b, c, d);
2015-04-20 15:36:01 -07:00
}
public static <A,B,C,D,E>
FiveTuple<A,B,C,D,E> tuple(A a, B b, C c, D d, E e) {
2015-05-05 11:20:13 -07:00
return new FiveTuple<>(a, b, c, d, e);
2015-04-20 15:36:01 -07:00
}
} ///:~