aboutsummaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-04-21 20:49:23 +0000
committerMike Buland <eichlan@xagasoft.com>2011-04-21 20:49:23 +0000
commit3e86497f740d9b6e2409b4c425da4fc971842873 (patch)
tree3cd2fa27a0517d5aca4c728deff3cc3c1b59c524 /java
parentfa070d1f3a5853105d678324f2902457c917eab1 (diff)
downloadlibgats-3e86497f740d9b6e2409b4c425da4fc971842873.tar.gz
libgats-3e86497f740d9b6e2409b4c425da4fc971842873.tar.bz2
libgats-3e86497f740d9b6e2409b4c425da4fc971842873.tar.xz
libgats-3e86497f740d9b6e2409b4c425da4fc971842873.zip
Many helpers added, we like helpers.
Diffstat (limited to 'java')
-rw-r--r--java/com/xagasoft/gats/GatsDictionary.java51
1 files changed, 51 insertions, 0 deletions
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<String,GatsObject>
90 return hValue.put( arg0, arg1 ); 90 return hValue.put( arg0, arg1 );
91 } 91 }
92 92
93 public GatsObject put( String key, long val )
94 {
95 return hValue.put( key, new GatsInteger( val ) );
96 }
97
98 public GatsObject put( String key, double val )
99 {
100 return hValue.put( key, new GatsFloat( val ) );
101 }
102
103 public GatsObject put( String key, boolean val )
104 {
105 return hValue.put( key, new GatsBoolean( val ) );
106 }
107
108 public GatsObject put( String key, String val )
109 {
110 return hValue.put( key, new GatsString( val ) );
111 }
112
113 public long getInt( String key )
114 {
115 return ((GatsInteger)hValue.get( key )).getValue();
116 }
117
118 public double getFloat( String key )
119 {
120 return ((GatsFloat)hValue.get( key )).getValue();
121 }
122
123 public boolean getBool( String key )
124 {
125 return ((GatsBoolean)hValue.get( key )).getValue();
126 }
127
128 public byte[] getString( String key )
129 {
130 return ((GatsString)hValue.get( key )).getValue();
131 }
132
133 public GatsDictionary getDict( String key )
134 {
135 return (GatsDictionary)hValue.get( key );
136 }
137
138 public GatsList getList( String key )
139 {
140 return (GatsList)hValue.get( key );
141 }
142
143
93 public void putAll( Map<? extends String, ? extends GatsObject> arg0 ) 144 public void putAll( Map<? extends String, ? extends GatsObject> arg0 )
94 { 145 {
95 hValue.putAll( arg0 ); 146 hValue.putAll( arg0 );