# HG changeset patch # User Tom Rodriguez # Date 1422477550 28800 # Node ID ea1351d22e5544c007576a67e32fa256cbee1637 # Parent 4f3c6cc1794a4c4df6a0c180113fab6e7648eef5 Added entrySet and keySet to NodeNodeMap diff -r 4f3c6cc1794a -r ea1351d22e55 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeNodeMap.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeNodeMap.java Wed Jan 28 12:09:13 2015 -0800 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeNodeMap.java Wed Jan 28 12:39:10 2015 -0800 @@ -55,7 +55,11 @@ } public Set keySet() { - throw new UnsupportedOperationException("Cannot get key set from this map"); + HashSet entries = new HashSet<>(); + for (Map.Entry entry : entries()) { + entries.add(entry.getKey()); + } + return entries; } public Collection values() { @@ -69,7 +73,11 @@ return result; } - public Set> entrySet() { - throw new UnsupportedOperationException("Cannot get entry set for this map"); + public Set> entrySet() { + HashSet> entries = new HashSet<>(); + for (Map.Entry entry : entries()) { + entries.add(entry); + } + return entries; } }