KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > coachEmfCommon > DataTypeImpl


1 package ist.coach.coachEmfCommon;
2
3 /**
4  * @author Administrator (digi@intracom.gr)
5  *
6  * Copyright (c) Intracom S.A., N.T., 2003
7  */

8
9 import org.omg.CORBA.TCKind JavaDoc;
10 import ist.coach.coachEmfServices.SnmpAdapter.DataType;
11
12 public class DataTypeImpl extends DataType {
13
14     public DataTypeImpl() {}
15
16     public DataTypeImpl(String JavaDoc identifier_, org.omg.CORBA.Any JavaDoc value_) {
17
18         identifier = identifier_;
19         value = value_;
20     }
21
22     public DataTypeImpl(String JavaDoc identifier_, org.omg.CORBA.Any JavaDoc value_, byte code_) {
23
24             identifier = identifier_;
25             value = value_;
26             code = code_;
27         }
28
29     public void print() {
30
31         System.err.print("[Identifier: " + this.identifier +
32             ", value: ");
33         if (this.value != null) {
34             switch (this.value.type().kind().value()) {
35
36                 case TCKind._tk_long:
37                     System.err.println(this.value.extract_long() + "], (long)");
38                     break;
39                 case TCKind._tk_longlong:
40                     System.err.println(this.value.extract_longlong() + "], (longlong)");
41                     break;
42                 case TCKind._tk_short:
43                     System.err.println(this.value.extract_short() + "], (short)");
44                     break;
45                 case TCKind._tk_string:
46                     System.err.println(this.value.extract_string() + "], (string)");
47                     break;
48                 default:
49                     break;
50                     //System.err.println(" Unknown]");
51

52             }
53             if (this.value.type().kind().value() == org.omg.CORBA.OctetSeqHelper.type().kind().value())
54               System.err.println(new String JavaDoc(org.omg.CORBA.OctetSeqHelper.extract(value)) +
55                      "], (byte[])");
56         }
57         else
58             System.err.println("Null");
59
60     }
61 }
62
Popular Tags