diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-01-16 02:31:34 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-01-16 02:31:34 +0000 |
commit | e3efaf2a9ad82deb1644ccab8c1469719a0c5b65 (patch) | |
tree | dc1b3f3c787dd5900e80aaeca1a46cd9696d230b /java/com/xagasoft/gats/GatsBoolean.java | |
parent | 66f972a288916824d9001c1931bf4c5db1bed82b (diff) | |
download | libgats-e3efaf2a9ad82deb1644ccab8c1469719a0c5b65.tar.gz libgats-e3efaf2a9ad82deb1644ccab8c1469719a0c5b65.tar.bz2 libgats-e3efaf2a9ad82deb1644ccab8c1469719a0c5b65.tar.xz libgats-e3efaf2a9ad82deb1644ccab8c1469719a0c5b65.zip |
Lots of documentation, an example program, and also some visibility cleanup.
Diffstat (limited to '')
-rw-r--r-- | java/com/xagasoft/gats/GatsBoolean.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/java/com/xagasoft/gats/GatsBoolean.java b/java/com/xagasoft/gats/GatsBoolean.java index 472db00..7e5d217 100644 --- a/java/com/xagasoft/gats/GatsBoolean.java +++ b/java/com/xagasoft/gats/GatsBoolean.java | |||
@@ -3,24 +3,40 @@ package com.xagasoft.gats; | |||
3 | import java.io.InputStream; | 3 | import java.io.InputStream; |
4 | import java.io.OutputStream; | 4 | import java.io.OutputStream; |
5 | 5 | ||
6 | /** | ||
7 | * Represents a boolean value. This is probably the simplest of all Gats | ||
8 | * objects. It can be true or false. | ||
9 | */ | ||
6 | public class GatsBoolean extends GatsObject | 10 | public class GatsBoolean extends GatsObject |
7 | { | 11 | { |
8 | private boolean bValue = false; | 12 | private boolean bValue = false; |
9 | 13 | ||
14 | /** | ||
15 | * Construct a new GatsBoolean, the default value is false. | ||
16 | */ | ||
10 | public GatsBoolean() | 17 | public GatsBoolean() |
11 | { | 18 | { |
12 | } | 19 | } |
13 | 20 | ||
21 | /** | ||
22 | * Construct a new GatsBoolean, specify the value.; | ||
23 | */ | ||
14 | public GatsBoolean( boolean bValue ) | 24 | public GatsBoolean( boolean bValue ) |
15 | { | 25 | { |
16 | this.bValue = bValue; | 26 | this.bValue = bValue; |
17 | } | 27 | } |
18 | 28 | ||
29 | /** | ||
30 | * Get the current value, either true or false. | ||
31 | */ | ||
19 | public boolean getValue() | 32 | public boolean getValue() |
20 | { | 33 | { |
21 | return bValue; | 34 | return bValue; |
22 | } | 35 | } |
23 | 36 | ||
37 | /** | ||
38 | * Set the value. | ||
39 | */ | ||
24 | public void setValue( boolean bValue ) | 40 | public void setValue( boolean bValue ) |
25 | { | 41 | { |
26 | this.bValue = bValue; | 42 | this.bValue = bValue; |
@@ -36,7 +52,7 @@ public class GatsBoolean extends GatsObject | |||
36 | return "" + bValue; | 52 | return "" + bValue; |
37 | } | 53 | } |
38 | 54 | ||
39 | public void read( InputStream is, char cType ) throws java.io.IOException | 55 | void read( InputStream is, char cType ) throws java.io.IOException |
40 | { | 56 | { |
41 | if( cType == '0' ) | 57 | if( cType == '0' ) |
42 | bValue = false; | 58 | bValue = false; |
@@ -44,7 +60,7 @@ public class GatsBoolean extends GatsObject | |||
44 | bValue = true; | 60 | bValue = true; |
45 | } | 61 | } |
46 | 62 | ||
47 | public void write( OutputStream os ) throws java.io.IOException | 63 | void write( OutputStream os ) throws java.io.IOException |
48 | { | 64 | { |
49 | if( bValue ) | 65 | if( bValue ) |
50 | os.write( (int)'1' ); | 66 | os.write( (int)'1' ); |