Produce a JSONArray containing the values of the members of this JSONObject. @param names A JSONArray containing a list of key strings. This determines the sequence of the values in the result. @return A JSONArray of values. @throws JSONException If any of the valu
(JSONArray names)
| 2234 | * If any of the values are non-finite numbers. |
| 2235 | */ |
| 2236 | public JSONArray toJSONArray(JSONArray names) throws JSONException { |
| 2237 | if (names == null || names.isEmpty()) { |
| 2238 | return null; |
| 2239 | } |
| 2240 | JSONArray ja = new JSONArray(); |
| 2241 | for (int i = 0; i < names.length(); i += 1) { |
| 2242 | ja.put(this.opt(names.getString(i))); |
| 2243 | } |
| 2244 | return ja; |
| 2245 | } |
| 2246 | |
| 2247 | /** |
| 2248 | * Make a JSON text of this JSONObject. For compactness, no whitespace is |