aboutsummaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-04-21 18:21:10 +0000
committerMike Buland <eichlan@xagasoft.com>2011-04-21 18:21:10 +0000
commit4fadf17e23676117a02075ea56a2cda85eb6d32b (patch)
tree1368d7653620efa5b9aeb89ead44ad1252d6c904 /java
parentf0918e61039a18947a31efe01d23b7607acf9c92 (diff)
downloadlibgats-4fadf17e23676117a02075ea56a2cda85eb6d32b.tar.gz
libgats-4fadf17e23676117a02075ea56a2cda85eb6d32b.tar.bz2
libgats-4fadf17e23676117a02075ea56a2cda85eb6d32b.tar.xz
libgats-4fadf17e23676117a02075ea56a2cda85eb6d32b.zip
Boolean is in.
Diffstat (limited to 'java')
-rw-r--r--java/com/xagasoft/gats/GatsBoolean.java35
-rw-r--r--java/com/xagasoft/gats/GatsInteger.java5
-rw-r--r--java/com/xagasoft/gats/GatsObject.java2
3 files changed, 41 insertions, 1 deletions
diff --git a/java/com/xagasoft/gats/GatsBoolean.java b/java/com/xagasoft/gats/GatsBoolean.java
index ec66a5a..8b0ec52 100644
--- a/java/com/xagasoft/gats/GatsBoolean.java
+++ b/java/com/xagasoft/gats/GatsBoolean.java
@@ -5,17 +5,52 @@ import java.io.OutputStream;
5 5
6public class GatsBoolean extends GatsObject 6public class GatsBoolean extends GatsObject
7{ 7{
8 private boolean bValue = false;
9
10 public GatsBoolean()
11 {
12 }
13
14 public GatsBoolean( boolean bValue )
15 {
16 this.bValue = bValue;
17 }
18
19 public boolean getValue()
20 {
21 return bValue;
22 }
23
24 public void setValue( boolean bValue )
25 {
26 this.bValue = bValue;
27 }
28
8 public int getType() 29 public int getType()
9 { 30 {
10 return GatsObject.BOOLEAN; 31 return GatsObject.BOOLEAN;
11 } 32 }
12 33
34 public String toString()
35 {
36 return "" + bValue;
37 }
38
13 public void read( InputStream is, char cType ) throws java.io.IOException 39 public void read( InputStream is, char cType ) throws java.io.IOException
14 { 40 {
41 if( cType == '0' )
42 bValue = false;
43 else if( cType == '1' )
44 bValue = true;
15 } 45 }
16 46
17 public void write( OutputStream os ) throws java.io.IOException 47 public void write( OutputStream os ) throws java.io.IOException
18 { 48 {
49 if( bValue )
50 os.write( (int)'0' );
51 else
52 os.write( (int)'1' );
53
19 } 54 }
20}; 55};
21 56
diff --git a/java/com/xagasoft/gats/GatsInteger.java b/java/com/xagasoft/gats/GatsInteger.java
index 1093ab2..139e8ab 100644
--- a/java/com/xagasoft/gats/GatsInteger.java
+++ b/java/com/xagasoft/gats/GatsInteger.java
@@ -26,6 +26,11 @@ public class GatsInteger extends GatsObject
26 this.iValue = iValue; 26 this.iValue = iValue;
27 } 27 }
28 28
29 public String toString()
30 {
31 return "" + iValue;
32 }
33
29 public int getType() 34 public int getType()
30 { 35 {
31 return GatsObject.INTEGER; 36 return GatsObject.INTEGER;
diff --git a/java/com/xagasoft/gats/GatsObject.java b/java/com/xagasoft/gats/GatsObject.java
index 1538c93..97c9c12 100644
--- a/java/com/xagasoft/gats/GatsObject.java
+++ b/java/com/xagasoft/gats/GatsObject.java
@@ -33,7 +33,7 @@ public abstract class GatsObject
33 33
34 case '0': 34 case '0':
35 case '1': 35 case '1':
36 // goRet = new GatsBoolean(); 36 goRet = new GatsBoolean();
37 break; 37 break;
38 38
39 case 'l': 39 case 'l':