Class GenericPartitionBoundaries<T>

    • Constructor Detail

      • GenericPartitionBoundaries

        public GenericPartitionBoundaries​(long totalN,
                                          T[] boundaries,
                                          long[] natRanks,
                                          double[] normRanks,
                                          T maxItem,
                                          T minItem,
                                          QuantileSearchCriteria searchCrit)
    • Method Detail

      • getN

        public long getN()
        Description copied from interface: PartitionBoundaries
        Gets the length of the input stream offered to the underlying sketch.
        Specified by:
        getN in interface PartitionBoundaries
        Returns:
        the length of the input stream offered to the underlying sketch.
      • getBoundaries

        public T[] getBoundaries()
        Gets an ordered array of boundaries that sequentially define the upper and lower boundaries of partitions. These partitions are to be constructed by an external process. Each boundary is essentially a reference and should uniquely identify an item or a set of identical items from the original stream of data fed to the originating sketch.

        Assume boundaries array has size N + 1. Let the indicies be sequentially numbered from 0 to N. The number of partitions is always one less than the size of the boundaries array. Let the the partitions be sequentially numbered from 1 to N.

        If these results were computed using QuantileSearchCriteria.INCLUSIVE then these sequential boundaries are to be interpreted as follows:

        • Partition 1: include all items ≥ index 0 and ≤ index 1.
        • Partition 2: include all items > index 1 and ≤ index 2.
        • Partition N: include all items > index N-1 and ≤ index N.

        If these results were computed using QuantileSearchCriteria.EXCLUSIVE then these sequential boundaries are to be interpreted as follows:

        • Partition 1: include all items ≥ index 0 and < index 1.
        • Partition 2: include all items ≥ index 1 and < index 2.
        • Partition N: include all items ≥ index N-1 and ≤ index N.
        Returns:
        an array of boundaries that sequentially define the upper and lower boundaries of partitions.
      • getNaturalRanks

        public long[] getNaturalRanks()
        Description copied from interface: PartitionBoundaries
        Gets an ordered array of natural ranks of the associated array of partition boundaries utilizing a specified search criterion. Natural ranks are integral values on the interval [1, N]
        Specified by:
        getNaturalRanks in interface PartitionBoundaries
        Returns:
        an array of natural ranks.
      • getNormalizedRanks

        public double[] getNormalizedRanks()
        Description copied from interface: PartitionBoundaries
        Gets an ordered array of normalized ranks of the associated array of partition boundaries utilizing a specified search criterion. Normalized ranks are double values on the interval [0.0, 1.0].
        Specified by:
        getNormalizedRanks in interface PartitionBoundaries
        Returns:
        an array of normalized ranks.
      • getNumDeltaItems

        public long[] getNumDeltaItems()
        Description copied from interface: PartitionBoundaries
        Gets the number of items to be included for each partition as an array. The count at index 0 is 0. The number of items included in the first partition, defined by the boundaries at index 0 and index 1, is at index 1 in this array, etc.
        Specified by:
        getNumDeltaItems in interface PartitionBoundaries
        Returns:
        the number of items to be included for each partition as an array.
      • getMaxItem

        public T getMaxItem()
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the sketch algorithm.
        Returns:
        the maximum item of the stream
        Throws:
        IllegalArgumentException - if sketch is empty.
      • getMinItem

        public T getMinItem()
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the sketch algorithm.
        Returns:
        the minimum item of the stream
        Throws:
        IllegalArgumentException - if sketch is empty.