KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > browser > core > naming > AbstractContext


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

21 package org.objectweb.util.browser.core.naming;
22 import org.objectweb.util.browser.api.Context;
23 import org.objectweb.util.browser.api.Entry;
24 import org.objectweb.util.browser.api.Wrapper;
25 /**
26  * Defines some methods used by all context
27  *
28  * @author <a HREF="mailto:Jerome.Moroy@lifl.fr">Jerome Moroy</a>
29  *
30  * @version 0.1
31  */

32 public abstract class AbstractContext
33     implements Context, Wrapper {
34     // ==================================================================
35
//
36
// Internal state.
37
//
38
// ==================================================================
39
// ==================================================================
40
//
41
// Constructors.
42
//
43
// ==================================================================
44
// ==================================================================
45
//
46
// Internal methods.
47
//
48
// ==================================================================
49
/**
50      * Creates an Entry.
51      *
52      * @param value The value of the entry to create.
53      * @param id The id of the name of the entry to create.
54      *
55      * @return A new Entry.
56      *
57      * postcondition:<br>
58      * return.getOWValue() == value
59      * and return.getOWName().getOWID() == id
60      * and return.getOWContext() == this;
61      */

62     protected Entry createEntry(Object JavaDoc value, String JavaDoc id) {
63         return new DefaultEntry(value, new DefaultName(id), this);
64     }
65     // ==================================================================
66
//
67
// Public methods for interface Context.
68
//
69
// ==================================================================
70
/**
71      * Returns an array containing the entries contained by the target context.
72      * @return A new array of entry.
73      */

74     public abstract Entry[] getEntries();
75     // ==================================================================
76
//
77
// Additional public methods for Wrapper interface.
78
//
79
// ==================================================================
80

81     /**
82      * Fixes the wrapped object
83      *
84      * @param object The object to wrap
85      *
86      */

87     public abstract void setWrapped(Object JavaDoc object);
88     /**
89      * Gets the wrapped object
90      *
91      * @return The wrapped object
92      *
93      */

94     public abstract Object JavaDoc getWrapped();
95 }
96
Popular Tags