KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > DynamicAny > DynFixedHelper


1 package org.omg.DynamicAny;
2
3
4 /**
5 * org/omg/DynamicAny/DynFixedHelper.java .
6 * Generated by the IDL-to-Java compiler (portable), version "3.2"
7 * from ../../../../src/share/classes/org/omg/DynamicAny/DynamicAny.idl
8 * Saturday, February 9, 2008 9:40:12 AM GMT
9 */

10
11
12 /**
13     * DynFixed objects support the manipulation of IDL fixed values.
14     * Because IDL does not have a generic type that can represent fixed types with arbitrary
15     * number of digits and arbitrary scale, the operations use the IDL string type.
16     */

17 abstract public class DynFixedHelper
18 {
19   private static String JavaDoc _id = "IDL:omg.org/DynamicAny/DynFixed:1.0";
20
21   public static void insert (org.omg.CORBA.Any JavaDoc a, org.omg.DynamicAny.DynFixed JavaDoc that)
22   {
23     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
24     a.type (type ());
25     write (out, that);
26     a.read_value (out.create_input_stream (), type ());
27   }
28
29   public static org.omg.DynamicAny.DynFixed JavaDoc extract (org.omg.CORBA.Any JavaDoc a)
30   {
31     return read (a.create_input_stream ());
32   }
33
34   private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
35   synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
36   {
37     if (__typeCode == null)
38     {
39       __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.DynamicAny.DynFixedHelper.id (), "DynFixed");
40     }
41     return __typeCode;
42   }
43
44   public static String JavaDoc id ()
45   {
46     return _id;
47   }
48
49   public static org.omg.DynamicAny.DynFixed JavaDoc read (org.omg.CORBA.portable.InputStream JavaDoc istream)
50   {
51       throw new org.omg.CORBA.MARSHAL JavaDoc ();
52   }
53
54   public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, org.omg.DynamicAny.DynFixed JavaDoc value)
55   {
56       throw new org.omg.CORBA.MARSHAL JavaDoc ();
57   }
58
59   public static org.omg.DynamicAny.DynFixed JavaDoc narrow (org.omg.CORBA.Object JavaDoc obj)
60   {
61     if (obj == null)
62       return null;
63     else if (obj instanceof org.omg.DynamicAny.DynFixed JavaDoc)
64       return (org.omg.DynamicAny.DynFixed JavaDoc)obj;
65     else if (!obj._is_a (id ()))
66       throw new org.omg.CORBA.BAD_PARAM JavaDoc ();
67     else
68     {
69       org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc)obj)._get_delegate ();
70       org.omg.DynamicAny._DynFixedStub JavaDoc stub = new org.omg.DynamicAny._DynFixedStub JavaDoc ();
71       stub._set_delegate(delegate);
72       return stub;
73     }
74   }
75
76   public static org.omg.DynamicAny.DynFixed JavaDoc unchecked_narrow (org.omg.CORBA.Object JavaDoc obj)
77   {
78     if (obj == null)
79       return null;
80     else if (obj instanceof org.omg.DynamicAny.DynFixed JavaDoc)
81       return (org.omg.DynamicAny.DynFixed JavaDoc)obj;
82     else
83     {
84       org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc)obj)._get_delegate ();
85       org.omg.DynamicAny._DynFixedStub JavaDoc stub = new org.omg.DynamicAny._DynFixedStub JavaDoc ();
86       stub._set_delegate(delegate);
87       return stub;
88     }
89   }
90
91 }
92
Popular Tags