From e3efaf2a9ad82deb1644ccab8c1469719a0c5b65 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 16 Jan 2012 02:31:34 +0000 Subject: Lots of documentation, an example program, and also some visibility cleanup. --- java/com/xagasoft/gats/GatsBoolean.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'java/com/xagasoft/gats/GatsBoolean.java') 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; import java.io.InputStream; import java.io.OutputStream; +/** + * Represents a boolean value. This is probably the simplest of all Gats + * objects. It can be true or false. + */ public class GatsBoolean extends GatsObject { private boolean bValue = false; + /** + * Construct a new GatsBoolean, the default value is false. + */ public GatsBoolean() { } + /** + * Construct a new GatsBoolean, specify the value.; + */ public GatsBoolean( boolean bValue ) { this.bValue = bValue; } + /** + * Get the current value, either true or false. + */ public boolean getValue() { return bValue; } + /** + * Set the value. + */ public void setValue( boolean bValue ) { this.bValue = bValue; @@ -36,7 +52,7 @@ public class GatsBoolean extends GatsObject return "" + bValue; } - public void read( InputStream is, char cType ) throws java.io.IOException + void read( InputStream is, char cType ) throws java.io.IOException { if( cType == '0' ) bValue = false; @@ -44,7 +60,7 @@ public class GatsBoolean extends GatsObject bValue = true; } - public void write( OutputStream os ) throws java.io.IOException + void write( OutputStream os ) throws java.io.IOException { if( bValue ) os.write( (int)'1' ); -- cgit v1.2.3