Class ScriptDocValues<T>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<T>
org.elasticsearch.index.fielddata.ScriptDocValues<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>, List<T>, FieldValues<T>
Direct Known Subclasses:
IpFieldMapper.IpFieldType.IpScriptDocValues, ScriptDocValues.Booleans, ScriptDocValues.BytesRefs, ScriptDocValues.Dates, ScriptDocValues.Doubles, ScriptDocValues.Geometry, ScriptDocValues.Longs, ScriptDocValues.Strings

public abstract class ScriptDocValues<T> extends AbstractList<T> implements FieldValues<T>
Script level doc values, the assumption is that any implementation will implement a getValue method. Implementations should not internally re-use objects for the values that they return as a single ScriptDocValues instance can be reused to return values form multiple documents.
  • Constructor Details

    • ScriptDocValues

      public ScriptDocValues()
  • Method Details

    • setNextDocId

      public abstract void setNextDocId(int docId) throws IOException
      Set the current doc ID.
      Throws:
      IOException
    • add

      public final void add(int index, T element)
      Specified by:
      add in interface List<T>
      Overrides:
      add in class AbstractList<T>
    • remove

      public final boolean remove(Object o)
      Specified by:
      remove in interface Collection<T>
      Specified by:
      remove in interface List<T>
      Overrides:
      remove in class AbstractCollection<T>
    • replaceAll

      public final void replaceAll(UnaryOperator<T> operator)
      Specified by:
      replaceAll in interface List<T>
    • set

      public final T set(int index, T element)
      Specified by:
      set in interface List<T>
      Overrides:
      set in class AbstractList<T>
    • sort

      public final void sort(Comparator<? super T> c)
      Specified by:
      sort in interface List<T>
    • toField

      public abstract Field<T> toField(String fieldName)
    • getValues

      public List<T> getValues()
      Description copied from interface: FieldValues
      All underlying values. Note this boxes primitives
      Specified by:
      getValues in interface FieldValues<T>
    • getNonPrimitiveValue

      public T getNonPrimitiveValue()
      Description copied from interface: FieldValues
      The first value as a subclass of Object. Boxes primitives
      Specified by:
      getNonPrimitiveValue in interface FieldValues<T>
    • getLongValue

      public long getLongValue()
      Description copied from interface: FieldValues
      The first value as a primitive long. For performance reasons, implementations should avoid intermediate boxings if possible
      Specified by:
      getLongValue in interface FieldValues<T>
    • getDoubleValue

      public double getDoubleValue()
      Description copied from interface: FieldValues
      The first value as a primitive double. For performance reasons, implementations should avoid intermediate boxings if possible
      Specified by:
      getDoubleValue in interface FieldValues<T>
    • throwIfEmpty

      protected void throwIfEmpty()