package com.xagasoft.gats; import java.io.InputStream; import java.io.OutputStream; public class GatsBoolean extends GatsObject { private boolean bValue = false; public GatsBoolean() { } public GatsBoolean( boolean bValue ) { this.bValue = bValue; } public boolean getValue() { return bValue; } public void setValue( boolean bValue ) { this.bValue = bValue; } public int getType() { return GatsObject.BOOLEAN; } public String toString() { return "" + bValue; } public void read( InputStream is, char cType ) throws java.io.IOException { if( cType == '0' ) bValue = false; else if( cType == '1' ) bValue = true; } public void write( OutputStream os ) throws java.io.IOException { if( bValue ) os.write( (int)'0' ); else os.write( (int)'1' ); } };