public class MinMaxStatsCollector extends Object implements StatsCollector
MinMaxStatsCollector computes the min, max, number of values and number of missing values.| Modifier and Type | Field and Description |
|---|---|
protected FunctionValues |
function |
protected MutableValue |
max |
protected MutableValue |
min |
protected long |
missingCount |
protected ValueSource |
source |
protected Set<String> |
statsList |
protected MutableValue |
value |
protected long |
valueCount |
protected FunctionValues.ValueFiller |
valueFiller |
| Constructor and Description |
|---|
MinMaxStatsCollector(ValueSource source,
Set<String> statsList) |
| Modifier and Type | Method and Description |
|---|---|
void |
collect(int doc)
Collect values from the value source and add to statistics.
|
void |
compute()
After all documents have been collected, this method should be
called to finalize the calculations of each statistic.
|
FunctionValues |
getFunction() |
Comparable |
getStat(String stat)
Return the value of the given statistic.
|
Set<String> |
getStatsList() |
MutableValue |
getValue() |
void |
setNextReader(LeafReaderContext context) |
String |
statString(String stat) |
String |
toString() |
String |
valueSourceString() |
protected long missingCount
protected long valueCount
protected MutableValue max
protected MutableValue min
protected MutableValue value
protected final ValueSource source
protected FunctionValues function
protected FunctionValues.ValueFiller valueFiller
public MinMaxStatsCollector(ValueSource source, Set<String> statsList)
public void setNextReader(LeafReaderContext context) throws IOException
setNextReader in interface StatsCollectorcontext - The context to read documents from.IOException - if setting next reader failspublic void collect(int doc)
StatsCollectorcollect in interface StatsCollectordoc - Document to collect frompublic Comparable getStat(String stat)
StatsCollectorgetStat in interface StatsCollectorstat - the statpublic Set<String> getStatsList()
getStatsList in interface StatsCollectorpublic void compute()
StatsCollectorcompute in interface StatsCollectorpublic MutableValue getValue()
getValue in interface StatsCollectorpublic FunctionValues getFunction()
getFunction in interface StatsCollectorpublic String valueSourceString()
valueSourceString in interface StatsCollectorCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.