2015-09-07 11:44:36 -06:00
|
|
|
|
// com/mindviewinc/util/Tuple.java
|
2015-06-15 17:47:35 -07:00
|
|
|
|
// <20>2015 MindView LLC: see Copyright.txt
|
|
|
|
|
// Tuple library using type argument inference.
|
|
|
|
|
package com.mindviewinc.util;
|
|
|
|
|
|
|
|
|
|
public class Tuple {
|
2015-09-07 11:44:36 -06:00
|
|
|
|
public static <A, B> TwoTuple<A, B> tuple(A a, B b) {
|
2015-06-15 17:47:35 -07:00
|
|
|
|
return new TwoTuple<>(a, b);
|
|
|
|
|
}
|
2015-09-07 11:44:36 -06:00
|
|
|
|
public static <A, B, C> ThreeTuple<A, B, C>
|
2015-06-15 17:47:35 -07:00
|
|
|
|
tuple(A a, B b, C c) {
|
|
|
|
|
return new ThreeTuple<>(a, b, c);
|
|
|
|
|
}
|
2015-09-07 11:44:36 -06:00
|
|
|
|
public static <A, B, C, D> FourTuple<A, B, C, D>
|
2015-06-15 17:47:35 -07:00
|
|
|
|
tuple(A a, B b, C c, D d) {
|
|
|
|
|
return new FourTuple<>(a, b, c, d);
|
|
|
|
|
}
|
2015-09-07 11:44:36 -06: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-06-15 17:47:35 -07:00
|
|
|
|
return new FiveTuple<>(a, b, c, d, e);
|
|
|
|
|
}
|
2015-09-07 11:44:36 -06:00
|
|
|
|
}
|