org.apache.myfaces.tobago.model
Class TreePath

java.lang.Object
  extended by org.apache.myfaces.tobago.model.TreePath
All Implemented Interfaces:
Serializable

public class TreePath
extends Object
implements Serializable

Handles a path in a tree from the root node to the position inside this tree. The position of the root node is dropped in the list, because it would always be zero. The path of the root node as length 0.

Example:

  + Root               Path: []
  |
  +-+ Node             Path: [0]
  | |
  | +-+ Sub-Node       Path: [0, 0]
  | |
  | +-+ Sub-Node       Path: [0, 1]
  |
  +-+ Node             Path: [1]
    |
    +-+ Sub-Node       Path: [1, 0]
    |
    +-+ Sub-Node       Path: [1, 1]
    |
    +-+ Sub-Node       Path: [1, 2]
 

Since:
1.5.0
See Also:
Serialized Form

Constructor Summary
TreePath(int... path)
           
TreePath(List<Integer> pathList)
           
TreePath(String string)
          Deprecated. since 2.0.0
TreePath(TreeNode node)
           
TreePath(TreePath position, int addendum)
          Deprecated. since 2.0.0
 
Method Summary
 boolean equals(Object o)
           
 int getLength()
           
 DefaultMutableTreeNode getNode(DefaultMutableTreeNode tree)
          Deprecated. since 2.0.0
 String getParentPathString()
          Deprecated. since 1.5.0
 int[] getPath()
           
 String getPathString()
          Deprecated. since 2.0.0
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreePath

public TreePath(int... path)

TreePath

public TreePath(List<Integer> pathList)

TreePath

@Deprecated
public TreePath(TreePath position,
                           int addendum)
Deprecated. since 2.0.0


TreePath

@Deprecated
public TreePath(String string)
         throws NumberFormatException
Deprecated. since 2.0.0

Throws:
NumberFormatException

TreePath

public TreePath(TreeNode node)
Method Detail

getPath

public int[] getPath()

getLength

public int getLength()

getPathString

public String getPathString()
Deprecated. since 2.0.0


getParentPathString

@Deprecated
public String getParentPathString()
Deprecated. since 1.5.0


getNode

@Deprecated
public DefaultMutableTreeNode getNode(DefaultMutableTreeNode tree)
Deprecated. since 2.0.0

Returns the node at the position of this NodePath applied to the parameter node.

Parameters:
tree - The start node.
Returns:
The node applied to the given path.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2014 The Apache Software Foundation. All Rights Reserved.