Package dev.nm.analysis.function.tuple
Class Pair
- java.lang.Object
-
- dev.nm.analysis.function.tuple.Pair
-
- All Implemented Interfaces:
Comparable<Pair>
public class Pair extends Object implements Comparable<Pair>
An ordered pair (x,y) is a pair of mathematical objects. In the ordered pair (x,y), the object a is called the first entry, and the object b the second entry of the pair. Alternatively, the objects are called the first and second coordinates, or the left and right projections of the ordered pair. The order in which the objects appear in the pair is significant: the ordered pair (x,y) is different from the ordered pair (y,x) unless x = y. This class is immutable.
-
-
Constructor Summary
Constructors Constructor Description Pair(double x, double y)
Construct a pair.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Pair that)
boolean
equals(Object obj)
int
hashCode()
double
x()
xdouble
y()
y
-
-
-
Method Detail
-
x
public double x()
x- Returns:
- x
-
y
public double y()
y- Returns:
- y
-
compareTo
public int compareTo(Pair that)
- Specified by:
compareTo
in interfaceComparable<Pair>
-
-