Mercurial Hosting > luan
comparison core/src/luan/LuanPropertyMeta.java @ 413:8937263f59f6
add __pairs;
add back HttpServicer.get_parameter_values;
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 29 Apr 2015 19:01:18 -0600 |
parents | 1b38de2b1845 |
children | ce8e19567911 |
comparison
equal
deleted
inserted
replaced
412:094f37c5e6f9 | 413:8937263f59f6 |
---|---|
1 package luan; | 1 package luan; |
2 | 2 |
3 import java.util.Map; | |
4 import java.util.Iterator; | |
3 | 5 |
4 public class LuanPropertyMeta extends LuanMeta implements DeepCloneable<LuanPropertyMeta> { | 6 |
7 public final class LuanPropertyMeta extends LuanMeta implements DeepCloneable<LuanPropertyMeta> { | |
5 private LuanTable getters; | 8 private LuanTable getters; |
6 private LuanTable setters; | 9 private LuanTable setters; |
7 | 10 |
8 private LuanPropertyMeta() {} | 11 private LuanPropertyMeta() {} |
9 | 12 |
39 throw luan.exception("get for '"+key+"' isn't a function"); | 42 throw luan.exception("get for '"+key+"' isn't a function"); |
40 LuanFunction fn = (LuanFunction)obj; | 43 LuanFunction fn = (LuanFunction)obj; |
41 return luan.call(fn); | 44 return luan.call(fn); |
42 } | 45 } |
43 | 46 |
47 @Override protected Iterator keys() { | |
48 return new Iterator() { | |
49 final Iterator<Map.Entry<Object,Object>> iter = getters.iterator(); | |
50 | |
51 @Override public boolean hasNext() { | |
52 return iter.hasNext(); | |
53 } | |
54 @Override public Object next() { | |
55 return iter.next().getKey(); | |
56 } | |
57 @Override public void remove() { | |
58 throw new UnsupportedOperationException(); | |
59 } | |
60 }; | |
61 } | |
62 | |
63 | |
44 @Override public boolean canNewindex() { | 64 @Override public boolean canNewindex() { |
45 return true; | 65 return true; |
46 } | 66 } |
47 | 67 |
48 @Override public void __newindex(LuanState luan,LuanTable tbl,Object key,Object value) throws LuanException { | 68 @Override public void __newindex(LuanState luan,LuanTable tbl,Object key,Object value) throws LuanException { |