1 26 27 package org.objectweb.openccm.ast.lib; 28 29 import org.objectweb.openccm.ast.api.DeclarationKind; 31 import org.objectweb.openccm.ast.api.Declaration; 32 import org.objectweb.openccm.ast.api.DelegationList; 33 import org.objectweb.openccm.ast.api.SegmentDecl; 34 import org.objectweb.openccm.ast.api.CategoryKind; 35 36 50 51 public class ExecutorDeclImpl 52 extends CidlScopeImpl 53 implements org.objectweb.openccm.ast.api.ExecutorDecl 54 { 55 61 62 private DelegationListImpl feature_delegation_; 63 64 70 76 public 77 ExecutorDeclImpl(Repository rep, 78 ScopeImpl parent) 79 { 80 super(rep, parent); 82 83 feature_delegation_ = new DelegationListImpl(); 85 } 86 87 93 99 104 protected void 105 load(org.omg.CORBA.Contained contained) 106 { 107 } 109 110 115 protected void 116 loadAsMapping(org.omg.CORBA.Contained contained) 117 { 118 } 120 121 127 protected org.omg.CORBA.Contained 128 getContained() 129 { 130 return null; 131 } 132 133 139 145 protected org.omg.CORBA.Container 146 getContainer() 147 { 148 return null; 149 } 150 151 157 163 171 public Declaration[] 172 getDependencies() 173 { 174 if (dependencies_!=null) 175 return dependencies_; 176 177 java.util.List exec_depend = new java.util.ArrayList (); 178 Declaration[] depend = null; 179 180 183 Declaration[] decls = getContents(true, DeclarationKind.dk_all); 185 for (int i=0; i<decls.length; i++) 186 { 187 depend = decls[i].getDependencies(); 188 for (int j=0; j<depend.length; j++) 189 { 190 if ( (!containsDecl(depend[j])) && 191 (depend[j] != this) && 192 (exec_depend.indexOf(depend[j]) == -1) ) 193 exec_depend.add(depend[j]); 194 } 195 } 196 197 dependencies_ = (Declaration[])exec_depend.toArray(new Declaration[0]); 198 return dependencies_; 199 } 200 201 207 212 public long 213 getDeclKind() 214 { 215 return DeclarationKind.dk_executor; 216 } 217 218 221 public void 222 create() 223 { 224 super.create(); 226 227 } 229 230 236 242 247 public CategoryKind 248 getCompositionKind() 249 { 250 return ((org.objectweb.openccm.ast.api.CompositionDecl)getParent().getParent()).getCategoryKind(); 251 } 252 253 258 public DelegationList 259 getFeatureDelegationList() 260 { 261 return feature_delegation_; 262 } 263 264 271 public SegmentDecl 272 startSegment(String name) 273 { 274 SegmentDecl decl = new SegmentDeclImpl(getRepository(), this); 275 decl.setName(name); 276 return decl; 277 } 278 } 279 | Popular Tags |