Annotation of OpenXM/src/OpenMath/ORG/openxm/tam/CMO_LIST.java, Revision 1.1
1.1 ! tam 1: /**
! 2: * $OpenXM$
! 3: */
! 4: package ORG.openxm.tam;
! 5:
! 6: import java.io.*;
! 7:
! 8: /**
! 9: * CMO $B7A<0$N(B LIST $B7?$rI=$7$^$9(B.
! 10: */
! 11: final public class CMO_LIST extends CMO{
! 12: private CMO ob[];
! 13:
! 14: /**
! 15: * CMO $BG[Ns(B src $B$rMWAG$H$9$k(B LIST $B$r:n@.$7$^$9(B.
! 16: */
! 17: public CMO_LIST(CMO[] src){
! 18: ob = src;
! 19: }
! 20:
! 21: /**
! 22: * $BMWAG$rF@$^$9(B.
! 23: */
! 24: public CMO[] getElements(){
! 25: return ob;
! 26: }
! 27:
! 28: public int DISCRIMINATOR(){
! 29: return CMO.LIST;
! 30: }
! 31:
! 32: public void sendByObject(OpenXMconnection os)
! 33: throws IOException,MathcapViolation{
! 34: os.writeInt(ob.length);
! 35:
! 36: for(int i=0;i<ob.length;i++){
! 37: ob[i].write(os);
! 38: }
! 39: }
! 40:
! 41: static protected CMO receive(OpenXMconnection is) throws IOException{
! 42: int len;
! 43: CMO[] ob;
! 44:
! 45: len = is.readInt();
! 46: ob = new CMO[len];
! 47:
! 48: for(int i=0;i<len;i++){
! 49: ob[i] = CMO.receive(is);
! 50: }
! 51:
! 52: return new CMO_LIST(ob);
! 53: }
! 54:
! 55: public String toCMOexpressionByObject(){
! 56: String str = "";
! 57:
! 58: for(int i=0;i<ob.length;i++){
! 59: //System.err.print(":"+ ob[i]);
! 60: str += ","+ ob[i].toCMOexpression();
! 61: }
! 62:
! 63: return "CMO_LIST,"+ ob.length + str;
! 64: }
! 65: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>