1 26 27 package org.objectweb.openccm.ast.lib; 28 29 import org.objectweb.openccm.ast.api.Declaration; 31 import org.objectweb.openccm.ast.api.DeclarationKind; 32 import org.objectweb.openccm.ast.api.AbstractStorageHomeDecl; 33 import org.objectweb.openccm.ast.api.StringList; 34 35 52 53 public class SegmentDeclImpl 54 extends DeclarationImpl 55 implements org.objectweb.openccm.ast.api.SegmentDecl 56 { 57 63 64 private AbstractStorageHomeDeclImpl ash_; 65 66 67 private StringListImpl facets_; 68 69 70 private StringListImpl sinks_; 71 72 78 84 protected 85 SegmentDeclImpl(Repository rep, 86 ScopeImpl parent) 87 { 88 super(rep, parent); 90 91 ash_ = null; 93 facets_ = new StringListImpl(); 94 sinks_ = new StringListImpl(); 95 } 96 97 103 109 114 protected org.omg.CORBA.Contained 115 getContained() 116 { 117 return null; 118 } 119 120 126 132 140 public Declaration[] 141 getDependencies() 142 { 143 if (dependencies_!=null) 144 return dependencies_; 145 146 java.util.List seg_depend = new java.util.ArrayList (); 147 Declaration[] depend = null; 148 149 if (getAbstractStorageHome() != null) 151 { 152 seg_depend.add( getAbstractStorageHome() ); 153 depend = getAbstractStorageHome().getDependencies(); 154 for (int j=0; j<depend.length; j++) 155 { 156 if ( (depend[j] != this) && 157 (seg_depend.indexOf(depend[j]) == -1) ) 158 seg_depend.add(depend[j]); 159 } 160 } 161 162 165 166 dependencies_ = (Declaration[])seg_depend.toArray(new Declaration[0]); 167 return dependencies_; 168 } 169 170 176 183 public long 184 getDeclKind() 185 { 186 return DeclarationKind.dk_segment; 187 } 188 189 194 public org.objectweb.openccm.ast.api.DeclarationCategory 195 getCategory() 196 { 197 return org.objectweb.openccm.ast.api.DeclarationCategory.dc_cidl; 198 } 199 200 206 211 public void 212 setAbstractStorageHome(AbstractStorageHomeDecl ash) 213 { 214 ash_ = (AbstractStorageHomeDeclImpl)ash; 215 } 216 217 222 public AbstractStorageHomeDecl 223 getAbstractStorageHome() 224 { 225 return ash_; 226 } 227 228 233 public StringList 234 getFacetList() 235 { 236 return facets_; 237 } 238 239 244 public StringList 245 getSinkList() 246 { 247 return sinks_; 248 } 249 } 250 | Popular Tags |