edu.pdx.cs.joy.lang.Tuple Maven / Gradle / Ivy
The newest version!
package edu.pdx.cs.joy.lang;
/**
* A tuple class that holds two generic values. Demonstrates how
* multiple values can be returned from a method in a type-safe manner
* using Java generics.
*
* @see TupleExample
*
* @author David Whitlock
* @since Summer 2005
*/
public final class Tuple {
private final A first;
private final B second;
public Tuple(A first, B second) {
this.first = first;
this.second = second;
}
public A getFirst() {
return this.first;
}
public B getSecond() {
return this.second;
}
}