| java.lang.Object org.apache.cocoon.forms.formmodel.tree.TreePath
TreePath | public class TreePath (Code) | | A path in a
TreeModel .
version: $Id: TreePath.java 449149 2006-09-23 03:58:05Z crossley $ |
Constructor Summary | |
public | TreePath(String key) Constructs a TreePath containing only a single element. | public | TreePath(TreePath parent, String key) Constructs a new TreePath, which is the path identified by
parent ending in lastElement . |
TreePath | public TreePath(String key)(Code) | | Constructs a TreePath containing only a single element. This is usually
used to construct a TreePath for the the root of the TreeModel.
|
TreePath | public TreePath(TreePath parent, String key)(Code) | | Constructs a new TreePath, which is the path identified by
parent ending in lastElement .
|
equals | public boolean equals(Object obj)(Code) | | Tests if two paths are equal. Two paths are considered equal if they are
of same length and contain the same keys.
Parameters: obj - the object ot compare |
getLastKey | public String getLastKey()(Code) | | Returns the key of last element of this path.
|
getLastPathObject | public Object getLastPathObject(TreeModel model)(Code) | | Returns the last component of this path. For a path returned by
DefaultTreeModel this will return an instance of TreeNode.
the Object at the end of the path See Also: TreePath.TreePath() |
getObjectPath | public Object[] getObjectPath(TreeModel model)(Code) | | Returns an ordered array of Objects containing the components of this
TreePath. The first element (index 0) is the root.
an array of Objects representing the TreePath See Also: TreePath.TreePath() |
getParentPath | public TreePath getParentPath()(Code) | | Returns a path containing all the elements of this object, except the
last path component.
|
getPathCount | public int getPathCount()(Code) | | Returns the number of elements in the path.
an int giving a count of items the path |
hashCode | public int hashCode()(Code) | | |
isDescendant | public boolean isDescendant(TreePath aTreePath)(Code) | | Returns true if aTreePath 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. For example, if this object
has the path [a, b], and aTreePath has the path [a, b, c],
then aTreePath is a descendant of this object. However, if
aTreePath has the path [a], then it is not a descendant of
this object.
true if aTreePath is a descendant of this path |
toString | public String toString()(Code) | | Returns a string that displays and identifies this object's properties.
a String representation of this object |
valueOf | public static TreePath valueOf(String s)(Code) | | Returns the TreePath represented by a given String.
Parameters: s - the string representation of the path a path object See Also: TreePath.toString() |
|
|