All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.common.model.P2 Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
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 - 2024 Weber Informatics LLC | Privacy Policy