public final class DataUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <X extends Number,Y extends Number> |
binarySearch(ChartData<X,Y> data,
double x)
Searches the specified
ChartData for the data point with specified X coordinate using the binary search
algorithm. |
static <X extends Number,Y extends Number> |
insertionIndex(ChartData<X,Y> data,
double x)
Returns insertion index of specified X coordinate within given chart data.
|
public static <X extends Number,Y extends Number> int insertionIndex(ChartData<X,Y> data, double x)
X
- X value typeY
- Y value typedata
- the searched datax
- X coordinate whose insertion index should be returnedpublic static <X extends Number,Y extends Number> int binarySearch(ChartData<X,Y> data, double x)
ChartData
for the data point with specified X coordinate using the binary search
algorithm. Points in the given ChartData
must be sorted. This method is an equivalent of
Arrays.binarySearch(double[], double)
but dedicated to ChartData
.X
- X value typeY
- Y value typedata
- the searched datax
- X coordinate whose index should be returnedArrays.binarySearch(double[], double)
Copyright © 2019 CERN. All rights reserved.