KickJava   Java API By Example, From Geeks To Geeks.

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


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): Philippe Merle.
23 Contributor(s): ______________________________________.
24
25 ===========================================================================*/

26
27 package org.objectweb.util.browser.core.naming;
28
29 /** To use the NameFactory interface */
30 import org.objectweb.util.browser.core.api.Name;
31 import org.objectweb.util.browser.core.api.NameFactory;
32
33 /** To use the Name interface. */
34
35 /**
36  * Default basic implementation of the NameFactory interface.
37  *
38  * This factory creates DefaultName instances.
39  *
40  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
41  * @version 0.1
42  */

43 public class DefaultNameFactory implements NameFactory {
44
45     // ==================================================================
46
//
47
// No internal state.
48
//
49
// ==================================================================
50

51     // ==================================================================
52
//
53
// Constructors.
54
//
55
// ==================================================================
56

57     // ==================================================================
58
//
59
// No internal methods.
60
//
61
// ==================================================================
62

63     // ==================================================================
64
//
65
// Public methods for interface NameFactory.
66
//
67
// ==================================================================
68

69     /**
70      * Creates a new {@link Name Name} with an identifier and no subname.
71      *
72      * The identifier and the subname of the created {@link Name Name}
73      * are set respectively to the given id and the null value.
74      *
75      * @param id The identifier of the {@link Name Name} to create.
76      *
77      * @return The created {@link Name Name}.
78      *
79      * @postcondition
80      * return.getOWId() == id
81      * and return.getOWSubName() == null;
82      */

83     public Name newOWName(String JavaDoc id) {
84         return new DefaultName(id);
85     }
86
87     /**
88      * Creates a new {@link Name Name} with an identifier and a subname.
89      *
90      * The identifier and the subname of the created {@link Name Name}
91      * are set respectively to the given id and subname.
92      *
93      * @param id The identifier of the {@link Name Name} to create.
94      * @param subname The subname of the {@link Name Name} to create.
95      *
96      * @return The created {@link Name Name}.
97      *
98      * @postcondition
99      * return.getOWId() == id
100      * and return.getOWSubName() == subname;
101      */

102     public Name newOWName(String JavaDoc id, Name subname) {
103         return new DefaultName(id, subname);
104     }
105
106 }
107
Popular Tags