Class SpreadSheetRowUtils
- java.lang.Object
-
- adams.data.container.DataContainerUtils
-
- adams.gui.visualization.spreadsheet.SpreadSheetRowUtils
-
public class SpreadSheetRowUtils extends DataContainerUtils
Utility class for rows.- Version:
- $Revision: 4605 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.data.container.DataContainerUtils
DataContainerUtils.GapFilling
-
-
Field Summary
Fields Modifier and Type Field Description protected static SpreadSheetRowPointComparator
m_Comparator
comparator for finding X values.
-
Constructor Summary
Constructors Constructor Description SpreadSheetRowUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
findClosestX(List<SpreadSheetRowPoint> points, int x)
Returns the index in m_Points closest to the given x value.static int[]
findEnclosingXs(List<SpreadSheetRowPoint> points, int x)
Returns the indices of points in m_Points that enclose the given x value.static int
findX(List<SpreadSheetRowPoint> points, int x)
Returns the index in m_Points of the given x value.static int
findX(List<SpreadSheetRowPoint> points, SpreadSheetRowPoint p)
Returns the index in m_Points of the given sequence point.static SpreadSheetRowPointComparator
getComparator()
Returns the comparator used for finding X values.static double[]
toDoubleArray(SpreadSheetRow r)
Returns the points as double array.static double[]
toDoubleArray(List<SpreadSheetRowPoint> data)
Returns the points as double array.
-
-
-
Field Detail
-
m_Comparator
protected static SpreadSheetRowPointComparator m_Comparator
comparator for finding X values.
-
-
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 processp
- 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 processx
- 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 processx
- 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 processx
- 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
-
-