code: public static JSONObject rowToJSONObject(JSONArray names, JSONTokener x) throws JSONException {
      JSONArray ja = rowToJSONArray(x);
      return ja != null ? ja.toJSONObject(names) : null;
    }
docs: Produce a JSONObject from a row of comma delimited text, using a parallel JSONArray of strings to provides the names of the elements.
  
  @param names
  A JSONArray of names. This is commonly obtained from the first row of a comma delimited text file using the rowToJSONArray method.
  @param x
  A JSONTokener of the source text.
  @return A JSONObject combining the names and values.
  @throws JSONException