- Type Parameters:
X -
Y -
- All Implemented Interfaces:
- Comparable<ComparablePair<X,Y>>, Pair<X,Y>
public class ComparablePair<X extends Comparable<X>,Y extends Comparable<Y>>
extends Object
implements Pair<X,Y>, Comparable<ComparablePair<X,Y>>
A pair which implements comparable, using both components as comparable objects.
It allows you to define whether to compare x before y (slot 0 or 1), or vice versa.
This is useful in graphical mapping, where you may want to sort a map horizontally or vertically.
- Author:
- "James X. Nelson (james@wetheinter.net)"