⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ctsequence.java

📁 UCS (Ultra Corba Simulator) is one more powerful corba client/servant simulator tool than other simi
💻 JAVA
字号:
package com.corba.mnq.tool.idl.type;

import com.corba.mnq.ui.MNQMutableTreeNode;

import java.util.Enumeration;

import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.OutputStream;

public class CTSequence extends TypeBase {

    public CTSequence() {
        super();
        // TODO Auto-generated constructor stub
        valType = "java.lang.Object[]";
    }

    public TypeBase t_in;

    public TypeBase cloneType() {
        CTSequence t = new CTSequence();
        t.disName = disName;
        t.dmtn = dmtn;
        t.dn = dn;
        t.id = id;
        t.rdn = rdn;
        t.val = val;
        if (t_in != null)
            t.t_in = t_in.cloneType();
        return t;
    }

    public TypeCode type() {
        TypeCode __typeCode = orb.create_sequence_tc(0, t_in.type());
        __typeCode = orb.create_alias_tc(id, rdn, __typeCode);
        return __typeCode;
    }

    /**
     * Method: "read"
     * 
     * @param istream
     * @return
     */
    public Object read(org.omg.CORBA.portable.InputStream istream) {
        int len = istream.read_long();

        try {
            int x = istream.available();
            if (x > 0 && len > x) { throw new org.omg.CORBA.MARSHAL(
                    "Sequence length too large. Only " + x + " available and trying to assign "
                            + len); }
        } catch (java.io.IOException e) {
        }

        Object[] val = new Object[len];
        for (int i = 0; i < len; i++) {
            val[i] = t_in.read(istream);
        }
        return val;
    }

    public void write(OutputStream ostream, Object value) {
        // TODO Auto-generated method stub
        Object[] val = (Object[]) value;

        ostream.write_long(val.length);
        for (int _i0 = 0; _i0 < val.length; ++_i0) {
            t_in.write(ostream, val[_i0]);
        }
    }

    public boolean compare(TypeBase t) {
        if (!selected)
            return true;
        if (!type().equal(t.type()))
            return false;

        return true;
    }

    public void getValueFromTree() {
        Object[] tmp = new Object[dmtn.getChildCount()];

        int i = 0;
        for (Enumeration e = dmtn.children(); e.hasMoreElements();) {
            TypeBase tn = (TypeBase) (((MNQMutableTreeNode) e.nextElement()).getUserObject());
            tn.getValueFromTree();
            tmp[i] = tn.val;
            i++;
        }
        val = tmp;
    }
}
/* EOF */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -