Annotation of OpenXM/src/OpenMath/ORG/openxm/tam/CMO_RATIONAL.java, Revision 1.2
1.1 tam 1: /**
1.2 ! tam 2: * $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/CMO_RATIONAL.java,v 1.1 2000/09/12 07:05:06 tam Exp $
1.1 tam 3: */
4: package ORG.openxm.tam;
5:
6: import java.io.*;
7:
8: /**
9: * CMO $B7A<0$N(B RATIONAL $B7?$rI=$7$^$9(B.
10: */
11: public class CMO_RATIONAL extends CMO{
12: private CMO a,b;
13:
14: /**
15: * (a/b) $B$rI=$9(B RATIONAL $B7?$rI=$7$^$9(B.
16: * $B%;%^%s%F%#%C%/%9$N%A%'%C%/$O9T$J$o$l$^$;$s(B.
17: */
18: CMO_RATIONAL(CMO src_a,CMO src_b){
19: a = src_a;
20: b = src_b;
21: }
22:
23: /**
24: * $BJ,;R$rF@$^$9(B.
25: */
26: public CMO getBunshi(){
27: return a;
28: }
29:
30: /**
31: * $BJ,Jl$rF@$^$9(B.
32: */
33: public CMO getBunbo(){
34: return b;
35: }
36:
37: public int DISCRIMINATOR(){
38: return CMO.RATIONAL;
39: }
40:
1.2 ! tam 41: protected void sendByObject(OpenXMstream os)
1.1 tam 42: throws IOException,MathcapViolation{
43: a.write(os);
44: b.write(os);
45: }
46:
1.2 ! tam 47: static protected CMO receive(OpenXMstream is) throws IOException{
1.1 tam 48: CMO a,b;
49:
50: a = CMO.receive(is);
51: b = CMO.receive(is);
52:
53: return new CMO_RATIONAL(a,b);
54: }
55:
56: protected String toCMOexpressionByObject(){
57: return "CMO_RATIONAL,"+ a.toCMOexpression() +","+ b.toCMOexpression();
58: }
59: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>