Class MeanFunction
- java.lang.Object
-
- org.apache.solr.analytics.value.DoubleValue.AbstractDoubleValue
-
- org.apache.solr.analytics.function.reduction.MeanFunction
-
- All Implemented Interfaces:
ReductionFunction,AnalyticsValue,AnalyticsValueStream,ComparableValue,DoubleValue,DoubleValue.CastingDoubleValue,DoubleValueStream,StringValue,StringValueStream
public class MeanFunction extends DoubleValue.AbstractDoubleValue implements ReductionFunction
A reduction function which returns the mean of the values of the given expression.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.AnalyticsValue
AnalyticsValue.AbstractAnalyticsValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.AnalyticsValueStream
AnalyticsValueStream.AbstractAnalyticsValueStream, AnalyticsValueStream.ExpressionType
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.DoubleValue
DoubleValue.AbstractDoubleValue, DoubleValue.CastingDoubleValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.DoubleValueStream
DoubleValueStream.AbstractDoubleValueStream, DoubleValueStream.CastingDoubleValueStream
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.StringValue
StringValue.AbstractStringValue, StringValue.CastingStringValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.StringValueStream
StringValueStream.AbstractStringValueStream, StringValueStream.CastingStringValueStream
-
-
Field Summary
Fields Modifier and Type Field Description static ExpressionFactory.CreatorFunctioncreatorFunctionstatic Stringname
-
Constructor Summary
Constructors Constructor Description MeanFunction(DoubleValueStream param)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists()Check whether the current value exists.doublegetDouble()Get the double representation of the current value.StringgetExpressionStr()Get the expression string of the analytics value stream.AnalyticsValueStream.ExpressionTypegetExpressionType()Get the type of the expression that this class represents.StringgetName()Get the name of function or value.voidsynchronizeDataCollectors(UnaryOperator<ReductionDataCollector<?>> sync)Syncs the data collectors with shared versions across the entire Analytics Request so that as little data as possible is sent across shards.-
Methods inherited from class org.apache.solr.analytics.value.DoubleValue.AbstractDoubleValue
convertToConstant, getObject, getObjectComparator, getString, streamDoubles, streamObjects, streamStrings
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.analytics.value.AnalyticsValue
getObject
-
Methods inherited from interface org.apache.solr.analytics.value.AnalyticsValueStream
convertToConstant, streamObjects
-
-
-
-
Field Detail
-
name
public static final String name
- See Also:
- Constant Field Values
-
creatorFunction
public static final ExpressionFactory.CreatorFunction creatorFunction
-
-
Constructor Detail
-
MeanFunction
public MeanFunction(DoubleValueStream param)
-
-
Method Detail
-
getDouble
public double getDouble()
Description copied from interface:DoubleValueGet the double representation of the current value.NOTE: The value returned is not valid unless calling
AnalyticsValue.exists()afterwards returnsTRUE.- Specified by:
getDoublein interfaceDoubleValue- Returns:
- the current value
-
exists
public boolean exists()
Description copied from interface:AnalyticsValueCheck whether the current value exists.
NOTE: The result of this method is only guaranteed after anyget<Type>()method is called.- Specified by:
existsin interfaceAnalyticsValue- Returns:
- whether the current value exists
-
synchronizeDataCollectors
public void synchronizeDataCollectors(UnaryOperator<ReductionDataCollector<?>> sync)
Description copied from interface:ReductionFunctionSyncs the data collectors with shared versions across the entire Analytics Request so that as little data as possible is sent across shards.- Specified by:
synchronizeDataCollectorsin interfaceReductionFunction- Parameters:
sync- a function that takes in aReductionDataCollectorand returns a shared version
-
getExpressionStr
public String getExpressionStr()
Description copied from interface:AnalyticsValueStreamGet the expression string of the analytics value stream. Must be unique to the expression. If passed toExpressionFactory.createExpression(String), the exact same expression should be created.- Specified by:
getExpressionStrin interfaceAnalyticsValueStream- Returns:
- the name of function/value
-
getName
public String getName()
Description copied from interface:AnalyticsValueStreamGet the name of function or value.- Specified by:
getNamein interfaceAnalyticsValueStream- Returns:
- the name of function/value
-
getExpressionType
public AnalyticsValueStream.ExpressionType getExpressionType()
Description copied from interface:AnalyticsValueStreamGet the type of the expression that this class represents.- Specified by:
getExpressionTypein interfaceAnalyticsValueStream- Returns:
- the expression type
-
-