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.CreatorFunction
creatorFunction
static String
name
-
Constructor Summary
Constructors Constructor Description MeanFunction(DoubleValueStream param)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exists()
Check whether the current value exists.double
getDouble()
Get the double representation of the current value.String
getExpressionStr()
Get the expression string of the analytics value stream.AnalyticsValueStream.ExpressionType
getExpressionType()
Get the type of the expression that this class represents.String
getName()
Get the name of function or value.void
synchronizeDataCollectors(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:DoubleValue
Get the double representation of the current value.NOTE: The value returned is not valid unless calling
AnalyticsValue.exists()
afterwards returnsTRUE
.- Specified by:
getDouble
in interfaceDoubleValue
- Returns:
- the current value
-
exists
public boolean exists()
Description copied from interface:AnalyticsValue
Check whether the current value exists.
NOTE: The result of this method is only guaranteed after anyget<Type>()
method is called.- Specified by:
exists
in interfaceAnalyticsValue
- Returns:
- whether the current value exists
-
synchronizeDataCollectors
public void synchronizeDataCollectors(UnaryOperator<ReductionDataCollector<?>> sync)
Description copied from interface:ReductionFunction
Syncs the data collectors with shared versions across the entire Analytics Request so that as little data as possible is sent across shards.- Specified by:
synchronizeDataCollectors
in interfaceReductionFunction
- Parameters:
sync
- a function that takes in aReductionDataCollector
and returns a shared version
-
getExpressionStr
public String getExpressionStr()
Description copied from interface:AnalyticsValueStream
Get 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:
getExpressionStr
in interfaceAnalyticsValueStream
- Returns:
- the name of function/value
-
getName
public String getName()
Description copied from interface:AnalyticsValueStream
Get the name of function or value.- Specified by:
getName
in interfaceAnalyticsValueStream
- Returns:
- the name of function/value
-
getExpressionType
public AnalyticsValueStream.ExpressionType getExpressionType()
Description copied from interface:AnalyticsValueStream
Get the type of the expression that this class represents.- Specified by:
getExpressionType
in interfaceAnalyticsValueStream
- Returns:
- the expression type
-
-