KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > browser > core > api > ContextContainer


1 /*===========================================================================
2
3 ObjectWeb Naming Context Framework
4 Copyright (C) 2002 USTL - LIFL - GOAL
5 Contact: architecture@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Jerome Moroy.
23 Contributor(s): ______________________________________.
24
25 ===========================================================================*/

26
27 package org.objectweb.util.browser.core.api;
28
29 import org.objectweb.util.browser.api.Context;
30 import org.objectweb.util.browser.api.Entry;
31
32 /**
33  * ContextContainer interface
34  *
35  * @author <a HREF="mailto:Jerome.Moroy@lifl.fr">Jérôme Moroy</a>
36  * @version 0.1
37  */

38 public interface ContextContainer extends Context {
39
40     /**
41      * Returns the entry identify by the given name
42      * @param name The key of the entry
43      * @return The associated entry or null.
44      */

45     public Entry getLocalEntry(String JavaDoc name);
46
47     /**
48      * Returns the value of the entry identify by the given name
49      * @param name The key of the entry
50      * @return The value of the associated entry or null.
51      */

52     public Object JavaDoc getLocalValue(String JavaDoc name);
53
54     /**
55      * Adds an object into the container.
56      * If an entry with the same id already exists in the container, this one is replaced by the new value.
57      *
58      * This method does not modify the given id and the given object, But it modifies the target context.
59      *
60      * @param id The name of the entry to be retrieved.
61      * @param object The object to add
62      *
63      */

64     public void addEntry(String JavaDoc id, Object JavaDoc object);
65
66     /**
67      * Removes the object corresponding to the given id from the context
68      * This method modifies the target context.
69      * @param id The name of the entry to be removed.
70      */

71     public void removeEntry(String JavaDoc id);
72     
73     /**
74      * Removes all of the elements from this context.
75      */

76     public void clear();
77
78     /**
79      * Provides the number of entries contained into the given context
80      * @return The size of the context.
81      */

82     public int getSize();
83     
84 }
85
Popular Tags