Annotation of OpenXM/src/OpenMath/ORG/openxm/tam/CMO_RECURSIVE_POLYNOMIAL.java, Revision 1.3
1.1 tam 1: /**
1.3 ! ohara 2: * $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/CMO_RECURSIVE_POLYNOMIAL.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 RECURSIVE POLYNOMIAL $B7?$rI=$7$^$9(B.
10: */
11: final public class CMO_RECURSIVE_POLYNOMIAL extends CMO{
12: private CMO_LIST variables;
13: private CMO polynomial;
14:
15: /**
16: * $BJQ?t(B variables $B$NB?9`<0(B polynomial $B$r:n@.$7$^$9(B.
17: * $B%;%^%s%F%#%C%/%9$N%A%'%C%/$O9T$J$o$l$^$;$s(B.
18: */
19: public CMO_RECURSIVE_POLYNOMIAL(CMO_LIST variables,CMO polynomial){
20: this.variables = variables;
21: this.polynomial = polynomial;
22: }
23:
24: /**
25: * $BJQ?t$N%j%9%H$rF@$^$9(B.
26: */
27: public CMO_LIST getVariables(){
28: return variables;
29: }
30:
31: /**
32: * $BB?9`<0$rF@$^$9(B.
33: */
34: public CMO getPolynomial(){
35: return polynomial;
36: }
37:
38: public int DISCRIMINATOR(){
39: return CMO.RECURSIVE_POLYNOMIAL;
40: }
1.3 ! ohara 41:
! 42: public boolean allowQ (int[] datacap) {
! 43: return CMO.allowQ_tag(datacap, DISCRIMINATOR())
! 44: && variables.allowQ(datacap)
! 45: && polynomial.allowQ(datacap);
! 46: }
1.1 tam 47:
1.2 tam 48: protected void sendByObject(OpenXMstream os)
1.1 tam 49: throws IOException,MathcapViolation{
50: variables.write(os);
51: polynomial.write(os);
52: }
53:
1.2 tam 54: static protected CMO receive(OpenXMstream is) throws IOException{
1.1 tam 55: CMO_LIST variables;
56: CMO polynomial;
57: CMO tmp;
58:
59: tmp = CMO.receive(is);
60: if(!(tmp instanceof CMO_LIST)){
61: System.err.println("not CMOobject");
62: }
63: variables = (CMO_LIST)tmp;
64:
65: polynomial = CMO.receive(is);
66:
67: return new CMO_RECURSIVE_POLYNOMIAL(variables,polynomial);
68: }
69:
70: protected String toCMOexpressionByObject(){
71: String ret = "CMO_RECURSIVE_POLYNOMIAL";
72:
73: ret += ","+ variables.toCMOexpression();
74: ret += ","+ polynomial.toCMOexpression();
75:
76: return ret;
77: }
78: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>