From 3e86497f740d9b6e2409b4c425da4fc971842873 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 21 Apr 2011 20:49:23 +0000 Subject: Many helpers added, we like helpers. --- java/com/xagasoft/gats/GatsDictionary.java | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'java/com') diff --git a/java/com/xagasoft/gats/GatsDictionary.java b/java/com/xagasoft/gats/GatsDictionary.java index 95ecc45..0ad4c78 100644 --- a/java/com/xagasoft/gats/GatsDictionary.java +++ b/java/com/xagasoft/gats/GatsDictionary.java @@ -90,6 +90,57 @@ public class GatsDictionary extends GatsObject implements Map return hValue.put( arg0, arg1 ); } + public GatsObject put( String key, long val ) + { + return hValue.put( key, new GatsInteger( val ) ); + } + + public GatsObject put( String key, double val ) + { + return hValue.put( key, new GatsFloat( val ) ); + } + + public GatsObject put( String key, boolean val ) + { + return hValue.put( key, new GatsBoolean( val ) ); + } + + public GatsObject put( String key, String val ) + { + return hValue.put( key, new GatsString( val ) ); + } + + public long getInt( String key ) + { + return ((GatsInteger)hValue.get( key )).getValue(); + } + + public double getFloat( String key ) + { + return ((GatsFloat)hValue.get( key )).getValue(); + } + + public boolean getBool( String key ) + { + return ((GatsBoolean)hValue.get( key )).getValue(); + } + + public byte[] getString( String key ) + { + return ((GatsString)hValue.get( key )).getValue(); + } + + public GatsDictionary getDict( String key ) + { + return (GatsDictionary)hValue.get( key ); + } + + public GatsList getList( String key ) + { + return (GatsList)hValue.get( key ); + } + + public void putAll( Map arg0 ) { hValue.putAll( arg0 ); -- cgit v1.2.3