/** * Returns the <code>float</code> value of the member with the specified name in this object. If * this object does not contain a member with this name, the given default value is returned. If * this object contains multiple members with the given name, the last one will be picked. If this * member's value does not represent a JSON number or if it cannot be interpreted as Java * <code>float</code>, an exception is thrown. * * @param name * the name of the member whose value is to be returned * @param defaultValue * the value to be returned if the requested member is missing * @return the value of the last member with the specified name, or the given default value if * this object does not contain a member with that name */ public float getFloat(String name, float defaultValue) { JsonValue value = get(name); return value != null ? value.asFloat() : defaultValue; }
@Override public Float read(JsonValue jsonValue) throws Exception { return jsonValue.asFloat(); }
@Override protected Float getValue(JsonValue jsonValue) throws Exception { return jsonValue.asFloat(); }
/** * Returns the <code>float</code> value of the member with the specified name in this object. If * this object does not contain a member with this name, the given default value is returned. If * this object contains multiple members with the given name, the last one will be picked. If this * member's value does not represent a JSON number or if it cannot be interpreted as Java * <code>float</code>, an exception is thrown. * * @param name * the name of the member whose value is to be returned * @param defaultValue * the value to be returned if the requested member is missing * @return the value of the last member with the specified name, or the given default value if * this object does not contain a member with that name */ public float getFloat(String name, float defaultValue) { JsonValue value = get(name); return value != null ? value.asFloat() : defaultValue; }
/** * Returns the <code>float</code> value of the member with the specified name in this object. If * this object does not contain a member with this name, the given default value is returned. If * this object contains multiple members with the given name, the last one will be picked. If this * member's value does not represent a JSON number or if it cannot be interpreted as Java * <code>float</code>, an exception is thrown. * * @param name * the name of the member whose value is to be returned * @param defaultValue * the value to be returned if the requested member is missing * @return the value of the last member with the specified name, or the given default value if * this object does not contain a member with that name */ public float getFloat(String name, float defaultValue) { JsonValue value = get(name); return value != null ? value.asFloat() : defaultValue; }
public Float getAsFloat(final String field){ JsonValue value = getAsJsonValue(field); if (value == null || value.isNull()) { return null; } return value.asFloat(); }
public PointsHolder read(Json json, JsonValue jsonData, Class type) { PointsHolder pointsHolder = new PointsHolder(); for (JsonValue child = jsonData.child; child != null; child = child.next.next) { Vector2 vector2 = new Vector2(); vector2.x = child.asFloat(); vector2.y = child.next.asFloat(); pointsHolder.splinePoints.add(vector2); } return pointsHolder; }
ret = oval.asFloat();
ret = val.asFloat();