Annotation of OpenXM/src/OpenMath/ORG/openxm/tam/CMO_RATIONAL.java, Revision 1.3
1.1 tam 1: /**
1.3 ! ohara 2: * $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/CMO_RATIONAL.java,v 1.2 2000/09/13 06:32:43 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: }
1.3 ! ohara 40:
! 41: public boolean allowQ (int[] datacap) {
! 42: return CMO.allowQ_tag(datacap, DISCRIMINATOR()) && a.allowQ(datacap)
! 43: && b.allowQ(datacap);
! 44: }
1.1 tam 45:
1.2 tam 46: protected void sendByObject(OpenXMstream os)
1.1 tam 47: throws IOException,MathcapViolation{
48: a.write(os);
49: b.write(os);
50: }
51:
1.2 tam 52: static protected CMO receive(OpenXMstream is) throws IOException{
1.1 tam 53: CMO a,b;
54:
55: a = CMO.receive(is);
56: b = CMO.receive(is);
57:
58: return new CMO_RATIONAL(a,b);
59: }
60:
61: protected String toCMOexpressionByObject(){
62: return "CMO_RATIONAL,"+ a.toCMOexpression() +","+ b.toCMOexpression();
63: }
64: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>