Class 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 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 interface OrderedPairs
        Returns:
        the abscissae
      • y

        public double[] y()
        Description copied from interface: OrderedPairs
        Get the ordinates.
        Specified by:
        y in interface OrderedPairs
        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 interface OrderedPairs
        Returns:
        the number of points