aboutsummaryrefslogtreecommitdiff
path: root/java/com/xagasoft/gats/GatsBoolean.java
blob: 472db00586a81786a45ac2caae8e5fb5192ac522 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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)'1' );
		else
			os.write( (int)'0' );

	}
};