Class SpreadSheetRowUtils


  • public class SpreadSheetRowUtils
    extends DataContainerUtils
    Utility class for rows.
    Version:
    $Revision: 4605 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • SpreadSheetRowUtils

        public SpreadSheetRowUtils()
    • Method Detail

      • getComparator

        public static SpreadSheetRowPointComparator getComparator()
        Returns the comparator used for finding X values.
        Returns:
        the comparator
      • findX

        public static int findX​(List<SpreadSheetRowPoint> points,
                                SpreadSheetRowPoint p)
        Returns the index in m_Points of the given sequence point.
        Parameters:
        points - the data to process
        p - the point to get the index for
        Returns:
        the index
      • findX

        public static int findX​(List<SpreadSheetRowPoint> points,
                                int x)
        Returns the index in m_Points of the given x value.
        Parameters:
        points - the data to process
        x - the x value to get the index for
        Returns:
        the index
      • findClosestX

        public static int findClosestX​(List<SpreadSheetRowPoint> points,
                                       int x)
        Returns the index in m_Points closest to the given x value.
        Parameters:
        points - the data to process
        x - the x value to get the closest index for
        Returns:
        the index
      • findEnclosingXs

        public static int[] findEnclosingXs​(List<SpreadSheetRowPoint> points,
                                            int x)
        Returns the indices of points in m_Points that enclose the given x value. If the given x value happens to be an exact point, then this points will be stored at index 0. If no index could be determined, then -1 will be stored.
        Parameters:
        points - the data to process
        x - the x value to get the enclosing indices for
        Returns:
        the indices
      • toDoubleArray

        public static double[] toDoubleArray​(SpreadSheetRow r)
        Returns the points as double array.
        Parameters:
        r - the row to turn into a double array
        Returns:
        the points as double array
      • toDoubleArray

        public static double[] toDoubleArray​(List<SpreadSheetRowPoint> data)
        Returns the points as double array.
        Parameters:
        data - the row points to turn into a double array
        Returns:
        the points as double array