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 StatsCollector
context
- The context to read documents from.IOException
- if setting next reader failspublic void collect(int doc)
StatsCollector
collect
in interface StatsCollector
doc
- Document to collect frompublic Comparable getStat(String stat)
StatsCollector
getStat
in interface StatsCollector
stat
- the statpublic Set<String> getStatsList()
getStatsList
in interface StatsCollector
public void compute()
StatsCollector
compute
in interface StatsCollector
public MutableValue getValue()
getValue
in interface StatsCollector
public FunctionValues getFunction()
getFunction
in interface StatsCollector
public String valueSourceString()
valueSourceString
in interface StatsCollector
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.