Class ThreeWayDataUtils


  • public class ThreeWayDataUtils
    extends adams.data.container.DataContainerUtils
    Utility class for ThreeWayData objects.
    Version:
    $Revision: 4198 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Field Detail

      • m_Comparator

        protected static L1PointComparator m_Comparator
        comparator for finding timestamps.
    • Constructor Detail

      • ThreeWayDataUtils

        public ThreeWayDataUtils()
    • Method Detail

      • getComparator

        public static L1PointComparator getComparator()
        Returns the comparator used for finding timestamps.
        Returns:
        the comparator
      • getHeader

        protected static ThreeWayData getHeader​(List<L1Point> points)
        Creates a header based on the given LevelOnePoint points.
        Parameters:
        points - the LevelOnePoint points to create the header for
        Returns:
        the generated header
      • findXY

        public static int findXY​(List<L1Point> points,
                                 L1Point p)
        Returns the index in points of the given LevelOnePoint point, -1 if not found.
        Parameters:
        points - the vector of LevelOnePoint points to search in
        p - the point to get the index for
        Returns:
        the index or -1 if not found
      • findXY

        public static int findXY​(List<L1Point> points,
                                 double x,
                                 double y)
        Returns the index in points of the given timestamp.
        Parameters:
        points - the vector of LevelOnePoint points to search in
        x - the X to get the index for
        Returns:
        the index
      • findClosestXY

        public static int findClosestXY​(List<L1Point> points,
                                        double x,
                                        double y)
        Returns the index in points closest to the given timestamp.
        Parameters:
        points - the list of LevelOnePoint points to search in
        x - the X to get the closest index for
        y - the Y to get the closest index for
        Returns:
        the index
      • findXY

        public static int findXY​(List<L1Point> points,
                                 double x,
                                 double y,
                                 boolean less)
        Locates the X for the given X.
        Parameters:
        points - the LevelOnePoint points to search
        x - the X to locate
        less - if no exact match possible, whether to return the next smaller (= true) or next larger (= false) timestamp
        Returns:
        the index of the LevelOnePoint point, -1 if not found