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 Pairget(int i)Get the ordered pair at index i.intsize()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:OrderedPairsGet the abscissae.- Specified by:
xin interfaceOrderedPairs- Returns:
- the abscissae
-
y
public double[] y()
Description copied from interface:OrderedPairsGet the ordinates.- Specified by:
yin 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:OrderedPairsGet the number of points.- Specified by:
sizein interfaceOrderedPairs- Returns:
- the number of points
-
-