?? ctsequence.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 + -