diff options
Diffstat (limited to '')
-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 | ||