Class GKArray

    • Constructor Detail

      • GKArray

        public GKArray​(double rankAccuracy)
    • Method Detail

      • getRankAccuracy

        public double getRankAccuracy()
      • accept

        public void accept​(double value)
        Adds a value to the sketch.
        Parameters:
        value - the value to be added
      • accept

        public void accept​(double value,
                           long count)
        Adds a value to the sketch as many times as specified by count.
        Parameters:
        value - the value to be added
        count - the number of times the value is to be added
        Throws:
        java.lang.IllegalArgumentException - if count is negative
      • mergeWith

        public void mergeWith​(GKArray other)
        Merges the other sketch into this one. After this operation, this sketch encodes the values that were added to both this and the other sketches.
        Parameters:
        other - the sketch to be merged into this one
        Throws:
        java.lang.NullPointerException - if other is null
      • copy

        public GKArray copy()
        Returns:
        a (deep) copy of this sketch
      • isEmpty

        public boolean isEmpty()
        Returns:
        iff no value has been added to this sketch
      • getCount

        public double getCount()
        Returns:
        the total number of values that have been added to this sketch
      • getMinValue

        public double getMinValue()
        Returns:
        the minimum value that has been added to this sketch
        Throws:
        java.util.NoSuchElementException - if the sketch is empty
      • getMaxValue

        public double getMaxValue()
        Returns:
        the maximum value that has been added to this sketch
        Throws:
        java.util.NoSuchElementException - if the sketch is empty
      • getValueAtQuantile

        public double getValueAtQuantile​(double quantile)
        Parameters:
        quantile - a number between 0 and 1 (both included)
        Returns:
        the value at the specified quantile
        Throws:
        java.util.NoSuchElementException - if the sketch is empty
      • getValuesAtQuantiles

        public double[] getValuesAtQuantiles​(double[] quantiles)
        Parameters:
        quantiles - number between 0 and 1 (both included)
        Returns:
        the values at the respective specified quantiles
        Throws:
        java.util.NoSuchElementException - if the sketch is empty