Package org.apache.solr.analytics.value
Class IntValue.AbstractIntValue
- java.lang.Object
-
- org.apache.solr.analytics.value.IntValue.AbstractIntValue
-
- All Implemented Interfaces:
AnalyticsValue
,AnalyticsValueStream
,ComparableValue
,DoubleValue
,DoubleValueStream
,FloatValue
,FloatValueStream
,IntValue
,IntValue.CastingIntValue
,IntValueStream
,LongValue
,LongValueStream
,StringValue
,StringValueStream
- Enclosing interface:
- IntValue
public abstract static class IntValue.AbstractIntValue extends Object implements IntValue.CastingIntValue
An abstract base forIntValue.CastingIntValue
that automatically casts to all types ifIntValue.getInt()
andAnalyticsValue.exists()
are implemented.
-
-
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.IntValue
IntValue.AbstractIntValue, IntValue.CastingIntValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.IntValueStream
IntValueStream.AbstractIntValueStream, IntValueStream.CastingIntValueStream
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.LongValue
LongValue.AbstractLongValue, LongValue.CastingLongValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.LongValueStream
LongValueStream.AbstractLongValueStream, LongValueStream.CastingLongValueStream
-
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
-
-
Constructor Summary
Constructors Constructor Description AbstractIntValue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnalyticsValue
convertToConstant()
Converts this value to aConstantValue
if it's expression type isAnalyticsValueStream.ExpressionType.CONST
.double
getDouble()
Get the double representation of the current value.float
getFloat()
Get the float representation of the current value.long
getLong()
Get the long representation of the current value.Object
getObject()
Get the object representation of the current value.ExpressionComparator<Integer>
getObjectComparator(String expression)
Create an entry comparator used to sort the facet-value buckets of a facet.String
getString()
Get the String representation of the current value.void
streamDoubles(DoubleConsumer cons)
Stream the double representations of all current values, if any exist.void
streamFloats(FloatConsumer cons)
Stream the float representations of all current values, if any exist.void
streamInts(IntConsumer cons)
Stream the int representations of all current values, if any exist.void
streamLongs(LongConsumer cons)
Stream the long representations of all current values, if any exist.void
streamObjects(Consumer<Object> cons)
Stream the object representations of all current values, if any exist.void
streamStrings(Consumer<String> cons)
Stream the String representations of all current values, if any exist.-
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
exists
-
Methods inherited from interface org.apache.solr.analytics.value.AnalyticsValueStream
getExpressionStr, getExpressionType, getName
-
-
-
-
Method Detail
-
getLong
public long getLong()
Description copied from interface:LongValue
Get the long representation of the current value.NOTE: The value returned is not valid unless calling
AnalyticsValue.exists()
afterwards returnsTRUE
.
-
getFloat
public float getFloat()
Description copied from interface:FloatValue
Get the float representation of the current value.NOTE: The value returned is not valid unless calling
AnalyticsValue.exists()
afterwards returnsTRUE
.- Specified by:
getFloat
in interfaceFloatValue
- Returns:
- the current value
-
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
-
getString
public String getString()
Description copied from interface:StringValue
Get the String representation of the current value.NOTE: The value returned is not valid unless calling
AnalyticsValue.exists()
afterwards returnsTRUE
.- Specified by:
getString
in interfaceStringValue
- Returns:
- the current value
-
getObject
public Object getObject()
Description copied from interface:AnalyticsValue
Get the object representation of the current value.- Specified by:
getObject
in interfaceAnalyticsValue
- Returns:
- the current value
-
streamInts
public void streamInts(IntConsumer cons)
Description copied from interface:IntValueStream
Stream the int representations of all current values, if any exist.- Specified by:
streamInts
in interfaceIntValueStream
- Parameters:
cons
- The consumer to accept the values
-
streamLongs
public void streamLongs(LongConsumer cons)
Description copied from interface:LongValueStream
Stream the long representations of all current values, if any exist.- Specified by:
streamLongs
in interfaceLongValueStream
- Parameters:
cons
- The consumer to accept the values
-
streamFloats
public void streamFloats(FloatConsumer cons)
Description copied from interface:FloatValueStream
Stream the float representations of all current values, if any exist.- Specified by:
streamFloats
in interfaceFloatValueStream
- Parameters:
cons
- The consumer to accept the values
-
streamDoubles
public void streamDoubles(DoubleConsumer cons)
Description copied from interface:DoubleValueStream
Stream the double representations of all current values, if any exist.- Specified by:
streamDoubles
in interfaceDoubleValueStream
- Parameters:
cons
- The consumer to accept the values
-
streamStrings
public void streamStrings(Consumer<String> cons)
Description copied from interface:StringValueStream
Stream the String representations of all current values, if any exist.- Specified by:
streamStrings
in interfaceStringValueStream
- Parameters:
cons
- The consumer to accept the values
-
streamObjects
public void streamObjects(Consumer<Object> cons)
Description copied from interface:AnalyticsValueStream
Stream the object representations of all current values, if any exist.- Specified by:
streamObjects
in interfaceAnalyticsValueStream
- Parameters:
cons
- The consumer to accept the values
-
convertToConstant
public AnalyticsValue convertToConstant()
Description copied from interface:AnalyticsValueStream
Converts this value to aConstantValue
if it's expression type isAnalyticsValueStream.ExpressionType.CONST
.If the value is reduced then no conversion will occur and the value itself will be returned.
- Specified by:
convertToConstant
in interfaceAnalyticsValueStream
- Returns:
- a constant representation of this value
-
getObjectComparator
public ExpressionComparator<Integer> getObjectComparator(String expression)
Description copied from interface:ComparableValue
Create an entry comparator used to sort the facet-value buckets of a facet.- Specified by:
getObjectComparator
in interfaceComparableValue
- Parameters:
expression
- the name of the expression in the results array- Returns:
- a comparator to sort the buckets with
-
-