KickJava   Java API By Example, From Geeks To Geeks.

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


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  * @author hameau
35  */

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