Class NaNTransformers

java.lang.Object
org.apache.commons.statistics.descriptive.NaNTransformers

final class NaNTransformers extends Object
Support for creating NaNTransformer implementations.
  • Constructor Details

    • NaNTransformers

      private NaNTransformers()
      No instances.
  • Method Details

    • createNaNTransformer

      static NaNTransformer createNaNTransformer(NaNPolicy nanPolicy, boolean copy)
      Creates a NaNTransformer based on the nanPolicy and data copy policy.

      The transformer is thread-safe.

      Parameters:
      nanPolicy - NaN policy.
      copy - Set to true to use a copy of the data.
      Returns:
      the transformer
    • copy

      static double[] copy(double[] data, int from, int to)
      Copy the specified range of data.

      This is a simplification of

      invalid reference
      Arrays#copyOfRange(double[], int, int)
      and does not support range checks or padding of the original input to a longer output.
      Parameters:
      data - Values.
      from - Inclusive start of the range.
      to - Exclusive end of the range.
      Returns:
      the copy