?? ctdeclaration.java
字號:
package com.corba.mnq.tool.idl.type;
import com.corba.mnq.tool.CorbaFacility;
import org.omg.CORBA.Any;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.OutputStream;
public class CTDeclaration extends TypeBase {
public CTDeclaration() {
super();
// TODO Auto-generated constructor stub
}
public TypeBase t_in;
public TypeBase cloneType() {
CTDeclaration t = new CTDeclaration();
t.disName = disName;
t.dmtn = dmtn;
t.dn = dn;
t.id = id;
t.rdn = rdn;
t.val = val;
t.valType = valType;
if (t_in != null)
t.t_in = t_in.cloneType();
return t;
}
/**
* getter for valType
*
* @return Returns the valType.
*/
public String getValType() {
// return t_in.valType;
return t_in.getValType();
}
public TypeCode type() {
// TODO Auto-generated method stub
TypeCode __typeCode = 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) {
Object ret = null;
ret = t_in.read(istream);
return ret;
}
public void write(OutputStream ostream, Object value) {
// TODO Auto-generated method stub
t_in.write(ostream, value);
}
public boolean compare(TypeBase t) {
if (!selected)
return true;
if (!type().equal(t.type()))
return false;
if (!t_in.compare(((CTDeclaration) t).t_in))
return false;
return true;
}
public String toCaseLabel(Object item) {
return t_in.toCaseLabel(item);
}
public void getValueFromTree() {
t_in.getValueFromTree();
val = t_in.val;
}
public void setStrValue(String str) {
t_in.setStrValue(str);
val = t_in.val;
}
/**
* @param args
*/
public static void main_(String[] args) {
try {
// TODO Auto-generated method stub
CTDeclaration test = new CTDeclaration();
CTBasic t1 = new CTBasic();
t1.rdn = "double";
test.t_in = t1;
test.id = "IDL:3gppsa5.org/AlarmIRPConstDefs/One:1.0";
test.rdn = "One";
CTDeclaration t2 = new CTDeclaration();
t2.t_in = test;
t2.id = "IDL:3gppsa5.org/AlarmIRPConstDefs/Two:1.0";
t2.rdn = "Two";
Any a = test.orb.create_any();
;
t2.insert(a, new Double(2.3));
// System.out.println("hehe");
System.out.println(t2.type().content_type().toString());
System.out.println(CorbaFacility.toString(a, true));
} catch (Exception e) {
e.printStackTrace();
}
}
}
/* EOF */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -