/** * Make a string from the contents of this JSONArray. The * <code>separator</code> string is inserted between each element. Warning: * This method assumes that the data structure is acyclical. * * @param separator * A string that will be inserted between the elements. * @return a string. * @throws JSONException * If the array contains an invalid number. */ public String join(String separator) throws JSONException { int len = this.length(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < len; i += 1) { if (i > 0) { sb.append(separator); } sb.append(JSONObject.valueToString(this.myArrayList.get(i))); } return sb.toString(); }
/** * Make a string from the contents of this JSONArray. The * <code>separator</code> string is inserted between each element. Warning: * This method assumes that the data structure is acyclical. * * @param separator * A string that will be inserted between the elements. * @return a string. * @throws JSONException * If the array contains an invalid number. */ public String join(String separator) throws JSONException { int len = this.length(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < len; i += 1) { if (i > 0) { sb.append(separator); } sb.append(JSONObject.valueToString(this.myArrayList.get(i))); } return sb.toString(); }
/** * Make a string from the contents of this JSONArray. The * <code>separator</code> string is inserted between each element. Warning: * This method assumes that the data structure is acyclical. * * @param separator * A string that will be inserted between the elements. * @return a string. * @throws JSONException * If the array contains an invalid number. */ public String join(String separator) throws JSONException { int len = this.length(); if (len == 0) { return ""; } StringBuilder sb = new StringBuilder( JSONObject.valueToString(this.myArrayList.get(0))); for (int i = 1; i < len; i++) { sb.append(separator) .append(JSONObject.valueToString(this.myArrayList.get(i))); } return sb.toString(); }
/** * Append an object value. * @param o The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object with a toJSONString() * method. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object o) throws JSONException { return this.append(JSONObject.valueToString(o)); } }
/** * Append an object value. * @param object The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object that implements JSONString. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object object) throws JSONException { return this.append(JSONObject.valueToString(object)); } }
/** * Append an object value. * @param o The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object with a toJSONString() * method. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object o) throws JSONException { return this.append(JSONObject.valueToString(o)); } }
/** * Append an object value. * @param o The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object with a toJSONString() * method. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object o) throws JSONException { return this.append(JSONObject.valueToString(o)); } }
/** * Append an object value. * @param object The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object that implements JSONString. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object object) throws JSONException { return this.append(JSONObject.valueToString(object)); } }
/** * Append an object value. * @param o The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object with a toJSONString() * method. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object o) throws JSONException { return this.append(JSONObject.valueToString(o)); } }
/** * Append an object value. * @param object The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object that implements JSONString. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object object) throws JSONException { return this.append(JSONObject.valueToString(object)); } }
/** * Append an object value. * @param object The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object that implements JSONString. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object object) throws JSONException { return this.append(JSONObject.valueToString(object)); } }
/** * Append an object value. * @param o The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object with a toJSONString() * method. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object o) throws JSONException { return this.append(JSONObject.valueToString(o)); } }
/** * Append an object value. * @param object The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object that implements JSONString. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object object) throws JSONException { return this.append(JSONObject.valueToString(object)); } }
/** * Append an object value. * @param o The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object with a toJSONString() * method. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object o) throws JSONException { return this.append(JSONObject.valueToString(o)); } }
/** * Append an object value. * @param object The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object that implements JSONString. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object object) throws JSONException { return this.append(JSONObject.valueToString(object)); } }
/** * Append an object value. * @param o The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object with a toJSONString() * method. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object o) throws JSONException { return this.append(JSONObject.valueToString(o)); } }
/** * Append an object value. * @param o The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object with a toJSONString() * method. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object o) throws JSONException { return this.append(JSONObject.valueToString(o)); } }
/** * Append an object value. * @param o The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object with a toJSONString() * method. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object o) throws JSONException { return this.append(JSONObject.valueToString(o)); } }
/** * Append an object value. * @param o The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object with a toJSONString() * method. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object o) throws JSONException { return this.append(JSONObject.valueToString(o)); } }
/** * Append an object value. * @param o The object to append. It can be null, or a Boolean, Number, * String, JSONObject, or JSONArray, or an object with a toJSONString() * method. * @return this * @throws JSONException If the value is out of sequence. */ public JSONWriter value(Object o) throws JSONException { return this.append(JSONObject.valueToString(o)); } }