Lines Matching refs:path

33  * identify the path to a node in a tree. The elements of the array
36 * the array of parent directories and the name of the file. The path
43 * path are the objects returned from the {@code TreeModel}. When {@code JTree}
45 * path are {@code TreeNode}s. The following example illustrates extracting
64 * NotSerializableException} is thrown if any elements of the path are
88 /** Last path component. */
93 * identifies the path to a node.
95 * @param path an array of objects representing the path to a node
96 * @throws IllegalArgumentException if {@code path} is {@code null},
99 @ConstructorProperties({"path"})
100 public TreePath(Object[] path) {
101 if(path == null || path.length == 0)
102 throw new IllegalArgumentException("path in TreePath must be non null and not empty.");
103 lastPathComponent = path[path.length - 1];
106 "Last path component must be non-null");
108 if(path.length > 1)
109 parentPath = new TreePath(path, path.length - 1);
123 throw new IllegalArgumentException("path in TreePath must be non null.");
131 * @param parent the path to the parent, or {@code null} to indicate
133 * @param lastPathComponent the last path element
139 throw new IllegalArgumentException("path in TreePath must be non null.");
152 * @param path the array to create the {@code TreePath} from
153 * @param length identifies the number of elements in {@code path} to
155 * @throws NullPointerException if {@code path} is {@code null}
161 protected TreePath(Object[] path, int length) {
162 lastPathComponent = path[length - 1];
168 parentPath = new TreePath(path, length - 1);
190 for(TreePath path = this; path != null; path = path.getParentPath()) {
191 result[i--] = path.getLastPathComponent();
197 * Returns the last element of this path.
199 * @return the last element in the path
206 * Returns the number of elements in the path.
208 * @return the number of elements in the path
212 for(TreePath path = this; path != null; path = path.getParentPath()) {
219 * Returns the path element at the specified index.
224 * range of this path
233 TreePath path = this;
236 path = path.getParentPath();
238 return path.getLastPathComponent();
245 * element of the path).
257 for(TreePath path = this; path != null;
258 path = path.getParentPath()) {
259 if (!(path.getLastPathComponent().equals
272 * {@code TreePath} is the hash code of the last element in the path.
286 * {@code P2's} path.
287 * For example, if this object has the path {@code [a, b]},
288 * and <code>aTreePath</code> has the path {@code [a, b, c]},
290 * However, if <code>aTreePath</code> has the path {@code [a]},
297 * @return true if <code>aTreePath</code> is a descendant of this path
308 // Can't be a descendant, has fewer components in the path.
318 * Returns a new path containing all the elements of this path
322 * @param child the path element to add
336 * @return the parent path