KickJava   Java API By Example, From Geeks To Geeks.

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


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 FacetPortTypeListImpl
38 extends LocalObject JavaDoc
39 implements FacetPortTypeList
40 {
41   private Table _facets;
42   
43   public FacetPortTypeListImpl()
44   {
45         _facets = new Table();
46   }
47   
48   public FacetPortType[] get_all_facet_port_types()
49   {
50     FacetPortType[] result = new FacetPortType[_facets.size()];
51   
52     // Iterate on all the connections.
53
int idx = 0;
54     for(java.util.Enumeration JavaDoc elements = _facets.elements(); elements.hasMoreElements(); )
55     {
56             FacetPortType info = (FacetPortType)elements.nextElement();
57             result[idx++] = info;
58     }
59     return result;
60   }
61   
62   public FacetPortType[] get_named_facet_port_types(String JavaDoc[] names)
63   {
64     FacetPortType[] result = new FacetPortType[names.length];
65
66     // Iterate on all the connections.
67

68     int i = 0;
69     for(i=0;i<names.length;i++)
70     {
71       result[i] = (FacetPortType)_facets.get(names[i]);
72     }
73     return result;
74   }
75     
76   public FacetPortType get_facet_port_type(String JavaDoc name)
77   {
78     return (FacetPortType) _facets.get(name);
79   }
80
81   public void add_facet_port_type(FacetPortType _opt)
82   {
83     _facets.put(_opt.name(),_opt);
84   }
85
86   public void remove_facet_port_type(String JavaDoc name)
87   {
88     _facets.remove(name);
89   }
90 }
91
Popular Tags