Class NaNTransformers.ExcludeNaNTransformer

  • All Implemented Interfaces:
    NaNTransformer
    Enclosing class:
    NaNTransformers

    private static final class NaNTransformers.ExcludeNaNTransformer
    extends java.lang.Object
    implements NaNTransformer
    A transformer that moves NaN to the upper end of the array.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean copy
      Set to true to use a copy of the data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double[] apply​(double[] data, int[] bounds)
      Pre-process the data for partitioning.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • copy

        private final boolean copy
        Set to true to use a copy of the data.
    • Constructor Detail

      • ExcludeNaNTransformer

        ExcludeNaNTransformer​(boolean copy)
        Parameters:
        copy - Set to true to use a copy of the data.
    • Method Detail

      • apply

        public double[] apply​(double[] data,
                              int[] bounds)
        Description copied from interface: NaNTransformer
        Pre-process the data for partitioning.

        This method will scan all the data and apply processing to NaN values.

        The method will return:

        • An array to partition; this may be a copy.
        • The size of the data; this can be smaller than the input array length if the transformer is configured to exclude NaN values.
        Specified by:
        apply in interface NaNTransformer
        Parameters:
        data - Data.
        bounds - [size].
        Returns:
        pre-processed data (may be a copy)