KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.omg.DynamicAny;
2
3
4 /**
5 * org/omg/DynamicAny/DynArrayHelper.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     * DynArray objects support the manipulation of IDL arrays.
14     * Note that the dimension of the array is contained in the TypeCode which is accessible
15     * through the type attribute. It can also be obtained by calling the component_count operation.
16     */

17 abstract public class DynArrayHelper
18 {
19   private static String JavaDoc _id = "IDL:omg.org/DynamicAny/DynArray:1.0";
20
21   public static void insert (org.omg.CORBA.Any JavaDoc a, org.omg.DynamicAny.DynArray 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.DynArray 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.DynArrayHelper.id (), "DynArray");
40     }
41     return __typeCode;
42   }
43
44   public static String JavaDoc id ()
45   {
46     return _id;
47   }
48
49   public static org.omg.DynamicAny.DynArray 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.DynArray JavaDoc value)
55   {
56       throw new org.omg.CORBA.MARSHAL JavaDoc ();
57   }
58
59   public static org.omg.DynamicAny.DynArray JavaDoc narrow (org.omg.CORBA.Object JavaDoc obj)
60   {
61     if (obj == null)
62       return null;
63     else if (obj instanceof org.omg.DynamicAny.DynArray JavaDoc)
64       return (org.omg.DynamicAny.DynArray 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._DynArrayStub JavaDoc stub = new org.omg.DynamicAny._DynArrayStub JavaDoc ();
71       stub._set_delegate(delegate);
72       return stub;
73     }
74   }
75
76   public static org.omg.DynamicAny.DynArray 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.DynArray JavaDoc)
81       return (org.omg.DynamicAny.DynArray 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._DynArrayStub JavaDoc stub = new org.omg.DynamicAny._DynArrayStub JavaDoc ();
86       stub._set_delegate(delegate);
87       return stub;
88     }
89   }
90
91 }
92
Popular Tags