Mercurial Hosting > luan
changeset 27:9de9be530625
minor
git-svn-id: https://luan-java.googlecode.com/svn/trunk@28 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 06 Dec 2012 20:12:43 +0000 |
parents | 409871b33355 |
children | df923e5835b2 |
files | src/luan/LuaTable.java src/luan/lib/BasicLib.java |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
diff -r 409871b33355 -r 9de9be530625 src/luan/LuaTable.java --- a/src/luan/LuaTable.java Thu Dec 06 10:17:27 2012 +0000 +++ b/src/luan/LuaTable.java Thu Dec 06 20:12:43 2012 +0000 @@ -1,11 +1,12 @@ package luan; +import java.util.Iterator; import java.util.Map; import java.util.HashMap; public class LuaTable { - public final Map<Object,Object> map = new HashMap<Object,Object>(); + private final Map<Object,Object> map = new HashMap<Object,Object>(); @Override public String toString() { return "table: " + Integer.toHexString(hashCode()); @@ -31,4 +32,8 @@ return i; } + public Iterator<Map.Entry<Object,Object>> iterator() { + return map.entrySet().iterator(); + } + }
diff -r 409871b33355 -r 9de9be530625 src/luan/lib/BasicLib.java --- a/src/luan/lib/BasicLib.java Thu Dec 06 10:17:27 2012 +0000 +++ b/src/luan/lib/BasicLib.java Thu Dec 06 20:12:43 2012 +0000 @@ -93,7 +93,7 @@ private final Iterator<Map.Entry<Object,Object>> iter; TableIter(LuaTable t) { - this.iter = t.map.entrySet().iterator(); + this.iter = t.iterator(); } public Object[] next() {