/**
     * Make a JSON text String representation of this JSONObject.
     * Think carefully before using this method!  Do you really need
     * a String in memory?  Since JSON is used as a data transport format
     * normally you are going to write the String out to some destination.
     * It is far more efficient to use the <code>write</code> operation
     * on this object directly.  Think about it: you have a tree of JSON
     * objects in memory.  This method will make a copy of all that data
     * into a single string -- a second copy of the data in memory.
     * If all you are going to do is to write that string out to a file,
     * then use the write method to stream it directly to the file.
     * If you are going to send the data from a server to client browser,
     * the write directly to the output stream.  This reduces memory usage.
     * Sometimes you really do need a String, so the method is provided,
     * but use it sparingly.
     * </p><p>
     * The JSON is produced indented by an indentFactor amount specified.
     * If you specify zero indent, the output will be all on a single line.
     * The elements are alphabetized only if an indent is specified.
     * </p><p>
     * Warning: This method assumes that the data structure is acyclical.
     * An exception will be thrown if you have a cycle.
     *
     * @param indentFactor The number of spaces to add to each level of
     *  indentation.
     * @return a printable, displayable, portable, transmittable
     *  representation of the object, beginning
     *  with <code>{</code>&nbsp;<small>(left brace)</small> and ending
     *  with <code>}</code>&nbsp;<small>(right brace)</small>.
     * @throws JSONException If the object contains an invalid number.
     */
public String toString(int indentFactor) {
        try {
            StringWriter w = new StringWriter();
            synchronized (w.getBuffer()) {
                return this.write(w, indentFactor, 0).toString();
            }
        }
        catch (Exception e) {
            //there is no conceivable exception that can come out of this, but throw something
            //just in case.   Want the signature to not have exception in it.
            throw new RuntimeException("Can not serialize JSONObject????", e);
        }
    }
public String toString(int indentFactor) {
try {
StringWriter w = new StringWriter();
synchronized (w.getBuffer()) {
return this.write(w, indentFactor, 0).toString();
}
}
catch (Exception e) {
//there is no conceivable exception that can come out of this, but throw something
//just in case. Want the signature to not have exception in it.
throw new RuntimeException("Can not serialize JSONObject????", e);
}
}
public String toString(int indentFactor) {
try {
StringWriter w = new StringWriter();
synchronized (w.getBuffer()) {
return this.write(w, indentFactor, 0).toString();
}
}
catch (Exception e) {
//there is no conceivable exception that can come out of this, but throw something
//just in case. Want the signature to not have exception in it.
throw new RuntimeException("Can not serialize JSONObject????", e);
}
}
public String toString(int indentFactor) {
try {
StringWriter w = new StringWriter();
synchronized (w.getBuffer()) {
return this.write(w, indentFactor, 0).toString();
}
}
catch (Exception e) {
//there is no conceivable exception that can come out of this, but throw something
//just in case. Want the signature to not have exception in it.
throw new RuntimeException("Can not serialize JSONObject????", e);
}
}