Class ConstantFloatValue
- java.lang.Object
-
- org.apache.solr.analytics.value.constant.ConstantValue
-
- org.apache.solr.analytics.value.constant.ConstantFloatValue
-
- All Implemented Interfaces:
AnalyticsValue,AnalyticsValueStream,ComparableValue,DoubleValue,DoubleValueStream,FloatValue,FloatValue.CastingFloatValue,FloatValueStream,StringValue,StringValueStream
public class ConstantFloatValue extends ConstantValue implements FloatValue.CastingFloatValue
A constantFloatValue. Every call togetFloat()and other methods will return the same constant value.
-
-
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.FloatValue
FloatValue.AbstractFloatValue, FloatValue.CastingFloatValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.FloatValueStream
FloatValueStream.AbstractFloatValueStream, FloatValueStream.CastingFloatValueStream
-
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 Stringname-
Fields inherited from class org.apache.solr.analytics.value.constant.ConstantValue
creatorFunction
-
-
Constructor Summary
Constructors Constructor Description ConstantFloatValue(float value)
-
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.floatgetFloat()Get the float representation of the current value.StringgetName()Get the name of function or value.ObjectgetObject()Get the object representation of the current value.ConstantComparatorgetObjectComparator(String expression)Create an entry comparator used to sort the facet-value buckets of a facet.StringgetString()Get the String representation of the current value.voidstreamDoubles(DoubleConsumer cons)Stream the double representations of all current values, if any exist.voidstreamFloats(FloatConsumer cons)Stream the float representations of all current values, if any exist.voidstreamObjects(Consumer<Object> cons)Stream the object representations of all current values, if any exist.voidstreamStrings(Consumer<String> cons)Stream the String representations of all current values, if any exist.-
Methods inherited from class org.apache.solr.analytics.value.constant.ConstantValue
convertToConstant
-
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.AnalyticsValueStream
convertToConstant
-
-
-
-
Field Detail
-
name
public static final String name
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFloat
public float getFloat()
Description copied from interface:FloatValueGet the float representation of the current value.NOTE: The value returned is not valid unless calling
AnalyticsValue.exists()afterwards returnsTRUE.- Specified by:
getFloatin interfaceFloatValue- Returns:
- the current value
-
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
-
getString
public String getString()
Description copied from interface:StringValueGet the String representation of the current value.NOTE: The value returned is not valid unless calling
AnalyticsValue.exists()afterwards returnsTRUE.- Specified by:
getStringin interfaceStringValue- Returns:
- the current value
-
getObject
public Object getObject()
Description copied from interface:AnalyticsValueGet the object representation of the current value.- Specified by:
getObjectin interfaceAnalyticsValue- 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
-
streamFloats
public void streamFloats(FloatConsumer cons)
Description copied from interface:FloatValueStreamStream the float representations of all current values, if any exist.- Specified by:
streamFloatsin interfaceFloatValueStream- Parameters:
cons- The consumer to accept the values
-
streamDoubles
public void streamDoubles(DoubleConsumer cons)
Description copied from interface:DoubleValueStreamStream the double representations of all current values, if any exist.- Specified by:
streamDoublesin interfaceDoubleValueStream- Parameters:
cons- The consumer to accept the values
-
streamStrings
public void streamStrings(Consumer<String> cons)
Description copied from interface:StringValueStreamStream the String representations of all current values, if any exist.- Specified by:
streamStringsin interfaceStringValueStream- Parameters:
cons- The consumer to accept the values
-
streamObjects
public void streamObjects(Consumer<Object> cons)
Description copied from interface:AnalyticsValueStreamStream the object representations of all current values, if any exist.- Specified by:
streamObjectsin interfaceAnalyticsValueStream- Parameters:
cons- The consumer to accept the values
-
getObjectComparator
public ConstantComparator getObjectComparator(String expression)
Description copied from interface:ComparableValueCreate an entry comparator used to sort the facet-value buckets of a facet.- Specified by:
getObjectComparatorin interfaceComparableValue- Parameters:
expression- the name of the expression in the results array- Returns:
- a comparator to sort the buckets with
-
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
-
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
-
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
-
-