org.apache.myfaces.custom.tree.model
Class TreePath
Object
org.apache.myfaces.custom.tree.model.TreePath
- Serializable
public final class TreePath
extends Object
implements Serializable
$Revision: 225368 $ $Date: 2005-07-26 20:14:51 +0200 (Tue, 26 Jul 2005) $TreePath(Object[] pathElements) - Construct a pathElements from an array of Objects
|
TreePath(Object[] pathElements, int length) - Construct a new TreePath from an array of objects.
|
TreePath(TreePath parent, Object lastElement) - Construct a new TreePath, which is the path identified by
parent ending in lastElement.
|
boolean | equals(Object o) - Test two TreePaths for equality by checking each element of the
paths for equality.
|
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.
|
Object[] | getPath() - Return an array of Objects containing the components of this
TreePath.
|
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(Object child) - Return a new path by appending child to this path.
|
String | toString() - Return a string that displays and identifies this
object's properties.
|
TreePath
public TreePath(Object[] pathElements)
Construct a pathElements from an array of Objects
pathElements
- an array of Objects representing the pathElements to a node
TreePath
protected TreePath(Object[] pathElements,
int length)
Construct a new TreePath from an array of objects.
pathElements
- path elementslength
- lenght of the new path
TreePath
protected TreePath(TreePath parent,
Object lastElement)
Construct a new TreePath, which is the path identified by
parent ending in lastElement.
equals
public boolean equals(Object o)
Test two TreePaths for equality by checking each element of the
paths for equality. Two paths are considered equal if they are of
the same length and all element positions are equal.
o
- the Object to compare
getLastPathComponent
public Object getLastPathComponent()
Returns the last component of this path.
- the Object at the end of the path
getParentPath
public TreePath getParentPath()
Return a path containing all the elements of this object, except
the last path component.
getPath
public Object[] getPath()
Return an array of Objects containing the components of this
TreePath.
- an array of Objects representing the TreePath
getPathComponent
public Object getPathComponent(int index)
Return the path component at the specified index.
index
- int specifying an index in the path
- the Object at that index location
getPathCount
public int getPathCount()
Return the number of elements in the path.
- an int giving a count of items the path
hashCode
public int hashCode()
Return the hashCode for the object. The hash code of a TreePath
is defined to be the hash code of the last component in the path.
- the hashCode for the object
isDescendant
public boolean isDescendant(TreePath path)
Return true if 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.
- true if
path
is a descendant of this path
pathByAddingChild
public TreePath pathByAddingChild(Object child)
Return a new path by appending child to this path.
child
- element to append
toString
public String toString()
Return a string that displays and identifies this
object's properties.
- a String representation of this object