public final class LongsSketchSortedView extends Object implements LongsSortedView
Constructor and Description |
---|
LongsSketchSortedView(long[] quantiles,
long[] cumWeights,
QuantilesLongsAPI sk)
Construct from elements, also used in testing.
|
Modifier and Type | Method and Description |
---|---|
long[] |
getCumulativeWeights()
Returns the array of cumulative weights from the sketch.
|
long |
getMaxItem()
Returns the maximum item of the stream.
|
long |
getMinItem()
Returns the minimum item of the stream.
|
long |
getN()
Returns the total number of items presented to the sourcing sketch.
|
int |
getNumRetained()
Gets the number of quantiles retained by this sorted view.
|
long |
getQuantile(double rank,
QuantileSearchCriteria searchCrit)
Gets the approximate quantile of the given normalized rank and the given search criterion.
|
long[] |
getQuantiles()
Returns an array of all retained quantiles by the sketch.
|
double |
getRank(long quantile,
QuantileSearchCriteria searchCrit)
Gets the normalized rank corresponding to the given a quantile.
|
boolean |
isEmpty()
Returns true if this sorted view is empty.
|
LongsSortedViewIterator |
iterator()
Returns an iterator for this Sorted View.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCDF, getPMF
public LongsSketchSortedView(long[] quantiles, long[] cumWeights, QuantilesLongsAPI sk)
quantiles
- sorted array of quantilescumWeights
- sorted, monotonically increasing cumulative weights.sk
- the underlying quantile sketch.public long[] getCumulativeWeights()
SortedView
getCumulativeWeights
in interface SortedView
public long getMaxItem()
LongsSortedView
getMaxItem
in interface LongsSortedView
public long getMinItem()
LongsSortedView
getMinItem
in interface LongsSortedView
public long getN()
SortedView
getN
in interface SortedView
public int getNumRetained()
SortedView
getNumRetained
in interface SortedView
public long getQuantile(double rank, QuantileSearchCriteria searchCrit)
LongsSortedView
getQuantile
in interface LongsSortedView
rank
- the given normalized rank, a double in the range [0.0, 1.0].searchCrit
- If INCLUSIVE, the given rank includes all quantiles ≤
the quantile directly corresponding to the given rank.
If EXCLUSIVE, he given rank includes all quantiles <
the quantile directly corresponding to the given rank.QuantileSearchCriteria
public long[] getQuantiles()
LongsSortedView
getQuantiles
in interface LongsSortedView
public double getRank(long quantile, QuantileSearchCriteria searchCrit)
LongsSortedView
getRank
in interface LongsSortedView
quantile
- the given quantilesearchCrit
- if INCLUSIVE the given quantile is included into the rank.QuantileSearchCriteria
public boolean isEmpty()
SortedView
isEmpty
in interface SortedView
public LongsSortedViewIterator iterator()
SortedView
iterator
in interface LongsSortedView
iterator
in interface SortedView
Copyright © 2015–2024 The Apache Software Foundation. All rights reserved.