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 org.apache.lucene.queries.function.FunctionValues |
function |
protected org.apache.lucene.util.mutable.MutableValue |
max |
protected org.apache.lucene.util.mutable.MutableValue |
min |
protected long |
missingCount |
protected org.apache.lucene.queries.function.ValueSource |
source |
protected Set<String> |
statsList |
protected org.apache.lucene.util.mutable.MutableValue |
value |
protected long |
valueCount |
protected org.apache.lucene.queries.function.FunctionValues.ValueFiller |
valueFiller |
Constructor and Description |
---|
MinMaxStatsCollector(org.apache.lucene.queries.function.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.
|
org.apache.lucene.queries.function.FunctionValues |
getFunction() |
Comparable |
getStat(String stat)
Return the value of the given statistic.
|
Set<String> |
getStatsList() |
org.apache.lucene.util.mutable.MutableValue |
getValue() |
void |
setNextReader(org.apache.lucene.index.LeafReaderContext context) |
String |
statString(String stat) |
String |
toString() |
String |
valueSourceString() |
protected long missingCount
protected long valueCount
protected org.apache.lucene.util.mutable.MutableValue max
protected org.apache.lucene.util.mutable.MutableValue min
protected org.apache.lucene.util.mutable.MutableValue value
protected final org.apache.lucene.queries.function.ValueSource source
protected org.apache.lucene.queries.function.FunctionValues function
protected org.apache.lucene.queries.function.FunctionValues.ValueFiller valueFiller
public void setNextReader(org.apache.lucene.index.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 org.apache.lucene.util.mutable.MutableValue getValue()
getValue
in interface StatsCollector
public org.apache.lucene.queries.function.FunctionValues getFunction()
getFunction
in interface StatsCollector
public String valueSourceString()
valueSourceString
in interface StatsCollector
Copyright © 2000–2015 The Apache Software Foundation. All rights reserved.