diff options
author | Pacien TRAN-GIRARD | 2014-02-23 22:31:31 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2014-02-23 22:31:31 +0100 |
commit | 0c5793abf9cf5efe97eed6f778e18171198ff857 (patch) | |
tree | 9961e5e2b1fd34c3871e7ea65236af044b9d1395 | |
parent | f84606424a6d14d9a125aca48de5d5b7934eaa7a (diff) | |
download | esieequest-0c5793abf9cf5efe97eed6f778e18171198ff857.tar.gz |
Use iterator
-rw-r--r-- | src/esieequest/Room.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/esieequest/Room.java b/src/esieequest/Room.java index 0ba71d9..4626490 100644 --- a/src/esieequest/Room.java +++ b/src/esieequest/Room.java | |||
@@ -1,6 +1,7 @@ | |||
1 | package esieequest; | 1 | package esieequest; |
2 | 2 | ||
3 | import java.util.HashMap; | 3 | import java.util.HashMap; |
4 | import java.util.Iterator; | ||
4 | import java.util.Set; | 5 | import java.util.Set; |
5 | 6 | ||
6 | /** | 7 | /** |
@@ -85,9 +86,9 @@ public class Room { | |||
85 | */ | 86 | */ |
86 | public String getExitString() { | 87 | public String getExitString() { |
87 | String vExitString = "Available exits:"; | 88 | String vExitString = "Available exits:"; |
88 | Set<String> keys = this.aExits.keySet(); | 89 | Set<String> vKeys = this.aExits.keySet(); |
89 | for (String exit : keys) { | 90 | for (Iterator<String> vIter = vKeys.iterator(); vIter.hasNext();) { |
90 | vExitString += " " + exit; | 91 | vExitString += " " + vIter.next(); |
91 | } | 92 | } |
92 | vExitString += "."; | 93 | vExitString += "."; |
93 | return vExitString; | 94 | return vExitString; |