Class NaNTransformers.ExcludeNaNTransformer
- java.lang.Object
-
- org.apache.commons.statistics.descriptive.NaNTransformers.ExcludeNaNTransformer
-
- All Implemented Interfaces:
NaNTransformer
- Enclosing class:
- NaNTransformers
private static final class NaNTransformers.ExcludeNaNTransformer extends java.lang.Object implements NaNTransformer
A transformer that movesNaNto the upper end of the array.
-
-
Field Summary
Fields Modifier and Type Field Description private booleancopySet totrueto use a copy of the data.
-
Constructor Summary
Constructors Constructor Description ExcludeNaNTransformer(boolean copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]apply(double[] data, int from, int to, int[] bounds)Pre-process the data for partitioning.
-
-
-
Method Detail
-
apply
public double[] apply(double[] data, int from, int to, int[] bounds)Description copied from interface:NaNTransformerPre-process the data for partitioning.This method will scan all the data and apply processing to
NaNvalues.The method will return:
- An array to partition; this may be a copy.
- The
boundsof the returned data as [start, end); this can be smaller than the input range if the transformer is configured to exclude NaN values. The start is inclusive and the end is exclusive.
Implementations may assume the input
[from, to)range is valid given the length of thedataarray.- Specified by:
applyin interfaceNaNTransformer- Parameters:
data- Data.from- Inclusive start of the range.to- Exclusive end of the range.bounds- Set to [start, end).- Returns:
- pre-processed data (may be a copy)
-
-