code: public JSONObject toJSONObject(JSONArray names) throws JSONException {
      if (names == null || names.length() == 0 || length() == 0) {
        return null;
      }
      JSONObject jo = new JSONObject();
      for (int i = 0; i < names.length(); i += 1) {
        jo.put(names.getString(i), this.opt(i));
      }
      return jo;
    }
docs: Produce a JSONObject by combining a JSONArray of names with the values of this JSONArray.
  
  @param names
  A JSONArray containing a list of key strings. These will be paired with the values.
  @return A JSONObject, or null if there are no names or if this JSONArray has no values.
  @throws JSONException
  If any of the names are null.