MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / names

Method names

src/main/java/com/volmit/adapt/util/JSONObject.java:1018–1025  ·  view source on GitHub ↗

Produce a JSONArray containing the names of the elements of this JSONObject. @return A JSONArray containing the key strings, or null if the JSONObject is empty.

()

Source from the content-addressed store, hash-verified

1016 * is empty.
1017 */
1018 public JSONArray names() {
1019 JSONArray ja = new JSONArray();
1020 Iterator<String> keys = this.keys();
1021 while (keys.hasNext()) {
1022 ja.put(keys.next());
1023 }
1024 return ja.length() == 0 ? null : ja;
1025 }
1026
1027 /**
1028 * Get an optional value associated with a key.

Callers

nothing calls this directly

Calls 5

keysMethod · 0.95
putMethod · 0.95
lengthMethod · 0.95
hasNextMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected