Module org.elasticsearch.server
Class RangeAggregator.Range
java.lang.Object
org.elasticsearch.search.aggregations.bucket.range.RangeAggregator.Range
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
- Direct Known Subclasses:
GeoDistanceAggregationBuilder.Range
- Enclosing class:
RangeAggregator
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final doublestatic final ParseFieldprotected final Stringprotected final Stringstatic final ParseFieldprotected final Doubleprotected final Doublestatic final ConstructingObjectParser<RangeAggregator.Range, Void> protected final doublestatic final ParseFieldprotected final StringFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionRange(String key, Double from, String fromAsStr, Double to, String toAsStr, DoubleUnaryOperator fixPrecision) Build the range.Range(StreamInput in) Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionbooleandoublegetFrom()getKey()doublegetTo()inthashCode()booleanmatches(double value) toString()toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
KEY_FIELD
-
FROM_FIELD
-
TO_FIELD
-
key
-
from
protected final double from -
originalFrom
-
fromAsStr
-
to
protected final double to -
originalTo
-
toAsStr
-
PARSER
-
-
Constructor Details
-
Range
public Range(String key, Double from, String fromAsStr, Double to, String toAsStr, DoubleUnaryOperator fixPrecision) Build the range. Generally callers should preferRange(String, Double, Double)orRange(String, String, String). If you must call this know that consumers preferfromandtoparameters if they are non-null and finite. Otherwise they parse fromfromrStrandtoStr.originalFromandoriginalToare used to preserve the original values offromandto. This is because precision is downgraded to float values when they are stored. Downgrading precision for float values surfaces into precision artifacts at serialization time as a result of treating float values as double values. (SeeRangeAggregationBuilder.innerBuild(AggregationContext, ValuesSourceConfig, AggregatorFactory, AggregatorFactories.Builder)) -
Range
-
Range
-
Range
-
Range
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getFrom
public double getFrom() -
getTo
public double getTo() -
getFromAsString
-
getToAsString
-
getKey
-
matches
public boolean matches(double value) -
toString
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
hashCode
public int hashCode() -
equals
-