Module org.elasticsearch.server
Package org.elasticsearch.script.field
Class HalfFloatDocValuesField
java.lang.Object
org.elasticsearch.script.field.AbstractScriptFieldFactory<Float>
org.elasticsearch.script.field.HalfFloatDocValuesField
- All Implemented Interfaces:
Iterable<Float>,ScriptDocValues.Supplier<Double>,DocValuesScriptFieldFactory,Field<Float>,ScriptFieldFactory
public class HalfFloatDocValuesField
extends AbstractScriptFieldFactory<Float>
implements Field<Float>, DocValuesScriptFieldFactory, ScriptDocValues.Supplier<Double>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleasDouble(double defaultValue) Returns the 0th index value as adoubleif it exists, otherwisedefaultValue.doubleasDouble(int index, double defaultValue) Returns the value atindexas adoubleif it exists, otherwisedefaultValue.Converts all the values toDoubleand returns them as aList.floatget(double defaultValue) Does a downcast for defaultValue from a double to a float to allow users to avoid explicit casting.floatget(int index, double defaultValue) Does a downcast for defaultValue from a double to a float to allow users to avoid explicit casting.getInternal(int index) getName()Returns the name of this field.booleanisEmpty()Returnstrueif this field has no values, otherwisefalse.iterator()protected voidresize(int newSize) voidsetNextDocId(int docId) Set the current document ID.intsize()Returns the number of values this field has.Returns aScriptDocValuesof the appropriate type for this field.Methods inherited from class org.elasticsearch.script.field.AbstractScriptFieldFactory
toScriptFieldMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.elasticsearch.script.field.ScriptFieldFactory
toScriptField
-
Field Details
-
input
-
name
-
values
protected double[] values -
count
protected int count
-
-
Constructor Details
-
HalfFloatDocValuesField
-
-
Method Details
-
setNextDocId
Description copied from interface:DocValuesScriptFieldFactorySet the current document ID.- Specified by:
setNextDocIdin interfaceDocValuesScriptFieldFactory- Specified by:
setNextDocIdin interfaceScriptDocValues.Supplier<Double>- Throws:
IOException
-
resize
protected void resize(int newSize) -
toScriptDocValues
Description copied from interface:DocValuesScriptFieldFactoryReturns aScriptDocValuesof the appropriate type for this field. This is used to support backwards compatibility for accessing field values through thedocvariable.- Specified by:
toScriptDocValuesin interfaceDocValuesScriptFieldFactory
-
getInternal
- Specified by:
getInternalin interfaceScriptDocValues.Supplier<Double>
-
getName
Description copied from interface:FieldReturns the name of this field. -
isEmpty
public boolean isEmpty()Description copied from interface:FieldReturnstrueif this field has no values, otherwisefalse. -
size
public int size()Description copied from interface:FieldReturns the number of values this field has. -
get
public float get(double defaultValue) Does a downcast for defaultValue from a double to a float to allow users to avoid explicit casting. -
get
public float get(int index, double defaultValue) Does a downcast for defaultValue from a double to a float to allow users to avoid explicit casting. -
iterator
-
asDoubles
Converts all the values toDoubleand returns them as aList. -
asDouble
public double asDouble(double defaultValue) Returns the 0th index value as adoubleif it exists, otherwisedefaultValue. -
asDouble
public double asDouble(int index, double defaultValue) Returns the value atindexas adoubleif it exists, otherwisedefaultValue.
-