1 28 29 package org.objectweb.openccm.Containers.MetaInformation; 30 31 import org.objectweb.ccm.util.Table; 32 import org.omg.CORBA.LocalObject ; 33 import org.omg.Components.InvalidName; 34 35 38 public class ConsumerPortTypeListImpl 39 extends LocalObject 40 implements ConsumerPortTypeList 41 { 42 private Table _consumers; 43 44 public ConsumerPortTypeListImpl() 45 { 46 _consumers = new Table(); 47 } 48 49 public ConsumerPortType[] get_all_consumer_port_types() 50 { 51 ConsumerPortType[] result = new ConsumerPortType[_consumers.size()]; 52 53 int idx = 0; 55 for(java.util.Enumeration elements = _consumers.elements(); elements.hasMoreElements(); ) 56 { 57 ConsumerPortType info = (ConsumerPortType)elements.nextElement(); 58 result[idx++] = info; 59 } 60 return result; 61 } 62 63 public ConsumerPortType[] get_named_consumer_port_types(String [] names) 64 { 65 ConsumerPortType[] result = new ConsumerPortType[names.length]; 66 67 int i = 0; 69 for(i=0;i<names.length;i++) 70 { 71 result[i] = (ConsumerPortType)_consumers.get(names[i]); 72 } 73 return result; 74 } 75 76 public ConsumerPortType get_consumer_port_type(String name) 77 { 78 return (ConsumerPortType) _consumers.get(name); 79 } 80 81 public void add_consumer_port_type(ConsumerPortType _opt) 82 { 83 _consumers.put(_opt.name(),_opt); 84 } 85 86 public void remove_consumer_port_type(String name) 87 { 88 _consumers.remove(name); 89 } 90 91 92 } 93 | Popular Tags |