-
- 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 intDEFAULT_POINTS_COUNTDefault number of target points: 1000.static intMIN_TARGET_POINTS_COUNTThe 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 givendatapoints 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 givendatapoints to the specifiedtargetPointsCount, if it is smaller than the data size.- Parameters:
data-Listof data points to be reduced.targetPointsCount- The desired number of target points, not smaller thanMIN_TARGET_POINTS_COUNT.- Returns:
- A
Listcontaining reduced data, or the originaldatalist if its size is greater or equal totargetPointsCount. - Throws:
NullPointerException- Ifdataisnull.IllegalArgumentException- IftargetPointsCountis less thanMIN_TARGET_POINTS_COUNT.
-
-