KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > tax > traversal > TreeNodeWalker


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.tax.traversal;
20
21 import org.netbeans.tax.TreeNode;
22 import org.netbeans.tax.NotSupportedException;
23
24 /**
25  *
26  * @author Libor Kramolis
27  * @version 0.1
28  */

29 public final class TreeNodeWalker {
30
31     /** Root node of this iterator. */
32     private TreeNode root;
33
34     /** Determines which node types are presented. */
35     private int whatToShow;
36
37     /** Filter to screen nodes. */
38     private TreeNodeFilter filter;
39
40     /** Current node. */
41     private TreeNode currentNode;
42
43
44     //
45
// init
46
//
47

48     /** Creates new TreeNodeIterator. */
49     public TreeNodeWalker (TreeNode node, int wTS, TreeNodeFilter f) {
50         root = node;
51         whatToShow = wTS;
52         filter = f;
53         
54         currentNode = root;
55     }
56     
57     
58     //
59
// itself
60
//
61

62     /**
63      */

64     public TreeNode getRoot () {
65         return root;
66     }
67     
68     /**
69      */

70     public int getWhatToShow () {
71         return whatToShow;
72     }
73     
74     /**
75      */

76     public TreeNodeFilter getFilter () {
77         return filter;
78     }
79     
80     /**
81      */

82     public TreeNode getCurrentNode () {
83         return currentNode;
84     }
85     
86     /**
87      */

88     public void setCurrentNode (TreeNode curNode) throws NotSupportedException {
89         if (curNode == null) {
90             throw new NotSupportedException (Util.THIS.getString ("EXC_invalid_current_node_value"));
91         }
92         
93         currentNode = curNode;
94     }
95     
96     /**
97      */

98     public TreeNode parentNode () {
99         if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("[PENDING]: TreeNodeWalker.parentNode ()"); // NOI18N
100

101         return null;
102     }
103     
104     /**
105      */

106     public TreeNode firstChild () {
107         if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("[PENDING]: TreeNodeWalker.firstChild ()"); // NOI18N
108

109         return null;
110     }
111     
112     /**
113      */

114     public TreeNode lastChild () {
115         if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("[PENDING]: TreeNodeWalker.lastChild ()"); // NOI18N
116

117         return null;
118     }
119     
120     /**
121      */

122     public TreeNode previousSibling () {
123         if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("[PENDING]: TreeNodeWalker.previousSibling ()"); // NOI18N
124

125         return null;
126     }
127     
128     /**
129      */

130     public TreeNode nextSibling () {
131         if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("[PENDING]: TreeNodeWalker.nextSibling ()"); // NOI18N
132

133         return null;
134     }
135     
136     /**
137      */

138     public TreeNode previousNode () {
139         if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("[PENDING]: TreeNodeWalker.previousNode ()"); // NOI18N
140

141         return null;
142     }
143     
144     /**
145      */

146     public TreeNode nextNode () {
147         if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("[PENDING]: TreeNodeWalker.nextNode ()"); // NOI18N
148

149         return null;
150     }
151     
152 }
153
Popular Tags