Annotation of OpenXM/src/OpenMath/ORG/openxm/tam/CMO_MONOMIAL32.java, Revision 1.1
1.1 ! tam 1: /**
! 2: * $OpenXM$
! 3: */
! 4: package ORG.openxm.tam;
! 5:
! 6: import java.io.*;
! 7: import java.math.BigInteger;
! 8:
! 9: /**
! 10: * CMO $B7A<0$N(B MONOMIAL32 $B7?$rI=$7$^$9(B.
! 11: * $B$3$N%/%i%9$OC19`<0$rI=8=$7$^$9(B.
! 12: */
! 13: final public class CMO_MONOMIAL32 extends CMO{
! 14: private int[] degree;
! 15: private CMO coefficient;
! 16:
! 17: /**
! 18: * $B78?t(B coefficient, $B<!?t(B degree[] $B$H$9$k(B MONOMIAL32 $B$r:n@.$7$^$9(B.
! 19: */
! 20: public CMO_MONOMIAL32(int[] degree,CMO coefficient){
! 21: this.degree = degree;
! 22: this.coefficient = coefficient;
! 23: }
! 24:
! 25: public int DISCRIMINATOR(){
! 26: return CMO.MONOMIAL32;
! 27: }
! 28:
! 29: public void sendByObject(OpenXMconnection os)
! 30: throws IOException,MathcapViolation{
! 31: os.writeInt(degree.length);
! 32: for(int i=0;i<degree.length;i++){
! 33: os.writeInt(degree[i]);
! 34: }
! 35: coefficient.write(os);
! 36: }
! 37:
! 38: static protected CMO receive(OpenXMconnection is) throws IOException{
! 39: int n;
! 40: int[] degree;
! 41: CMO coefficient;
! 42:
! 43: n = is.readInt();
! 44: degree = new int[n];
! 45:
! 46: for(int i=0;i<n;i++){
! 47: degree[i] = is.readInt();
! 48: }
! 49:
! 50: coefficient = CMO.receive(is);
! 51:
! 52: return new CMO_MONOMIAL32(degree,coefficient);
! 53: }
! 54:
! 55: public String toCMOexpressionByObject(){
! 56: String ret;
! 57:
! 58: ret = "CMO_MONOMIAL32,"+ degree.length;
! 59:
! 60: for(int i=0;i<degree.length;i++){
! 61: ret += ","+ degree[i] ;
! 62: }
! 63:
! 64: return ret +","+ coefficient.toCMOexpression();
! 65: }
! 66:
! 67: /**
! 68: * $B78?t$rF@$^$9(B.
! 69: */
! 70: public CMO getCoefficient(){
! 71: return coefficient;
! 72: }
! 73:
! 74: /**
! 75: * $B<!?t$rF@$^$9(B.
! 76: */
! 77: public int[] getDegree(){
! 78: return degree;
! 79: }
! 80: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>