KickJava   Java API By Example, From Geeks To Geeks.

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


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

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