diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-04-21 17:40:13 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-04-21 17:40:13 +0000 |
commit | 4fb4a056c52d3a96b6ef9a4ceb5ce39fc716a9aa (patch) | |
tree | 138b749f3e209d61a63abd1258947850404ca87d /java/com/xagasoft/gats/GatsObject.java | |
parent | 49216a230c331791b06df1527c3245c88e991c20 (diff) | |
download | libgats-4fb4a056c52d3a96b6ef9a4ceb5ce39fc716a9aa.tar.gz libgats-4fb4a056c52d3a96b6ef9a4ceb5ce39fc716a9aa.tar.bz2 libgats-4fb4a056c52d3a96b6ef9a4ceb5ce39fc716a9aa.tar.xz libgats-4fb4a056c52d3a96b6ef9a4ceb5ce39fc716a9aa.zip |
It...builds?
Diffstat (limited to 'java/com/xagasoft/gats/GatsObject.java')
-rw-r--r-- | java/com/xagasoft/gats/GatsObject.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/java/com/xagasoft/gats/GatsObject.java b/java/com/xagasoft/gats/GatsObject.java index 63fcf36..852a18c 100644 --- a/java/com/xagasoft/gats/GatsObject.java +++ b/java/com/xagasoft/gats/GatsObject.java | |||
@@ -1,6 +1,7 @@ | |||
1 | package com.xagasoft.gats; | 1 | package com.xagasoft.gats; |
2 | 2 | ||
3 | import java.io.InputStream; | 3 | import java.io.InputStream; |
4 | import java.io.OutputStream; | ||
4 | 5 | ||
5 | public abstract class GatsObject | 6 | public abstract class GatsObject |
6 | { | 7 | { |
@@ -13,45 +14,45 @@ public abstract class GatsObject | |||
13 | 14 | ||
14 | public abstract int getType(); | 15 | public abstract int getType(); |
15 | 16 | ||
16 | public abstract void read( InputStream is, char cType ); | 17 | public abstract void read( InputStream is, char cType ) throws java.io.IOException; |
17 | 18 | ||
18 | public static GatsObject read( InputStream is ) | 19 | public static GatsObject read( InputStream is ) throws java.io.IOException |
19 | { | 20 | { |
20 | char type = is.read(); | 21 | char type = (char)is.read(); |
21 | GatsObject goRet; | 22 | GatsObject goRet = null; |
22 | switch( type ) | 23 | switch( type ) |
23 | { | 24 | { |
24 | case 'i': | 25 | case 'i': |
25 | goRet = new Integer(); | 26 | goRet = new GatsInteger(); |
26 | break; | 27 | break; |
27 | 28 | ||
28 | case 's': | 29 | case 's': |
29 | goRet = new String(); | 30 | // goRet = new GatsString(); |
30 | break; | 31 | break; |
31 | 32 | ||
32 | case '0': | 33 | case '0': |
33 | case '1': | 34 | case '1': |
34 | goRet = new Boolean(); | 35 | // goRet = new GatsBoolean(); |
35 | break; | 36 | break; |
36 | 37 | ||
37 | case 'l': | 38 | case 'l': |
38 | goRet = new List(); | 39 | // goRet = new GatsList(); |
39 | break; | 40 | break; |
40 | 41 | ||
41 | case 'd': | 42 | case 'd': |
42 | goRet = new Dictionary(); | 43 | // goRet = new GatsDictionary(); |
43 | break; | 44 | break; |
44 | 45 | ||
45 | case 'f': | 46 | case 'f': |
46 | case 'F': | 47 | case 'F': |
47 | goRet = new Float(); | 48 | // goRet = new GatsFloat(); |
48 | break; | 49 | break; |
49 | 50 | ||
50 | case 'e': | 51 | case 'e': |
51 | return null; | 52 | return null; |
52 | 53 | ||
53 | default: | 54 | default: |
54 | throw new Exception("Invalid gats type discovered: " + (char)type ); | 55 | throw new java.io.IOException("Invalid gats type discovered: " + (char)type ); |
55 | } | 56 | } |
56 | 57 | ||
57 | goRet.read( is, type ); | 58 | goRet.read( is, type ); |