1 23 24 28 package com.sun.jts.jtsxa; 29 30 31 37 38 39 abstract public class OTSResourceHelper 41 { 42 private static String _id = "IDL:jtsxa/OTSResource:1.0"; 43 44 public static void insert (org.omg.CORBA.Any a, com.sun.jts.jtsxa.OTSResource that) 45 { 46 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 47 a.type (type ()); 48 write (out, that); 49 a.read_value (out.create_input_stream (), type ()); 50 } 51 52 public static com.sun.jts.jtsxa.OTSResource extract (org.omg.CORBA.Any a) 53 { 54 return read (a.create_input_stream ()); 55 } 56 57 private static org.omg.CORBA.TypeCode __typeCode = null; 58 synchronized public static org.omg.CORBA.TypeCode type () 59 { 60 if (__typeCode == null) 61 { 62 __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (com.sun.jts.jtsxa.OTSResourceHelper.id (), "OTSResource"); 63 } 64 return __typeCode; 65 } 66 67 public static String id () 68 { 69 return _id; 70 } 71 72 public static com.sun.jts.jtsxa.OTSResource read (org.omg.CORBA.portable.InputStream istream) 73 { 74 return narrow (istream.read_Object (_OTSResourceStub.class)); 75 } 76 77 public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.jts.jtsxa.OTSResource value) 78 { 79 ostream.write_Object ((org.omg.CORBA.Object ) value); 80 } 81 82 public static com.sun.jts.jtsxa.OTSResource narrow (org.omg.CORBA.Object obj) 83 { 84 if (obj == null) 85 return null; 86 else if (obj instanceof com.sun.jts.jtsxa.OTSResource) 87 return (com.sun.jts.jtsxa.OTSResource)obj; 88 else if (!obj._is_a (id ())) 89 throw new org.omg.CORBA.BAD_PARAM (); 90 else 91 { 92 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl )obj)._get_delegate (); 93 com.sun.jts.jtsxa._OTSResourceStub stub = new com.sun.jts.jtsxa._OTSResourceStub (); 94 stub._set_delegate(delegate); 95 return stub; 96 } 97 } 98 99 } 100 | Popular Tags |