KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonathan > apis > kernel > Element


1 /***
2  * Jonathan: an Open Distributed Processing Environment
3  * Copyright (C) 2000 France Telecom R&D
4  * Copyright (C) 2001 Kelua SA
5  *
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 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Release: 3.0
21  *
22  * Contact: jonathan@objectweb.org
23  *
24  * Author: Fabien Delpiano
25  *
26  */

27
28 package org.objectweb.jonathan.apis.kernel;
29
30 /**
31  * The Element interface represents an element in a context.
32  */

33 public interface Element {
34
35    /**
36     * Returns the (local) name of the element, in the context it belongs to.
37     * @return the (local) name of the element, in the context it belongs to.
38     */

39    String JavaDoc getName();
40
41    /**
42     * Returns the component contained in the target element.
43     * @return the component contained in the target element.
44     */

45    Component getComponent();
46
47    /**
48     * Returns the type of the target element, as a Class.
49     * @return the type of the target element, as a Class.
50     */

51    Class JavaDoc getType();
52
53    /**
54     * Returns the value of the target element, if its type is an object reference
55     * type.
56     * <p>
57     * If the target element is of an integral type,
58     * {@link Context#NO_VALUE NO_VALUE}} is returned.
59     *
60     * @return the value of the target element.
61     */

62    Object JavaDoc getValue();
63
64    /**
65     * Returns the value of the target element, if its class is an integer class.
66     * <p>
67     * If the target element has an object reference type, Integer.MAX_VALUE is
68     * returned.
69     *
70     * @return the value of the target element.
71     */

72    int getIntValue();
73
74    /**
75     * Returns the context containing the target element, if any, null otherwise.
76     * @return the context containing the target element, if any, null otherwise.
77     */

78    Component getContainer();
79 }
80
Popular Tags