JSONStringer close(Scope empty,Scope nonempty,String closeBracket) throws JSONException {
  Scope context=peek();
  if (context != nonempty && context != empty) {
    throw new JSONException("Nesting problem");
  }
  stack.remove(stack.size() - 1);
  if (context == nonempty) {
    newline();
  }
  out.append(closeBracket);
  return this;
}

JSONStringer close ( Scope empty , Scope nonempty , String closeBracket ) throws JSONException { Scope context = peek ( ) ; if ( context != nonempty && context != empty ) { throw new JSONException ( "Nesting problem" ) ; } stack . remove ( stack . size ( ) - 1 ) ; if ( context == nonempty ) { newline ( ) ; } out . append ( closeBracket ) ; return this ; }
closes the current scope by appending any necessary whitespace and the given bracket .
