KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > tree > TreeNode


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.custom.tree;
17
18 import java.util.Iterator JavaDoc;
19
20 /**
21  * Defines the requirements for an object that can be used as a tree node for
22  * {@link HtmlTree}. (inspired by javax.swing.tree.TreeNode).
23  *
24  * @author <a HREF="mailto:oliver@rossmueller.com">Oliver Rossmueller </a>
25  * @version $Revision: 1.6 $ $Date: 2005/02/11 00:54:02 $
26  *
27  * $Log: TreeNode.java,v $
28  * Revision 1.6 2005/02/11 00:54:02 svieujot
29  * Revert changes commited to the wrong branch.
30  *
31  * Revision 1.4 2004/11/26 12:14:10 oros
32  * MYFACES-8: applied tree table patch by David Le Strat
33  *
34  * *
35  */

36 public interface TreeNode
37 {
38
39     /**
40      * @return Gets the user object of this node.
41      */

42     Object JavaDoc getUserObject();
43
44     /**
45      * Answer the child at the given index.
46      */

47     TreeNode getChildAt(int childIndex);
48
49     /**
50      * Answer the number of children this node contains.
51      */

52     int getChildCount();
53
54     /**
55      * Answer the parent of this node.
56      */

57     TreeNode getParent();
58
59     /**
60      * Answer the index of the given node in this node's children.
61      */

62     int getIndex(TreeNode node);
63
64     /**
65      * Answer true if this node allows children.
66      */

67     boolean getAllowsChildren();
68
69     /**
70      * Answer true if this is a leaf node.
71      */

72     boolean isLeaf();
73
74     /**
75      * Answer the children of the receiver. The base collection is unmodifyable.
76      */

77     Iterator JavaDoc children();
78
79 }
Popular Tags