1 package net.sf.openrocket.util;
4 * Sortable storage of a pair of objects. A list of these objects can be sorted according
7 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
8 * @param <U> the first object type, according to which comparisons are performed.
9 * @param <V> the second object type.
11 public class ComparablePair<U extends Comparable<U>, V> extends Pair<U, V>
12 implements Comparable<ComparablePair<U, V>>{
14 public ComparablePair(U u, V v) {
20 * Compares the first objects. If either of the objects is <code>null</code> this
21 * method throws <code>NullPointerException</code>.
24 public int compareTo(ComparablePair<U, V> other) {
25 return this.getU().compareTo(other.getU());