public final class TreePath
extends java.lang.Object
implements java.io.Serializable
| Modifier | Constructor and Description |
|---|---|
|
TreePath(java.lang.Object[] pathElements)
Construct a pathElements from an array of Objects
|
protected |
TreePath(java.lang.Object[] pathElements,
int length)
Construct a new TreePath from an array of objects.
|
protected |
TreePath(TreePath parent,
java.lang.Object lastElement)
Construct a new TreePath, which is the path identified by
parent ending in lastElement.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Test two TreePaths for equality by checking each element of the
paths for equality.
|
java.lang.Object |
getLastPathComponent()
Returns the last component of this path.
|
TreePath |
getParentPath()
Return a path containing all the elements of this object, except
the last path component.
|
java.lang.Object[] |
getPath()
Return an array of Objects containing the components of this
TreePath.
|
java.lang.Object |
getPathComponent(int index)
Return the path component at the specified index.
|
int |
getPathCount()
Return the number of elements in the path.
|
int |
hashCode()
Return the hashCode for the object.
|
boolean |
isDescendant(TreePath path)
Return true if
path is a
descendant of this
TreePath. |
TreePath |
pathByAddingChild(java.lang.Object child)
Return a new path by appending child to this path.
|
java.lang.String |
toString()
Return a string that displays and identifies this
object's properties.
|
public TreePath(java.lang.Object[] pathElements)
pathElements - an array of Objects representing the pathElements to a nodeprotected TreePath(TreePath parent, java.lang.Object lastElement)
protected TreePath(java.lang.Object[] pathElements,
int length)
pathElements - path elementslength - lenght of the new pathpublic java.lang.Object[] getPath()
public java.lang.Object getLastPathComponent()
public int getPathCount()
public java.lang.Object getPathComponent(int index)
index - int specifying an index in the pathjava.lang.IllegalArgumentException - if the index is beyond the length
of the pathpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the Object to comparepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean isDescendant(TreePath path)
path is a
descendant of this
TreePath. A TreePath P1 is a descendent of a TreePath P2
if P1 contains all of the components that make up
P2's path. If P1 and P2 are equal P2 is not considered a descendant of
P1.path is a descendant of this pathpublic TreePath pathByAddingChild(java.lang.Object child)
child - element to appendjava.lang.NullPointerException - if child is nullpublic TreePath getParentPath()
public java.lang.String toString()
toString in class java.lang.Object