1 package ist.coach.coachEmfCommon; 2 3 8 9 import org.omg.CORBA.TCKind ; 10 import ist.coach.coachEmfServices.SnmpAdapter.DataType; 11 12 public class DataTypeImpl extends DataType { 13 14 public DataTypeImpl() {} 15 16 public DataTypeImpl(String identifier_, org.omg.CORBA.Any value_) { 17 18 identifier = identifier_; 19 value = value_; 20 } 21 22 public DataTypeImpl(String identifier_, org.omg.CORBA.Any 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 52 } 53 if (this.value.type().kind().value() == org.omg.CORBA.OctetSeqHelper.type().kind().value()) 54 System.err.println(new String (org.omg.CORBA.OctetSeqHelper.extract(value)) + 55 "], (byte[])"); 56 } 57 else 58 System.err.println("Null"); 59 60 } 61 } 62 | Popular Tags |