diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-04-21 18:21:10 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-04-21 18:21:10 +0000 |
commit | 4fadf17e23676117a02075ea56a2cda85eb6d32b (patch) | |
tree | 1368d7653620efa5b9aeb89ead44ad1252d6c904 /java/com/xagasoft/gats/GatsBoolean.java | |
parent | f0918e61039a18947a31efe01d23b7607acf9c92 (diff) | |
download | libgats-4fadf17e23676117a02075ea56a2cda85eb6d32b.tar.gz libgats-4fadf17e23676117a02075ea56a2cda85eb6d32b.tar.bz2 libgats-4fadf17e23676117a02075ea56a2cda85eb6d32b.tar.xz libgats-4fadf17e23676117a02075ea56a2cda85eb6d32b.zip |
Boolean is in.
Diffstat (limited to 'java/com/xagasoft/gats/GatsBoolean.java')
-rw-r--r-- | java/com/xagasoft/gats/GatsBoolean.java | 35 |
1 files changed, 35 insertions, 0 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 | ||
6 | public class GatsBoolean extends GatsObject | 6 | public 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 | ||