From 71c7539dd36bc997032b0b8852fd1f7620c16248 Mon Sep 17 00:00:00 2001 From: Douglas Crockford Date: Sat, 27 Oct 2012 04:14:06 -0700 Subject: [PATCH] keySet --- JSONObject.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/JSONObject.java b/JSONObject.java index 4f0f190..7ce24dd 100755 --- a/JSONObject.java +++ b/JSONObject.java @@ -37,6 +37,7 @@ import java.util.Iterator; import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; +import java.util.Set; /** * A JSONObject is an unordered collection of name/value pairs. Its external @@ -90,7 +91,7 @@ import java.util.ResourceBundle; * * * @author JSON.org - * @version 2012-10-26 + * @version 2012-10-27 */ public class JSONObject { @@ -702,7 +703,17 @@ public class JSONObject { * @return An iterator of the keys. */ public Iterator keys() { - return this.map.keySet().iterator(); + return this.keySet().iterator(); + } + + + /** + * Get a set of keys of the JSONObject. + * + * @return A keySet. + */ + public Set keySet() { + return this.map.keySet(); }