KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > mof > Model > ExposesImpl


1 /**
2  * copyright 2002 2003 Laboratoire d'Informatique Paris 6 (LIP6)
3  *
4  * This file is part of ModFact.
5  *
6  * ModFact is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * at your option) any later version.
10  *
11  * ModFact is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Foobar; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */

21
22 // le Code généré de l'association: Exposes
23
package org.omg.mof.Model ;
24 public class ExposesImpl extends org.omg.mof.Model.ExposesPOA {
25         org.omg.mof.Model._ModelPackage _model_package;
26         //Ajout de la partie RefBaseObject
27
// Operation ref_mof_id
28
public java.lang.String JavaDoc ref_mof_id(){
29             int id = _orb().object_to_string(_this()).hashCode();
30              return String.valueOf(id);
31           }
32           // Operation ref_meta_object
33
public org.omg.mof.Reflective.RefObject ref_meta_object(){
34             throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc("ref_meta_object method not implemented",1 ,org.omg.CORBA.CompletionStatus.COMPLETED_NO);
35             }
36          // Operation ref_itself
37
public boolean ref_itself(org.omg.mof.Reflective.RefBaseObject other_object){
38              String JavaDoc id_obj = other_object.ref_mof_id();
39              if (ref_mof_id().equals(id_obj)) return true;
40              else return false;
41           }
42          // Operation ref_immediate_package
43
public org.omg.mof.Reflective._RefPackage ref_immediate_package(){
44             throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc("ref_immediate_package method not implemented",1 ,org.omg.CORBA.CompletionStatus.COMPLETED_NO);
45          }
46          // Operation ref_outermost_package
47
public org.omg.mof.Reflective._RefPackage ref_outermost_package(){
48          throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc("ref_moutermost_package method not implemented",1 ,org.omg.CORBA.CompletionStatus.COMPLETED_NO);
49           }
50           // Operation ref_delete
51
public void ref_delete() throws org.omg.mof.Reflective.MofError {
52           throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc("ref_delete method not implemented",1 ,org.omg.CORBA.CompletionStatus.COMPLETED_NO);
53           }
54
55         // Operation ref_all_links
56
public org.omg.mof.Reflective.RefObject[][] ref_all_links(){
57               throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc("ref_all_links method not implemented",1 ,org.omg.CORBA.CompletionStatus.COMPLETED_NO);
58             }
59         // Operation ref_link_exists
60
public boolean ref_link_exists(org.omg.mof.Reflective.RefObject[] some_link)
61             throws org.omg.mof.Reflective.MofError{
62              throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc("ref_link_exists method not implemented",1 ,org.omg.CORBA.CompletionStatus.COMPLETED_NO);
63         }
64         // Operation ref_query
65
public org.omg.mof.Reflective.RefObject[] ref_query(org.omg.mof.Reflective.RefObject query_end, org.omg.mof.Reflective.RefObject query_object)
66             throws org.omg.mof.Reflective.MofError{
67             throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc("ref_query method not implemented",1 ,org.omg.CORBA.CompletionStatus.COMPLETED_NO);
68         }
69         // Operation ref_add_link
70
public void ref_add_link(org.omg.mof.Reflective.RefObject[] new_link)
71             throws org.omg.mof.Reflective.MofError{
72             throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc("ref_add_link method not implemented",1 ,org.omg.CORBA.CompletionStatus.COMPLETED_NO);
73         }
74         // Operation ref_add_link_before
75
public void ref_add_link_before(org.omg.mof.Reflective.RefObject[] new_link, org.omg.mof.Reflective.RefObject position_end, org.omg.mof.Reflective.RefObject before)
76             throws org.omg.mof.Reflective.NotFound, org.omg.mof.Reflective.MofError{
77             throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc("ref_add_link_before method not implemented",1 ,org.omg.CORBA.CompletionStatus.COMPLETED_NO);
78           }
79         // Operation ref_modify_link
80
public void ref_modify_link(org.omg.mof.Reflective.RefObject[] old_link, org.omg.mof.Reflective.RefObject position_end, org.omg.mof.Reflective.RefObject new_object)
81             throws org.omg.mof.Reflective.NotFound, org.omg.mof.Reflective.MofError{
82             throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc("ref_modify_link method not implemented",1 ,org.omg.CORBA.CompletionStatus.COMPLETED_NO);
83           }
84         // Operation ref_remove_link
85
public void ref_remove_link(org.omg.mof.Reflective.RefObject[] old_link)
86             throws org.omg.mof.Reflective.NotFound, org.omg.mof.Reflective.MofError {
87             throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc("ref_remove_link method not implemented",1 ,org.omg.CORBA.CompletionStatus.COMPLETED_NO);
88          }
89         private java.util.Vector JavaDoc _all_exposes = new java.util.Vector JavaDoc();
90         // Operation all_is_of_type_links
91
public org.omg.mof.Model.ExposesLink[] all_exposes_Links() throws org.omg.mof.Reflective.MofError {
92         org.omg.mof.Model.ExposesLink[] temp1 = new org.omg.mof.Model.ExposesLink [_all_exposes.size()];
93         for (int i=0; i< _all_exposes.size();i++) temp1[i]= (org.omg.mof.Model.ExposesLink)_all_exposes.elementAt(i);
94         return temp1;
95          }
96         //Operation exists
97
public boolean exists(org.omg.mof.Model.Reference referrer, org.omg.mof.Model.AssociationEnd referenced_end) throws org.omg.mof.Reflective.MofError {
98         boolean exist = false;
99         int i= 0;
100         while((i< _all_exposes.size())&& !exist){
101             org.omg.mof.Model.ExposesLink temp1 = (org.omg.mof.Model.ExposesLink)_all_exposes.elementAt(i);
102             if (temp1.referrer._is_equivalent(referrer) && temp1.referenced_end._is_equivalent(referenced_end)) exist = true;
103             i++;
104         }
105         return exist ;
106         }
107         // Operation referrer
108
public org.omg.mof.Model.Reference[] referrer (org.omg.mof.Model.AssociationEnd referenced_end) throws org.omg.mof.Reflective.MofError {
109         java.util.Vector JavaDoc temp1 = new java.util.Vector JavaDoc();
110         for (int i=0; i< _all_exposes.size(); i++){
111             org.omg.mof.Model.ExposesLink temp2 = (org.omg.mof.Model.ExposesLink)_all_exposes.elementAt(i);
112             if (temp2.referenced_end._is_equivalent(referenced_end)) temp1.addElement(temp2.referrer);
113         }
114         org.omg.mof.Model.Reference[] temp3 = new org.omg.mof.Model.Reference[temp1.size()];
115         for (int i=0; i< temp1.size();i++) temp3[i]= (org.omg.mof.Model.Reference)temp1.elementAt(i);
116         return temp3;
117         }
118         // Operation referenced_end
119
public org.omg.mof.Model.AssociationEnd referenced_end(org.omg.mof.Model.Reference referrer) throws org.omg.mof.Reflective.MofError {
120         boolean exist = false;
121         int i= 0;
122         org.omg.mof.Model.ExposesLink temp1 = null;
123         while((i< _all_exposes.size())&& !exist){
124             temp1= (org.omg.mof.Model.ExposesLink)_all_exposes.elementAt(i);
125             if (temp1.referrer._is_equivalent(referrer)) exist = true;
126             i++;
127         }
128         return temp1.referenced_end;
129         }
130         // Operation add
131
public void add(org.omg.mof.Model.Reference referrer, org.omg.mof.Model.AssociationEnd referenced_end) throws org.omg.mof.Reflective.MofError {
132         org.omg.mof.Model.ExposesLink temp = new org.omg.mof.Model.ExposesLink(referrer, referenced_end);
133         _all_exposes.addElement(temp);
134         }
135         // Operation modifyreferrer
136
public void modify_referrer(org.omg.mof.Model.Reference referrer, org.omg.mof.Model.AssociationEnd referenced_end, org.omg.mof.Model.Reference new_referrer) throws org.omg.mof.Reflective.NotFound, org.omg.mof.Reflective.MofError{
137         boolean exist = false;
138         int i= 0;
139         while((i< _all_exposes.size())&& !exist){
140             org.omg.mof.Model.ExposesLink temp1= (org.omg.mof.Model.ExposesLink)_all_exposes.elementAt(i);
141             if (temp1.referrer._is_equivalent(referrer) && temp1.referenced_end._is_equivalent(referenced_end)) exist = true;
142             i++;
143         }
144         if(exist) {
145         org.omg.mof.Model.ExposesLink temp = new org.omg.mof.Model.ExposesLink(new_referrer, referenced_end);
146         _all_exposes.setElementAt(temp, i-1);
147         }
148         else throw new org.omg.mof.Reflective.NotFound() ;
149         }
150         // Operation modifyreferrer
151
public void modify_referenced_end (org.omg.mof.Model.Reference referrer, org.omg.mof.Model.AssociationEnd referenced_end, org.omg.mof.Model.AssociationEnd new_referenced_end) throws org.omg.mof.Reflective.NotFound, org.omg.mof.Reflective.MofError{
152         boolean exist = false;
153         int i= 0;
154         while((i< _all_exposes.size())&& !exist){
155             org.omg.mof.Model.ExposesLink temp1= (org.omg.mof.Model.ExposesLink)_all_exposes.elementAt(i);
156             if (temp1.referrer._is_equivalent(referrer) && temp1.referenced_end._is_equivalent(referenced_end)) exist = true;
157             i++;
158         }
159         if(exist) {
160         org.omg.mof.Model.ExposesLink temp = new org.omg.mof.Model.ExposesLink(referrer, new_referenced_end);
161         _all_exposes.setElementAt(temp, i-1);
162         }
163         else throw new org.omg.mof.Reflective.NotFound() ;
164         }
165     public void remove (org.omg.mof.Model.Reference referrer, org.omg.mof.Model.AssociationEnd referenced_end) throws org.omg.mof.Reflective.NotFound, org.omg.mof.Reflective.MofError{
166         boolean exist = false;
167         int i= 0;
168         while((i< _all_exposes.size())&& !exist){
169             org.omg.mof.Model.ExposesLink temp1= (org.omg.mof.Model.ExposesLink)_all_exposes.elementAt(i);
170             if (temp1.referrer._is_equivalent(referrer) && temp1.referenced_end._is_equivalent(referenced_end)) exist = true;
171             i++;
172         }
173         if(exist) {
174         _all_exposes.removeElementAt(i-1);
175         }
176         else throw new org.omg.mof.Reflective.NotFound() ;
177         }
178 }
179
Popular Tags