Package org.elasticsearch.script.field
Class ShortDocValuesField
java.lang.Object
org.elasticsearch.script.field.ShortDocValuesField
- All Implemented Interfaces:
Iterable<Short>
,ScriptDocValues.Supplier<Long>
,DocValuesField<Short>
,Field<Short>
public class ShortDocValuesField
extends Object
implements DocValuesField<Short>, ScriptDocValues.Supplier<Long>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionShortDocValuesField
(org.apache.lucene.index.SortedNumericDocValues input, String name) -
Method Summary
Modifier and TypeMethodDescriptionshort
get
(int defaultValue) short
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.getInternal
(int index) getName()
Returns the name of this field.Returns aScriptDocValues
of the appropriate type for this field.boolean
isEmpty()
Returnstrue
if this field has no values, otherwisefalse
.iterator()
protected void
resize
(int newSize) void
setNextDocId
(int docId) Set the current document ID.int
size()
Returns the number of values this field has.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
input
protected final org.apache.lucene.index.SortedNumericDocValues input -
name
-
values
protected short[] values -
count
protected int count
-
-
Constructor Details
-
ShortDocValuesField
-
-
Method Details
-
setNextDocId
Description copied from interface:DocValuesField
Set the current document ID.- Specified by:
setNextDocId
in interfaceDocValuesField<Short>
- Specified by:
setNextDocId
in interfaceScriptDocValues.Supplier<Long>
- Throws:
IOException
-
resize
protected void resize(int newSize) -
getScriptDocValues
Returns aScriptDocValues
of the appropriate type for this field. This is used to support backwards compatibility for accessing field values through thedoc
variable.- Specified by:
getScriptDocValues
in interfaceDocValuesField<Short>
-
getInternal
- Specified by:
getInternal
in interfaceScriptDocValues.Supplier<Long>
-
getName
Returns the name of this field. -
isEmpty
public boolean isEmpty()Returnstrue
if this field has no values, otherwisefalse
. -
size
public int size()Returns the number of values this field has. -
iterator
-
get
public short get(int defaultValue) -
get
public short 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 short 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 short.
-