KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*====================================================================
2
3 created on 8 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
32 import org.objectweb.ccm.util.Table;
33 import org.omg.CORBA.LocalObject JavaDoc;
34
35 /**
36  * @author hameau
37  */

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