[BACK]Return to CMO_QQ.java CVS log [TXT][DIR] Up to [local] / OpenXM / src / OpenMath / ORG / openxm / tam

Annotation of OpenXM/src/OpenMath/ORG/openxm/tam/CMO_QQ.java, Revision 1.3

1.1       tam         1: /**
1.3     ! ohara       2:  * $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/CMO_QQ.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: import java.math.BigInteger;
                      8:
                      9: /**
                     10:  * CMO $B7A<0$N(B QQ $B7?$rI=$7$^$9(B.
                     11:  */
                     12: final public class CMO_QQ extends CMO{
                     13:   private CMO_ZZ a,b;
                     14:
                     15:   /**
                     16:    * (a/b) $B$rI=$9(B QQ $B7?$rI=$7$^$9(B.
                     17:    * $B%;%^%s%F%#%/%9$N%A%'%C%/$O9T$J$o$l$^$;$s(B.
                     18:    */
                     19:   public CMO_QQ(CMO_ZZ a,CMO_ZZ b){
                     20:     this.a = a;
                     21:     this.b = b;
                     22:   }
                     23:
                     24:   /**
                     25:    * $BJ,;R$rF@$^$9(B.
                     26:    */
                     27:   public CMO_ZZ getBunshi(){
                     28:     return a;
                     29:   }
                     30:
                     31:   /**
                     32:    * $BJ,Jl$rF@$^$9(B.
                     33:    */
                     34:   public CMO_ZZ getBunbo(){
                     35:     return b;
                     36:   }
                     37:
                     38:   public int DISCRIMINATOR(){
                     39:     return CMO.QQ;
                     40:   }
1.3     ! ohara      41:
        !            42:     public boolean allowQ (int[] datacap) {
        !            43:                return CMO.allowQ_tag(datacap, DISCRIMINATOR()) && a.allowQ(datacap);
        !            44:     }
1.1       tam        45:
                     46:   private int sign(int a){
                     47:     if(a>0){
                     48:       return 1;
                     49:     }else if(a<0){
                     50:       return -1;
                     51:     }
                     52:     return 0;
                     53:   }
                     54:
1.2       tam        55:   protected void sendByObject(OpenXMstream os) throws IOException{
1.1       tam        56:     a.sendByObject(os);
                     57:     b.sendByObject(os);
                     58:   }
                     59:
1.2       tam        60:   static protected CMO receive(OpenXMstream is) throws IOException{
1.1       tam        61:     CMO_ZZ a,b;
                     62:
                     63:     a = (CMO_ZZ)CMO_ZZ.receive(is);
                     64:     b = (CMO_ZZ)CMO_ZZ.receive(is);
                     65:
                     66:     return new CMO_QQ(a,b);
                     67:   }
                     68:
                     69:   protected String toCMOexpressionByObject(){
                     70:     return "CMO_QQ,"+ a.toCMOexpression() +","+ b.toCMOexpression();
                     71:   }
                     72: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>