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();
}

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 ( ) ; }
make a prettyprinted json text of this jsonarray . warning : this method assumes that the data structure is acyclical .
