KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > Containers > MetaInformation > EmitterPortTypeListImpl


1 /*====================================================================
2
3 created on 10 avr. 2003
4
5 OpenCCM: The Open CORBA Component Model Platform
6 Copyright (C) 2001-2002 USTL - LIFL - GOAL
7 Contact: openccm-team@objectweb.org
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA
23
24 Initial developer(s): Hameau Fabien.
25 Contributor(s): ______________________________________.
26
27 */

28
29 package org.objectweb.openccm.Containers.MetaInformation;
30
31 import org.objectweb.ccm.util.Table;
32 import org.omg.CORBA.LocalObject JavaDoc;
33
34 /**
35  * @author hameau
36  */

37 public class EmitterPortTypeListImpl
38 extends LocalObject JavaDoc
39 implements EmitterPortTypeList
40 {
41     private Table _emitters;
42     
43     public EmitterPortTypeListImpl()
44     {
45             _emitters = new Table();
46     }
47
48     public EmitterPortType[] get_all_emitter_port_types()
49     {
50         EmitterPortType[] result = new EmitterPortType[_emitters.size()];
51
52         // Iterate on all the connections.
53
int idx = 0;
54         for(java.util.Enumeration JavaDoc elements = _emitters.elements(); elements.hasMoreElements(); )
55         {
56                 EmitterPortType info = (EmitterPortType)elements.nextElement();
57                 result[idx++] = info;
58         }
59         return result;
60     }
61
62     public EmitterPortType[] get_named_emitter_port_types(String JavaDoc[] names)
63     {
64         EmitterPortType[] result = new EmitterPortType[names.length];
65
66         // Iterate on all the connections.
67
int i = 0;
68         for(i=0;i<names.length;i++)
69         {
70                 result[i] = (EmitterPortType)_emitters.get(names[i]);
71         }
72         return result;
73     }
74
75     public EmitterPortType get_emitter_port_type(String JavaDoc name)
76     {
77             return (EmitterPortType) _emitters.get(name);
78     }
79
80     public void add_emitter_port_type(EmitterPortType _opt)
81     {
82         _emitters.put(_opt.name(),_opt);
83     }
84
85     public void remove_emitter_port_type(String JavaDoc name)
86     {
87         _emitters.remove(name);
88     }
89 }
90
Popular Tags