comparison core/src/luan/LuanTable.java @ 196:be0275bda373

minor git-svn-id: https://luan-java.googlecode.com/svn/trunk@197 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Thu, 03 Jul 2014 18:03:53 +0000
parents 24ede40ee0aa
children 75750ceb45ee
comparison
equal deleted inserted replaced
195:24ede40ee0aa 196:be0275bda373
16 16
17 public final class LuanTable implements DeepCloneable<LuanTable>, Iterable<Map.Entry<Object,Object>>, LuanRepr { 17 public final class LuanTable implements DeepCloneable<LuanTable>, Iterable<Map.Entry<Object,Object>>, LuanRepr {
18 private Map<Object,Object> map = null; 18 private Map<Object,Object> map = null;
19 private List<Object> list = null; 19 private List<Object> list = null;
20 private LuanTable metatable = null; 20 private LuanTable metatable = null;
21 public MetatableGetter metatableGetter = null; // used for modules
22 21
23 public LuanTable() {} 22 public LuanTable() {}
24 23
25 public LuanTable(LuanTable tbl) { 24 public LuanTable(LuanTable tbl) {
26 if( tbl.map != null ) 25 if( tbl.map != null )
61 @Override public LuanTable shallowClone() { 60 @Override public LuanTable shallowClone() {
62 return new LuanTable(); 61 return new LuanTable();
63 } 62 }
64 63
65 @Override public void deepenClone(LuanTable clone,DeepCloner cloner) { 64 @Override public void deepenClone(LuanTable clone,DeepCloner cloner) {
66 clone.metatableGetter = this.metatableGetter;
67 if( map != null ) { 65 if( map != null ) {
68 clone.map = new HashMap<Object,Object>(); 66 clone.map = new HashMap<Object,Object>();
69 for( Map.Entry<Object,Object> entry : map.entrySet() ) { 67 for( Map.Entry<Object,Object> entry : map.entrySet() ) {
70 clone.map.put( cloner.get(entry.getKey()), cloner.get(entry.getValue()) ); 68 clone.map.put( cloner.get(entry.getKey()), cloner.get(entry.getValue()) );
71 } 69 }