1 27 package org.objectweb.openccm.Containers.MetaInformation; 28 29 import org.objectweb.ccm.util.Table; 30 import org.omg.CORBA.LocalObject ; 31 import org.omg.Components.InvalidName; 32 33 39 public class AttributeTypeListImpl 40 extends LocalObject 41 implements AttributeTypeList 42 { 43 Table _attributes; 44 45 public AttributeTypeListImpl() 46 { 47 _attributes = new Table(); 48 } 49 50 public AttributeType get_attribute_type(String name) throws InvalidName 51 { 52 return (AttributeType) _attributes.get(name); 53 } 54 55 58 public AttributeType[] get_named_attribute_types(String [] names) throws InvalidName 59 { 60 AttributeType[] result = new AttributeType[names.length]; 61 62 64 int i = 0; 65 for(i=0;i<names.length;i++) 66 { 67 result[i] = (AttributeType)_attributes.get(names[i]); 68 } 69 return result; 70 } 71 72 75 public AttributeType[] get_all_attribute_types() 76 { 77 int idx = 0; 78 AttributeType[] result = new AttributeType[_attributes.size()]; 79 80 82 for(java.util.Enumeration elements = _attributes.elements(); elements.hasMoreElements(); ) 83 { 84 AttributeType info = (AttributeType)elements.nextElement(); 85 result[idx++] = info; 86 } 87 return result; 88 } 89 90 93 public void add_attribute_type(AttributeType ift) 94 { 95 _attributes.put(ift.name(),ift); 96 } 97 98 101 public void remove_attribute_type(String name) throws InvalidName 102 { 103 _attributes.remove(name); 104 } 105 } 106 | Popular Tags |