Package dev.nm.analysis.function.tuple
Class SortedOrderedPairs
- java.lang.Object
-
- dev.nm.analysis.function.tuple.SortedOrderedPairs
-
- All Implemented Interfaces:
OrderedPairs
public class SortedOrderedPairs extends Object implements OrderedPairs
The ordered pairs are first sorted by abscissa, then by ordinate. Hence, this allows random access of the stored pairs.
-
-
Constructor Summary
Constructors Constructor Description SortedOrderedPairs(double[] x0, double[] y0)
SortedOrderedPairs(OrderedPairs pairs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pair
get(int i)
Get the ordered pair at index i.int
size()
Get the number of points.double[]
x()
Get the abscissae.double[]
y()
Get the ordinates.
-
-
-
Constructor Detail
-
SortedOrderedPairs
public SortedOrderedPairs(OrderedPairs pairs)
-
SortedOrderedPairs
public SortedOrderedPairs(double[] x0, double[] y0)
-
-
Method Detail
-
x
public double[] x()
Description copied from interface:OrderedPairs
Get the abscissae.- Specified by:
x
in interfaceOrderedPairs
- Returns:
- the abscissae
-
y
public double[] y()
Description copied from interface:OrderedPairs
Get the ordinates.- Specified by:
y
in interfaceOrderedPairs
- Returns:
- the ordinates
-
get
public Pair get(int i)
Get the ordered pair at index i.- Parameters:
i
- the index- Returns:
- the pair at index i
-
size
public int size()
Description copied from interface:OrderedPairs
Get the number of points.- Specified by:
size
in interfaceOrderedPairs
- Returns:
- the number of points
-
-