KickJava   Java API By Example, From Geeks To Geeks.

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


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
38 public class PublisherPortTypeListImpl
39 extends LocalObject JavaDoc
40 implements PublisherPortTypeList
41 {
42   private Table _publishers;
43     
44   public PublisherPortTypeListImpl()
45   {
46     _publishers = new Table();
47   }
48   
49   public PublisherPortType[] get_all_publisher_port_types()
50   {
51     PublisherPortType[] result = new PublisherPortType[_publishers.size()];
52     
53     // Iterate on all the connections.
54
int idx = 0;
55     for(java.util.Enumeration JavaDoc elements = _publishers.elements(); elements.hasMoreElements(); )
56     {
57             PublisherPortType info = (PublisherPortType)elements.nextElement();
58             result[idx++] = info;
59     }
60     return result;
61   }
62   
63   public PublisherPortType[] get_named_publisher_port_types(String JavaDoc[] names)
64   {
65     PublisherPortType[] result = new PublisherPortType[names.length];
66     
67     // Iterate on all the connections.
68
int i = 0;
69     for(i=0;i<names.length;i++)
70     {
71             result[i] = (PublisherPortType)_publishers.get(names[i]);
72     }
73     return result;
74   }
75   
76   public PublisherPortType get_publisher_port_type(String JavaDoc name)
77   {
78     return (PublisherPortType) _publishers.get(name);
79   }
80   
81   public void add_publisher_port_type(PublisherPortType _opt)
82   {
83     _publishers.put(_opt.name(),_opt);
84   }
85   
86   public void remove_publisher_port_type(String JavaDoc name)
87   {
88     _publishers.remove(name);
89   }
90 }
91
Popular Tags