1 26 27 package org.objectweb.openccm.ir3; 28 29 import org.omg.CORBA.*; 31 32 40 41 public class EnumDef_impl 42 extends Contained_impl 43 implements EnumDefOperations 44 { 45 51 54 public 55 EnumDef_impl(IFR ifr, 56 Container_impl container) 57 { 58 super(ifr, container); 60 61 setServant(new EnumDefPOATie(this)); 63 64 members_ = new String [0]; 66 } 67 68 74 77 protected String [] members_; 78 79 85 89 protected TypeCode 90 recursiveType(java.util.List idSeq) 91 { 92 return type(); 93 } 94 95 101 104 public EnumDef 105 asEnumDef() 106 { 107 return EnumDefHelper.narrow(asObject()); 108 } 109 110 116 119 protected void 120 cutDependencies() 121 { 122 members_ = null; 123 124 super.cutDependencies(); 126 } 127 128 134 137 public DefinitionKind 138 def_kind() 139 { 140 return DefinitionKind.dk_Enum; 141 } 142 143 149 152 public TypeCode 153 type() 154 { 155 return getIFR().getTCF().create_enum_tc(id(), name(), members()); 157 } 158 159 165 168 public String [] 169 members() 170 { 171 return members_; 172 } 173 174 177 public void 178 members(String [] names) 179 { 180 for(int i=0; i<names.length; i++) 182 { 183 String name = names[i]; 184 185 for(int j=i+1; j<names.length; j++) 186 if(name.equalsIgnoreCase(names[j])) 187 throw exceptionDuplicateDeclarator(name, j); 188 189 container_.checkName(name, false, false); 190 191 if (name.equalsIgnoreCase(name())) 192 throw exceptionNameAlreadyUsedByImmediateScope(name); 193 } 194 195 members_ = names; 196 } 197 } 198 | Popular Tags |