MCPcopy
hub / github.com/google/gson / getAsDouble

Method getAsDouble

src/main/java/com/google/gson/JsonPrimitive.java:200–203  ·  view source on GitHub ↗

convenience method to get this element as a primitive double. @return get this element as a primitive double. @throws NumberFormatException if the value contained is not a valid double.

()

Source from the content-addressed store, hash-verified

198 * @throws NumberFormatException if the value contained is not a valid double.
199 */
200 @Override
201 public double getAsDouble() {
202 return isNumber() ? getAsNumber().doubleValue() : Double.parseDouble(getAsString());
203 }
204
205 /**
206 * convenience method to get this element as a {@link BigDecimal}.

Callers 2

testExponentialMethod · 0.95

Calls 3

isNumberMethod · 0.95
getAsNumberMethod · 0.95
getAsStringMethod · 0.95

Tested by 2

testExponentialMethod · 0.76