org.opentripplanner.common.model.P2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.common.model;
/**
* An ordered pair of objects of the same type
*
* @param
*/
public class P2 extends T2 {
private static final long serialVersionUID = 1L;
public static P2 createPair(E first, E second) {
return new P2(first, second);
}
public P2(E first, E second) {
super(first, second);
}
public P2(E[] entries) {
super(entries[0], entries[1]);
if (entries.length != 2) {
throw new IllegalArgumentException("This only takes arrays of 2 arguments");
}
}
public String toString() {
return "P2(" + first + ", " + second + ")";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy