aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2014-02-23 22:31:31 +0100
committerPacien TRAN-GIRARD2014-02-23 22:31:31 +0100
commit0c5793abf9cf5efe97eed6f778e18171198ff857 (patch)
tree9961e5e2b1fd34c3871e7ea65236af044b9d1395
parentf84606424a6d14d9a125aca48de5d5b7934eaa7a (diff)
downloadesieequest-0c5793abf9cf5efe97eed6f778e18171198ff857.tar.gz
Use iterator
-rw-r--r--src/esieequest/Room.java7
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 @@
1package esieequest; 1package esieequest;
2 2
3import java.util.HashMap; 3import java.util.HashMap;
4import java.util.Iterator;
4import java.util.Set; 5import 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;