org.apache.datasketches.quantilescommon

## Class IncludeMinMax

- java.lang.Object
- - org.apache.datasketches.quantilescommon.IncludeMinMax

    public class IncludeMinMax
    extends Object

This class reinserts the min and max values into the sorted view arrays as required.

### Nested Class Summary

Nested Classes
`static class` `IncludeMinMax.DoublesPair` A simple structure to hold a pair of arrays
`static class` `IncludeMinMax.FloatsPair` A simple structure to hold a pair of arrays
`static class` `IncludeMinMax.ItemsPair<T>` A simple structure to hold a pair of arrays
`static class` `IncludeMinMax.LongsPair` A simple structure to hold a pair of arrays

### Constructor Summary

Constructors
Constructor and Description
`IncludeMinMax()`

### Method Summary

All Methods Static Methods Concrete Methods
`static IncludeMinMax.DoublesPair` `includeDoublesMinMax(double[] quantilesIn, long[] cumWeightsIn, double maxItem, double minItem)` The logic to include the min and max of type double.
`static IncludeMinMax.FloatsPair` `includeFloatsMinMax(float[] quantilesIn, long[] cumWeightsIn, float maxItem, float minItem)` The logic to include the min and max of type float.
`static <T> IncludeMinMax.ItemsPair<T>` `includeItemsMinMax(T[] quantilesIn, long[] cumWeightsIn, T maxItem, T minItem, Comparator<? super T> comparator)` The logic to include the min and max of type T.
`static IncludeMinMax.LongsPair` `includeLongsMinMax(long[] quantilesIn, long[] cumWeightsIn, long maxItem, long minItem)` The logic to include the min and max of type double.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### IncludeMinMax

    public IncludeMinMax()

### Method Detail

#### includeDoublesMinMax

    public static IncludeMinMax.DoublesPair includeDoublesMinMax(double[] quantilesIn,
                                                                 long[] cumWeightsIn,
                                                                 double maxItem,
                                                                 double minItem)

The logic to include the min and max of type double.

Parameters:
  `quantilesIn` - The array of quantiles
  `cumWeightsIn` - The array of associated cumulative weights
  `maxItem` - the maximum item of the stream
  `minItem` - the minimum item of the stream
Returns:
  a DoublesPair

#### includeLongsMinMax

    public static IncludeMinMax.LongsPair includeLongsMinMax(long[] quantilesIn,
                                                             long[] cumWeightsIn,
                                                             long maxItem,
                                                             long minItem)

The logic to include the min and max of type double.

Parameters:
  `quantilesIn` - The array of quantiles
  `cumWeightsIn` - The array of associated cumulative weights
  `maxItem` - the maximum item of the stream
  `minItem` - the minimum item of the stream
Returns:
  a DoublesPair

#### includeFloatsMinMax

    public static IncludeMinMax.FloatsPair includeFloatsMinMax(float[] quantilesIn,
                                                               long[] cumWeightsIn,
                                                               float maxItem,
                                                               float minItem)

The logic to include the min and max of type float.

Parameters:
  `quantilesIn` - The array of quantiles
  `cumWeightsIn` - The array of associated cumulative weights
  `maxItem` - the maximum item of the stream
  `minItem` - the minimum item of the stream
Returns:
  a FloatsPair

#### includeItemsMinMax

    public static <T> IncludeMinMax.ItemsPair<T> includeItemsMinMax(T[] quantilesIn,
                                                                    long[] cumWeightsIn,
                                                                    T maxItem,
                                                                    T minItem,
                                                                    Comparator<? super T> comparator)

The logic to include the min and max of type T.

Type Parameters:
  `T` - the item class type
Parameters:
  `quantilesIn` - The array of quantiles
  `cumWeightsIn` - The array of associated cumulative weights
  `maxItem` - the maximum item of the stream
  `minItem` - the minimum item of the stream
  `comparator` - a comparator for type T
Returns:
  an ItemsPair