KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*====================================================================
2
3 Objectweb Browser framework
4 Copyright (C) 2000-2004 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@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.naming;
28
29 import org.objectweb.util.browser.api.Entry;
30 import org.objectweb.util.browser.api.Context;
31
32 /**
33  * An initial entry is an object which has to be displayed into the initial context (at the root of the tree).
34  *
35  * @author <a HREF="mailto:Jerome.Moroy@lifl.fr">Jerome Moroy</a>
36  *
37  * @version 0.1
38  */

39 public class InitialEntry
40   implements Entry
41 {
42     
43     /** The name of the entry. */
44     protected String JavaDoc name_;
45         
46     /** The value of the entry. */
47     protected Object JavaDoc value_;
48         
49     /** The number of level to expand. */
50     protected int level_;
51
52     /**
53      * Default constructor.
54      * @param name The name of the entry.
55      * @param value The value of the entry.
56      */

57     public InitialEntry(String JavaDoc name, Object JavaDoc value){
58         this(name, value, 0);
59     }
60      
61     /**
62      * Default constructor.
63      * @param name The name of the entry.
64      * @param value The value of the entry.
65      * @param level The number of level to expand.
66      */

67     public InitialEntry(String JavaDoc name, Object JavaDoc value, int level){
68         name_ = name;
69         value_ = value;
70         level_ = level;
71      }
72     
73     /**
74      * Fixes the name of the entry
75      * @param name The name of the entry.
76      */

77     public void setName(String JavaDoc name){
78         name_ = name;
79     }
80     
81     public Object JavaDoc getName(){
82         return name_;
83     }
84         
85     public Object JavaDoc getValue(){
86         return value_;
87     }
88
89     public Context getContext(){
90         return null;
91     }
92
93     public int getLevel(){
94         return level_;
95     }
96 }
Popular Tags