/** Finds the child with the specified index and returns it as a float. * @throws IllegalArgumentException if the child was not found. */ public float getFloat (int index) { JsonValue child = get(index); if (child == null) throw new IllegalArgumentException("Indexed value not found: " + name); return child.asFloat(); }
/** Finds the child with the specified name and returns it as a float. * @throws IllegalArgumentException if the child was not found. */ public float getFloat (String name) { JsonValue child = get(name); if (child == null) throw new IllegalArgumentException("Named value not found: " + name); return child.asFloat(); }
/** Finds the child with the specified index and returns it as a float. * @throws IllegalArgumentException if the child was not found. */ public float getFloat (int index) { JsonValue child = get(index); if (child == null) throw new IllegalArgumentException("Indexed value not found: " + name); return child.asFloat(); }
/** Finds the child with the specified name and returns it as a float. * @throws IllegalArgumentException if the child was not found. */ public float getFloat (String name) { JsonValue child = get(name); if (child == null) throw new IllegalArgumentException("Named value not found: " + name); return child.asFloat(); }
/** Finds the child with the specified name and returns it as a float. Returns defaultValue if not found. */ public float getFloat (String name, float defaultValue) { JsonValue child = get(name); return (child == null || !child.isValue() || child.isNull()) ? defaultValue : child.asFloat(); }
/** Finds the child with the specified name and returns it as a float. Returns defaultValue if not found. */ public float getFloat (String name, float defaultValue) { JsonValue child = get(name); return (child == null || !child.isValue() || child.isNull()) ? defaultValue : child.asFloat(); }
if (type == null || type == float.class || type == Float.class) return (T)(Float)jsonData.asFloat(); if (type == int.class || type == Integer.class) return (T)(Integer)jsonData.asInt(); if (type == long.class || type == Long.class) return (T)(Long)jsonData.asLong();
if (type == null || type == float.class || type == Float.class) return (T)(Float)jsonData.asFloat(); if (type == int.class || type == Integer.class) return (T)(Integer)jsonData.asInt(); if (type == long.class || type == Long.class) return (T)(Long)jsonData.asLong();
/** Finds the child with the specified index and returns it as a float. * @throws IllegalArgumentException if the child was not found. */ public float getFloat (int index) { JsonValue child = get(index); if (child == null) throw new IllegalArgumentException("Indexed value not found: " + name); return child.asFloat(); }
/** Finds the child with the specified name and returns it as a float. * @throws IllegalArgumentException if the child was not found. */ public float getFloat (String name) { JsonValue child = get(name); if (child == null) throw new IllegalArgumentException("Named value not found: " + name); return child.asFloat(); }
/** Finds the child with the specified name and returns it as a float. Returns defaultValue if not found. */ public float getFloat (String name, float defaultValue) { JsonValue child = get(name); return (child == null || !child.isValue() || child.isNull()) ? defaultValue : child.asFloat(); }
rbModel.origin.x = newOriginElem.get("x").asFloat(); rbModel.origin.y = newOriginElem.get("y").asFloat(); float x = vertexJson.get("x").asFloat(); float y = vertexJson.get("y").asFloat(); polygonModel.vertices.add(new Vector2(x, y)); rbModel.circles.add(circleModel); circleModel.center.x = circleJson.get("cx").asFloat(); circleModel.center.y = circleJson.get("cy").asFloat(); circleModel.radius = circleJson.get("r").asFloat();
return (T) ((Double) objectRoot.asDouble()); } else if (fieldClass.equals(Float.TYPE) || fieldClass.equals(Float.class)) { return (T) ((Float) objectRoot.asFloat()); } else if (fieldClass.equals(Integer.TYPE) || fieldClass.equals(Integer.class)) { return (T) ((Integer) objectRoot.asInt());
@Override public ScaleFactorModel read(Json json, JsonValue jsonData, Class type) { String suffix = ""; float factor = 1f; TexturePacker.Resampling resampling = TexturePacker.Resampling.bicubic; JsonValue.JsonIterator iterator = jsonData.iterator(); while (iterator.hasNext()) { JsonValue value = iterator.next(); switch (value.name) { case "suffix": suffix = value.asString(); break; case "factor": factor = value.asFloat(); break; case "resampling": resampling = TexturePacker.Resampling.valueOf(value.asString()); break; } } return new ScaleFactorModel(suffix, factor, resampling); } }
if (type == null || type == float.class || type == Float.class) return (T)(Float)jsonData.asFloat(); if (type == int.class || type == Integer.class) return (T)(Integer)jsonData.asInt(); if (type == long.class || type == Long.class) return (T)(Long)jsonData.asLong();