Mercurial Hosting > luan
diff src/luan/LuanTable.java @ 59:5c9cadd0acce
move standard calls from CmdLine to LuanState
git-svn-id: https://luan-java.googlecode.com/svn/trunk@60 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Mon, 07 Jan 2013 03:36:28 +0000 |
parents | 64ecb7a3aad7 |
children | f7e17cfb35f9 |
line wrap: on
line diff
--- a/src/luan/LuanTable.java Mon Jan 07 00:18:35 2013 +0000 +++ b/src/luan/LuanTable.java Mon Jan 07 03:36:28 2013 +0000 @@ -34,15 +34,15 @@ } } - boolean isList() { + public boolean isList() { return map==null || map.isEmpty(); } - List<Object> asList() { + public List<Object> asList() { return list!=null ? list : Collections.emptyList(); } - Map<Object,Object> asMap() { + public Map<Object,Object> asMap() { if( list == null || list.isEmpty() ) return map!=null ? map : Collections.emptyMap(); Map<Object,Object> rtn = map!=null ? new HashMap<Object,Object>(map) : new HashMap<Object,Object>(); @@ -53,7 +53,7 @@ return rtn; } - boolean isSet() { + public boolean isSet() { if( list != null ) { for( Object obj : list ) { if( obj!=null && !obj.equals(Boolean.TRUE) ) @@ -69,7 +69,7 @@ return true; } - Set<Object> asSet() { + public Set<Object> asSet() { if( list == null || list.isEmpty() ) return map!=null ? map.keySet() : Collections.emptySet(); Set<Object> rtn = map!=null ? new HashSet<Object>(map.keySet()) : new HashSet<Object>();