/** * Get the optional double value associated with an index. NaN is returned * if there is no value for the index, or if the value is not a number and * cannot be converted to a number. * * @param index * The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return this.optDouble(index, Double.NaN); }
/** * Returns the value at {@code index} if it exists and is a double or can * be coerced to a double. Returns {@code NaN} otherwise. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Returns the value at {@code index} if it exists and is a double or can be coerced to a double. * Returns {@code NaN} otherwise. * * @param index Which value to get. * @return the value at the specified location. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. NaN is returned * if there is no value for the index, or if the value is not a number and * cannot be converted to a number. * * @param index * The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return this.optDouble(index, Double.NaN); }
@Override public void parseWith(JSONObject data) { super.parseWith(data); if (data != null) { JSONArray jsonCols = data.optJSONArray(KEY_COLS); if (jsonCols != null) { cols = new float[jsonCols.length()]; for (int i = 0; i < cols.length; i++) { cols[i] = (float) jsonCols.optDouble(i, 0); } } else { cols = new float[0]; } JSONArray jsonRows = data.optJSONArray(KEY_ROWS); if (jsonRows != null) { rows = new float[jsonRows.length()]; for (int i = 0; i < rows.length; i++) { rows[i] = (float) jsonRows.optDouble(i, 0); } } else { rows = new float[0]; } } }
@Override public void parseWith(JSONObject data) { super.parseWith(data); if (data != null) { column = data.optInt(KEY_COLUMN, 0); autoExpand = data.optBoolean(KEY_AUTO_EXPAND, false); JSONArray jsonCols = data.optJSONArray(KEY_COLS); if (jsonCols != null) { cols = new float[jsonCols.length()]; for (int i = 0; i < cols.length; i++) { cols[i] = (float) jsonCols.optDouble(i, 0); } } else { cols = new float[0]; } hGap = Style.parseSize(data.optString(KEY_H_GAP), 0); vGap = Style.parseSize(data.optString(KEY_V_GAP), 0); } } }
/** * Get the optional double value associated with an index. NaN is returned * if there is no value for the index, or if the value is not a number and * cannot be converted to a number. * * @param index * The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return this.optDouble(index, Double.NaN); }
/** * Returns the value at {@code index} if it exists and is a double or can * be coerced to a double. Returns {@code NaN} otherwise. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. * NaN is returned if there is no value for the index, * or if the value is not a number and cannot be converted to a number. * * @param index The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. * NaN is returned if there is no value for the index, * or if the value is not a number and cannot be converted to a number. * * @param index The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. NaN is returned * if there is no value for the index, or if the value is not a number and * cannot be converted to a number. * * @param index * The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return this.optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. * NaN is returned if there is no value for the index, * or if the value is not a number and cannot be converted to a number. * * @param index The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. * NaN is returned if there is no value for the index, * or if the value is not a number and cannot be converted to a number. * * @param index The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. * NaN is returned if there is no value for the index, * or if the value is not a number and cannot be converted to a number. * * @param index The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. * NaN is returned if there is no value for the index, * or if the value is not a number and cannot be converted to a number. * * @param index The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. * NaN is returned if there is no value for the index, * or if the value is not a number and cannot be converted to a number. * * @param index The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return this.optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. * NaN is returned if there is no value for the index, * or if the value is not a number and cannot be converted to a number. * * @param index The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. * NaN is returned if there is no value for the index, * or if the value is not a number and cannot be converted to a number. * * @param index The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Returns the value at {@code index} if it exists and is a double or can * be coerced to a double. Returns {@code NaN} otherwise. */ public double optDouble(int index) { return optDouble(index, Double.NaN); }
/** * Get the optional double value associated with an index. NaN is returned * if there is no value for the index, or if the value is not a number and * cannot be converted to a number. * * @param index * The index must be between 0 and length() - 1. * @return The value. */ public double optDouble(int index) { return this.optDouble(index, Double.NaN); }