KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ir3 > InterfaceDef_ref


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Philippe Merle.
23 Contributor(s): Mathieu Vadet, Christophe Demarey.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.ir3;
28
29 // Package dependencies
30
import org.omg.CORBA.InterfaceDef JavaDoc;
31
32 /**
33  * Implementation of the CORBA::InterfaceDef reference.
34  *
35  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
36  * <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
37  *
38  * @version 0.4
39  */

40
41 public class InterfaceDef_ref
42      extends IDLType_ref
43 {
44     // ==================================================================
45
//
46
// Constructors.
47
//
48
// ==================================================================
49

50     /**
51      * TODO.
52      */

53     public
54     InterfaceDef_ref(IRObject_impl owner)
55     {
56         // Calls the IDLType_ref constructor.
57
super(owner);
58     }
59
60     /**
61      * TODO.
62      */

63     public
64     InterfaceDef_ref(IRObject_impl owner,
65                      InterfaceDef_impl object)
66     {
67         // Calls the IDLType_ref constructor.
68
super(owner, object);
69     }
70
71     // ==================================================================
72
//
73
// Internal state.
74
//
75
// ==================================================================
76

77     // ==================================================================
78
//
79
// Static public methods.
80
//
81
// ==================================================================
82

83     /**
84      * Cuts the dependency to a set of interfaces.
85      */

86     static public void
87     cutDependencies(InterfaceDef_ref[] itfs)
88     {
89         if (itfs != null)
90         {
91             for(int i=0; i<itfs.length; i++)
92                 itfs[i].cutDependency();
93         }
94     }
95
96     /**
97      * Computes the CORBA::RepositoryIdSeq for an InterfaceDef_ref[].
98      */

99     static public String JavaDoc[]
100     computeRepositoryIdSeq(InterfaceDef_ref[] itfs)
101     {
102         String JavaDoc[] result = new String JavaDoc[itfs.length];
103
104         for(int i=0; i<itfs.length; i++)
105             result[i] = itfs[i].getId();
106
107         return result;
108     }
109
110     /**
111      * Computes the CORBA::InterfaceDefSeq for an InterfaceDef_ref[].
112      */

113     static public InterfaceDef JavaDoc[]
114     computeInterfaceDefSeq(InterfaceDef_ref[] itfs)
115     {
116         InterfaceDef JavaDoc[] result = new InterfaceDef JavaDoc[itfs.length];
117
118         for(int i=0; i<itfs.length; i++)
119              result[i] = itfs[i].asInterfaceDef();
120
121         return result;
122     }
123
124     // ==================================================================
125
//
126
// Public methods.
127
//
128
// ==================================================================
129

130     /**
131      * Obtains its implementation.
132      */

133     public InterfaceDef_impl
134     getImpl()
135     {
136         return (InterfaceDef_impl)(super.getBaseImpl());
137     }
138
139     /**
140      * Obtains its CORBA::InterfaceDef reference.
141      */

142     public InterfaceDef JavaDoc
143     asInterfaceDef()
144     {
145         if (getTarget() == null) return null;
146         return getImpl().asInterfaceDef();
147     }
148
149     /**
150      * Obtains its repository ID.
151      */

152     public String JavaDoc
153     getId()
154     {
155         if (getTarget() == null) return "";
156         return getImpl().id();
157     }
158 }
159
Popular Tags