KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ir3 > ValueDef_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.ValueDef JavaDoc;
31
32 /**
33  * Implementation of the CORBA::ValueDef 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 ValueDef_ref
42      extends IDLType_ref
43 {
44     // ==================================================================
45
//
46
// Internal state.
47
//
48
// ==================================================================
49

50     // ==================================================================
51
//
52
// Constructors.
53
//
54
// ==================================================================
55

56     /**
57      * TODO.
58      */

59     public
60     ValueDef_ref(IRObject_impl owner)
61     {
62         // Calls the IDLType_ref constructor.
63
super(owner);
64     }
65
66     /**
67      * TODO.
68      */

69     public
70     ValueDef_ref(IRObject_impl owner,
71                  ValueDef_impl value)
72     {
73         // Calls the IDLType_ref constructor.
74
super(owner, value);
75     }
76
77     // ==================================================================
78
//
79
// Static public methods.
80
//
81
// ==================================================================
82

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

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

99     static public String JavaDoc[]
100     computeRepositoryIdSeq(ValueDef_ref[] values)
101     {
102         String JavaDoc[] result = new String JavaDoc[values.length];
103
104         for(int i=0; i<values.length; i++)
105             result[i] = values[i].getId();
106
107         return result;
108     }
109
110     // ==================================================================
111
//
112
// Public methods.
113
//
114
// ==================================================================
115

116     /**
117      * Obtains its implementation.
118      */

119     public ValueDef_impl
120     getImpl()
121     {
122         return (ValueDef_impl)(super.getBaseImpl());
123     }
124
125     /**
126      * Obtains its ValueDef reference.
127      */

128     public ValueDef JavaDoc
129     asValueDef()
130     {
131         if(getTarget() == null) return null;
132         return getImpl().asValueDef();
133     }
134
135     /**
136      * Obtains its repositoryID.
137      */

138     public String JavaDoc
139     getId()
140     {
141         if (getTarget() == null) return "";
142         return getImpl().id();
143     }
144 }
145
Popular Tags