java.lang.Object
org.elasticsearch.script.field.AbstractScriptFieldFactory<Byte>
org.elasticsearch.script.field.ByteDocValuesField
- All Implemented Interfaces:
Iterable<Byte>,ScriptDocValues.Supplier<Long>,DocValuesScriptFieldFactory,Field<Byte>,ScriptFieldFactory
public class ByteDocValuesField
extends AbstractScriptFieldFactory<Byte>
implements Field<Byte>, DocValuesScriptFieldFactory, ScriptDocValues.Supplier<Long>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionByteDocValuesField(org.apache.lucene.index.SortedNumericDocValues input, String name) -
Method Summary
Modifier and TypeMethodDescriptionbyteget(int defaultValue) byteget(int index, int defaultValue) Note: Constants in java and painless are ints, so letting the defaultValue be an int allows users to call this without 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
protected final org.apache.lucene.index.SortedNumericDocValues input -
name
-
values
protected byte[] values -
count
protected int count
-
-
Constructor Details
-
ByteDocValuesField
-
-
Method Details
-
setNextDocId
Description copied from interface:DocValuesScriptFieldFactorySet the current document ID.- Specified by:
setNextDocIdin interfaceDocValuesScriptFieldFactory- Specified by:
setNextDocIdin interfaceScriptDocValues.Supplier<Long>- Throws:
IOException
-
resize
protected void resize(int newSize) -
toScriptDocValues
Returns 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<Long>
-
getName
Returns the name of this field. -
isEmpty
public boolean isEmpty()Returnstrueif this field has no values, otherwisefalse. -
size
public int size()Returns the number of values this field has. -
iterator
-
get
public byte get(int defaultValue) -
get
public byte get(int index, int defaultValue) Note: Constants in java and painless are ints, so letting the defaultValue be an int allows users to call this without casting. A byte variable will be automatically widened to an int. If the user does pass a value outside the range, it will be cast down to a byte.
-