Package adams.data.threeway
Class ThreeWayDataUtils
- java.lang.Object
-
- adams.data.container.DataContainerUtils
-
- adams.data.threeway.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 Summary
Fields Modifier and Type Field Description protected static L1PointComparator
m_Comparator
comparator for finding timestamps.
-
Constructor Summary
Constructors Constructor Description ThreeWayDataUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
findClosestXY(List<L1Point> points, double x, double y)
Returns the index in points closest to the given timestamp.static int
findXY(List<L1Point> points, double x, double y)
Returns the index in points of the given timestamp.static int
findXY(List<L1Point> points, double x, double y, boolean less)
Locates the X for the given X.static int
findXY(List<L1Point> points, L1Point p)
Returns the index in points of the given LevelOnePoint point, -1 if not found.static L1PointComparator
getComparator()
Returns the comparator used for finding timestamps.protected static ThreeWayData
getHeader(List<L1Point> points)
Creates a header based on the given LevelOnePoint points.
-
-
-
Field Detail
-
m_Comparator
protected static L1PointComparator m_Comparator
comparator for finding timestamps.
-
-
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 inp
- 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 inx
- 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 inx
- the X to get the closest index fory
- 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 searchx
- the X to locateless
- 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
-
-