Lines Matching defs:TreePath

32  * {@code TreePath} represents an array of objects that uniquely
37 * {@code /tmp/foo/bar} could be represented by a {@code TreePath} as
38 * {@code new TreePath(new Object[] {"tmp", "foo", "bar"})}.
40 * {@code TreePath} is used extensively by {@code JTree} and related classes.
42 * {@code TreePath}s. When used with {@code JTree}, the elements of the
52 * TreePath selectedPath = tree.getSelectionPath();
59 * internally creates {@code TreePath}s at various points, it's
60 * generally not useful to subclass {@code TreePath} and use with
63 * While {@code TreePath} is serializable, a {@code
84 public class TreePath extends Object implements Serializable {
87 private TreePath parentPath;
92 * Creates a {@code TreePath} from an array. The array uniquely
100 public TreePath(Object[] path) {
102 throw new IllegalArgumentException("path in TreePath must be non null and not empty.");
109 parentPath = new TreePath(path, path.length - 1);
113 * Creates a {@code TreePath} containing a single element. This is
114 * used to construct a {@code TreePath} identifying the root.
117 * @see #TreePath(Object[])
121 public TreePath(Object lastPathComponent) {
123 throw new IllegalArgumentException("path in TreePath must be non null.");
129 * Creates a {@code TreePath} with the specified parent and element.
137 protected TreePath(TreePath parent, Object lastPathComponent) {
139 throw new IllegalArgumentException("path in TreePath must be non null.");
145 * Creates a {@code TreePath} from an array. The returned
146 * {@code TreePath} represents the elements of the array from
152 * @param path the array to create the {@code TreePath} from
154 * create the {@code TreePath} from
161 protected TreePath(Object[] path, int length) {
168 parentPath = new TreePath(path, length - 1);
172 * Creates an empty {@code TreePath}. This is provided for
177 protected TreePath() {
181 * Returns an ordered array of the elements of this {@code TreePath}.
184 * @return an array of the elements in this {@code TreePath}
190 for(TreePath path = this; path != null; path = path.getParentPath()) {
212 for(TreePath path = this; path != null; path = path.getParentPath()) {
233 TreePath path = this;
242 * Compares this {@code TreePath} to the specified object. This returns
243 * {@code true} if {@code o} is a {@code TreePath} with the exact
252 if(o instanceof TreePath) {
253 TreePath oTreePath = (TreePath)o;
257 for(TreePath path = this; path != null;
271 * Returns the hash code of this {@code TreePath}. The hash code of a
272 * {@code TreePath} is the hash code of the last element in the path.
283 * {@code TreePath}. A {@code TreePath} {@code P1} is a descendant of a
284 * {@code TreePath} {@code P2}
292 * a {@code TreePath} is always considered a descendant of itself.
296 * @param aTreePath the {@code TreePath} to check
299 public boolean isDescendant(TreePath aTreePath) {
320 * of the newly created {@code TreePath}.
325 public TreePath pathByAddingChild(Object child) {
329 return new TreePath(this, child);
333 * Returns the {@code TreePath} of the parent. A return value of
338 public TreePath getParentPath() {