Returns the value mapped by {@code name} if it exists and is a double or
can be coerced to a double, or throws otherwise.

@throws JsonException if the mapping doesn't exist or cannot be coerced
to a double.
333010
public Double getDouble(String name, boolean strict) throws JsonException {
        JsonElement el = get(name);
        Double res = null;
        if (strict && !el.isNumber()) {
            throw Util.typeMismatch(name, el, "double", true);
        }
        if (el.isNumber()) {
            res = el.asDouble();
        }
        if (el.isString()) {
            res = Util.toDouble(el.asString());
        }
        if (res == null)
            throw Util.typeMismatch(name, el, "double", strict);
        return res;
    }
906618
public Double getDouble(String name) {
        //let it fail in the more general case where it isn't actually a number
        Number number = (Number) content.get(name);
        if (number == null) {
            return null;
        } else if (number instanceof Double) {
            return (Double) number;
        } else {
            return number.doubleValue(); //autoboxing to Double
        }
    }
663916
@SuppressWarnings("unchecked")
    public <R> R get(@NotNull final String name) {
        // do some conversions for JsonObject/JsonArray
        Object o = context.get(name);

        if (o instanceof Map) {
            return (R) new JsonObject((Map) o);
        }
        if (o instanceof List) {
            return (R) new JsonArray((List) o);
        }
        return (R) o;
    }
881634
public Double getParameterDouble(String name) throws RepositoryConfigurationException
   {
      try
      {
         return StringNumberParser.parseDouble(getParameterValue(name));
      }
      catch (NumberFormatException e)
      {
         throw new RepositoryConfigurationException(name + ": unparseable Long. " + e, e);
      }
   }
1253910
public double optDouble(String name, double fallback) {
		Object object = opt(name);
		Double result = JSON.toDouble(object);
		return result != null ? result : fallback;
	}
984622
public static float getFloat(JSONValue value) {
        if (value == null)
            return 0;
        if (!(value instanceof Number))
            throw new JSONException(NOT_A_NUMBER);
        return ((Number)value).floatValue();
    }
786076
public long getLong(String key) throws JSONException {
        Object o = get(key);
        return o instanceof Number ?
                ((Number) o).longValue() : (long) getDouble(key);
    }
317909
public JsonObject getJsonObject(String name) throws JsonException {
        JsonElement el = get(name);
        if (!el.isJsonObject()) {
            throw Util.typeMismatch(name, el, "JsonObject");
        }
        return el.asJsonObject();
    }
184615
public JsonArray getJsonArray(String name) throws JsonException {
        JsonElement el = get(name);
        if (!el.isJsonArray()) {
            throw Util.typeMismatch(name, el, "JsonArray");
        }
        return el.asJsonArray();
    }
226975
public synchronized String getValue(String name) {
        if (map == null) {
            return null;
        }
        return map.get(name);
    }
1043624
public static double requiredDouble(JSONObject o, String id) throws JSONConverterException {
        checkKeys(o, id);
        Object x = o.get(id);
        if (!(x instanceof Number)) {
            throw new JSONConverterException("Number expected at key '" + id + "' but was '" + x.getClass() + "'.");
        }
        return ((Number) x).doubleValue();
    }
1268107
private static Object convert(Object x) throws JSONException {
    if (x instanceof JSONObject) {
      JSONObject jsonObject = (JSONObject) x;
      String[] names = JSONObject.getNames(jsonObject);
      if (names == null || names.length == 0) {
        return new HashMap<>(0);
      }
      HashMap<String, Object> map = new HashMap<>(names.length);
      for (String name : names) {
        Object value = jsonObject.get(name);
        map.put(name, convert(value));
      }
      return map;
    } else if (x instanceof JSONArray) {
      JSONArray jsonArray = (JSONArray) x;
      int length = jsonArray.length();
      List<Object> list = new ArrayList<>(length);
      for (int i = 0; i < length; i++) {
        list.add(convert(jsonArray.get(i)));
      }
      return list;
    } else {
      return x;
    }
  }
701831
public static int valueFromName(String name) {
        if (name.equals(TYPENAME_SIMPLE_REFERENCE)) {
            return SIMPLE_REFERENCE;
        }
        return javax.jcr.PropertyType.valueFromName(name);
    }
1092405
public Object get(String name) throws IOException {
        return Boolean.valueOf(isSet(name2Index(name)));
    }
552980
public static Double parserDouble(JsonPullParser parser) throws IOException,
			JsonFormatException {

		State eventType = parser.getEventType();
		if (eventType == State.VALUE_NULL) {
			return null;
		} else if (eventType == State.VALUE_DOUBLE) {
			return parser.getValueDouble();
		} else {
			throw new IllegalStateException("unexpected state. expected=VALUE_DOUBLE, but get="
					+ eventType.toString());
		}
	}
167770
@Override
    public double getDoubleValue( final String       key,
                                  final double       defaultValue )
    {
        return formatDoubleValue( key, getFormattedPropValue( key ), defaultValue );
    }
377583
public @Nonnull Iterable<Double> doubles() {
        final JsonArray parent=this;
        return () -> {
            final Iterator<JsonElement> iterator = parent.iterator();
            return new Iterator<Double>() {

                @Override
                public boolean hasNext() {
                    return iterator.hasNext();
                }

                @Override
                public Double next() {
                    return iterator.next().asDouble();
                }

                @Override
                public void remove() {
                    iterator.remove();
                }
            };
        };
    }