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 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 org.apache.lucene.util.mutable.MutableValue getValue()
getValue in interface StatsCollectorpublic org.apache.lucene.queries.function.FunctionValues getFunction()
getFunction in interface StatsCollectorpublic String valueSourceString()
valueSourceString in interface StatsCollectorCopyright © 2000–2015 The Apache Software Foundation. All rights reserved.