Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.java.swing.tree.TreePath
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Field Summary | |
java.lang.Object[] | path
Path this instance represents. |
Constructor Summary | |
TreePath(java.lang.Object[] path)
Constructs a path from an array of Objects, uniquely identifying the path from the root of the tree to a specific node, as returned by the tree's data model. |
|
TreePath(java.lang.Object singlePath)
Constructs a TreePath when there is only item in the path. |
Method Summary | |
boolean | equals(java.lang.Object o)
Tests two TreePaths for equality by checking each element of the paths for equality. |
java.lang.Object | getLastPathComponent()
Returns the last component of this path. |
java.lang.Object | getPathComponent(int element)
Returns the path component at the specified index. |
int | getPathCount()
Returns the number of elements in the path. |
java.lang.Object[] | getPath()
Returns an array of Objects containing the components of this TreePath. |
int | hashCode()
Returns the hashCode for the object. |
boolean | isDescendant(TreePath aTreePath)
Returns true if the specified node is a descendant of this TreePath. |
java.lang.String | toString()
Returns a string that displays and identifies this object's properties. |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected transient java.lang.Object[] path
Constructor Detail |
public TreePath(java.lang.Object[] path)
The model is free to return an array of any Objects it needs to represent the path. The DefaultTreeModel returns an array of TreeNode objects. The first TreeNode in the path is the root of the tree, the last TreeNode is the node identified by the path.
path
- an array of Objects representing the path to a nodepublic TreePath(java.lang.Object singlePath)
singlePath
- an Object representing the path to a nodeMethod Detail |
public java.lang.Object[] getPath()
public java.lang.Object getLastPathComponent()
public int getPathCount()
public java.lang.Object getPathComponent(int element)
element
- an int specifying an element in the path, where
0 is the first element in the pathpublic boolean equals(java.lang.Object o)
o
- the Object to comparepublic int hashCode()
public boolean isDescendant(TreePath aTreePath)
public java.lang.String toString()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |