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
89 /** Last path component. */
94 * identifies the path to a node.
96 * @param path an array of objects representing the path to a node
97 * @throws IllegalArgumentException if {@code path} is {@code null},
100 @ConstructorProperties({"path"})
101 public TreePath(Object[] path) {
102 if(path == null || path.length == 0)
103 throw new IllegalArgumentException("path in TreePath must be non null and not empty.");
104 lastPathComponent = path[path.length - 1];
107 "Last path component must be non-null");
109 if(path.length > 1)
110 parentPath = new TreePath(path, path.length - 1);
124 throw new IllegalArgumentException("path in TreePath must be non null.");
132 * @param parent the path to the parent, or {@code null} to indicate
134 * @param lastPathComponent the last path element
140 throw new IllegalArgumentException("path in TreePath must be non null.");
153 * @param path the array to create the {@code TreePath} from
154 * @param length identifies the number of elements in {@code path} to
156 * @throws NullPointerException if {@code path} is {@code null}
162 protected TreePath(Object[] path, int length) {
163 lastPathComponent = path[length - 1];
169 parentPath = new TreePath(path, length - 1);
191 for(TreePath path = this; path != null; path = path.getParentPath()) {
192 result[i--] = path.getLastPathComponent();
198 * Returns the last element of this path.
200 * @return the last element in the path
207 * Returns the number of elements in the path.
209 * @return the number of elements in the path
213 for(TreePath path = this; path != null; path = path.getParentPath()) {
220 * Returns the path element at the specified index.
225 * range of this path
234 TreePath path = this;
237 path = path.getParentPath();
239 return path.getLastPathComponent();
246 * element of the path).
258 for(TreePath path = this; path != null;
259 path = path.getParentPath()) {
260 if (!(path.getLastPathComponent().equals
273 * {@code TreePath} is the hash code of the last element in the path.
287 * {@code P2's} path.
288 * For example, if this object has the path {@code [a, b]},
289 * and <code>aTreePath</code> has the path {@code [a, b, c]},
291 * However, if <code>aTreePath</code> has the path {@code [a]},
298 * @return true if <code>aTreePath</code> is a descendant of this path
309 // Can't be a descendant, has fewer components in the path.
319 * Returns a new path containing all the elements of this path
323 * @param child the path element to add
325 * @return a new path containing all the elements of this path
339 * @return the parent path