-
- Type Parameters:
X
- Type of X values.Y
- Type of Y values.
- All Known Implementing Classes:
RamerDouglasPeuckerDataReducer
public interface DataReducer<X,Y>
Defines the behavior of the algorithms used to reduce number of data points to the desired amount.- Author:
- claudio.rosati@esss.se
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_POINTS_COUNT
Default number of target points: 1000.static int
MIN_TARGET_POINTS_COUNT
The minimum number of target points: 2.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<XYChart.Data<X,Y>>
reduce(List<XYChart.Data<X,Y>> data, int targetPointsCount)
Reduces the number of the givendata
points to the specifiedtargetPointsCount
, if it is smaller than the data size.
-
-
-
Field Detail
-
DEFAULT_POINTS_COUNT
static final int DEFAULT_POINTS_COUNT
Default number of target points: 1000.- See Also:
- Constant Field Values
-
MIN_TARGET_POINTS_COUNT
static final int MIN_TARGET_POINTS_COUNT
The minimum number of target points: 2.- See Also:
- Constant Field Values
-
-
Method Detail
-
reduce
List<XYChart.Data<X,Y>> reduce(List<XYChart.Data<X,Y>> data, int targetPointsCount) throws NullPointerException, IllegalArgumentException
Reduces the number of the givendata
points to the specifiedtargetPointsCount
, if it is smaller than the data size.- Parameters:
data
-List
of data points to be reduced.targetPointsCount
- The desired number of target points, not smaller thanMIN_TARGET_POINTS_COUNT
.- Returns:
- A
List
containing reduced data, or the originaldata
list if its size is greater or equal totargetPointsCount
. - Throws:
NullPointerException
- Ifdata
isnull
.IllegalArgumentException
- IftargetPointsCount
is less thanMIN_TARGET_POINTS_COUNT
.
-
-