1 19 package org.netbeans.tax.traversal; 20 21 import org.netbeans.tax.TreeNode; 22 import org.netbeans.tax.NotSupportedException; 23 24 29 public final class TreeNodeWalker { 30 31 32 private TreeNode root; 33 34 35 private int whatToShow; 36 37 38 private TreeNodeFilter filter; 39 40 41 private TreeNode currentNode; 42 43 44 48 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 62 64 public TreeNode getRoot () { 65 return root; 66 } 67 68 70 public int getWhatToShow () { 71 return whatToShow; 72 } 73 74 76 public TreeNodeFilter getFilter () { 77 return filter; 78 } 79 80 82 public TreeNode getCurrentNode () { 83 return currentNode; 84 } 85 86 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 98 public TreeNode parentNode () { 99 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("[PENDING]: TreeNodeWalker.parentNode ()"); 101 return null; 102 } 103 104 106 public TreeNode firstChild () { 107 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("[PENDING]: TreeNodeWalker.firstChild ()"); 109 return null; 110 } 111 112 114 public TreeNode lastChild () { 115 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("[PENDING]: TreeNodeWalker.lastChild ()"); 117 return null; 118 } 119 120 122 public TreeNode previousSibling () { 123 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("[PENDING]: TreeNodeWalker.previousSibling ()"); 125 return null; 126 } 127 128 130 public TreeNode nextSibling () { 131 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("[PENDING]: TreeNodeWalker.nextSibling ()"); 133 return null; 134 } 135 136 138 public TreeNode previousNode () { 139 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("[PENDING]: TreeNodeWalker.previousNode ()"); 141 return null; 142 } 143 144 146 public TreeNode nextNode () { 147 if ( Util.THIS.isLoggable() ) Util.THIS.debug ("[PENDING]: TreeNodeWalker.nextNode ()"); 149 return null; 150 } 151 152 } 153 | Popular Tags |