public boolean getValue() { if (count == 0) { if (ScriptDocValues.EXCEPTION_FOR_MISSING_VALUE) { throw new IllegalStateException("A document doesn't have a value for a field! " + "Use doc[<field>].size()==0 to check if a document is missing a field!"); } deprecated("scripting_missing_value_deprecation", "returning default values for missing document values is deprecated. " + "Set system property '-Des.scripting.exception_for_missing_value=true' " + "to make behaviour compatible with future major versions!"); return false; } return values[0]; }
public boolean getValue() { if (count == 0) { if (ScriptDocValues.EXCEPTION_FOR_MISSING_VALUE) { throw new IllegalStateException("A document doesn't have a value for a field! " + "Use doc[<field>].size()==0 to check if a document is missing a field!"); } deprecated("scripting_missing_value_deprecation", "returning default values for missing document values is deprecated. " + "Set system property '-Des.scripting.exception_for_missing_value=true' " + "to make behaviour compatible with future major versions!"); return false; } return values[0]; }
@Override public final ScriptDocValues<?> getScriptValues() { switch (numericType) { case DATE: return new ScriptDocValues.Dates(getLongValues()); case BOOLEAN: return new ScriptDocValues.Booleans(getLongValues()); default: return new ScriptDocValues.Longs(getLongValues()); } }
@Override public final ScriptDocValues getScriptValues() { if (isBoolean) { return new ScriptDocValues.Booleans(getLongValues()); } else { return new ScriptDocValues.Longs(getLongValues()); } }
/** * Set the {@link #size()} and ensure that the {@link #values} array can * store at least that many entries. */ protected void resize(int newSize) { count = newSize; values = grow(values, count); }
/** * Set the {@link #size()} and ensure that the {@link #values} array can * store at least that many entries. */ protected void resize(int newSize) { count = newSize; values = grow(values, count); }
@Override public final ScriptDocValues<?> getScriptValues() { switch (numericType) { case DATE: return new ScriptDocValues.Dates(getLongValues()); case BOOLEAN: return new ScriptDocValues.Booleans(getLongValues()); default: return new ScriptDocValues.Longs(getLongValues()); } }
@Override public final ScriptDocValues<?> getScriptValues() { switch (numericType) { case DATE: return new ScriptDocValues.Dates(getLongValues()); case BOOLEAN: return new ScriptDocValues.Booleans(getLongValues()); default: return new ScriptDocValues.Longs(getLongValues()); } }
/** * Set the {@link #size()} and ensure that the {@link #values} array can * store at least that many entries. */ protected void resize(int newSize) { count = newSize; values = grow(values, count); }