question: String toString ( int indentFactor , int indent ) throws JSONException { int len = length ( ) ; if ( len == 0 ) { return "[]" ; } int i ; StringBuffer sb = new StringBuffer ( "[" ) ; if ( len == 1 ) { sb . append ( JSONObject . valueToString ( get ( 0 ) , indentFactor , indent ) ) ; } else { int newindent = indent + indentFactor ; sb . append ( '\n' ) ; for ( i = 0 ; i < len ; i += 1 ) { if ( i > 0 ) { sb . append ( ",\n" ) ; } for ( int j = 0 ; j < newindent ; j += 1 ) { sb . append ( ' ' ) ; } sb . append ( JSONObject . valueToString ( get ( i ) , indentFactor , newindent ) ) ; } sb . append ( '\n' ) ; for ( i = 0 ; i < indent ; i += 1 ) { sb . append ( ' ' ) ; } } sb . append ( ']' ) ; return sb . toString ( ) ; }
target:  Make a prettyprinted JSON text of this JSONArray. Warning: This method assumes that the data structure is acyclical.