javax.rad.model
Class TreePath

java.lang.Object
  extended by javax.rad.model.TreePath

public class TreePath
extends Object

A TreePath stores the path of .


Constructor Summary
TreePath(int... pPath)
          Constructs a new TreePath.
 
Method Summary
 boolean containsAsParent(TreePath pTreePath)
          Returns true, if the given tree path is a parent path of this tree path.
 boolean equals(Object pObject)
          
 int get(int pIndex)
          Gets the value of given index.
 TreePath getChildPath(int... pArray)
          Adds the given array to this TreePath.
 int getLast()
          Gets the value of the last index.
 TreePath getParentPath()
          Gets the parent tree path.
 TreePath getSubPath(int pLevel)
          Returns the sub path from the position of the given level.
 int hashCode()
          
 int length()
          Gets the length of the array.
 TreePath set(int pIndex, int pValue)
          Sets the value of a given index.
 int[] toArray()
          Gets a mutable array of this immutable array.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreePath

public TreePath(int... pPath)
Constructs a new TreePath.

Parameters:
pPath - tree path.
Method Detail

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object pObject)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object

length

public int length()
Gets the length of the array.

Returns:
the length of the array.

get

public int get(int pIndex)
Gets the value of given index.

Parameters:
pIndex - the index.
Returns:
the value of given index.

getLast

public int getLast()
Gets the value of the last index.

Returns:
the value of the last index.

getSubPath

public TreePath getSubPath(int pLevel)
Returns the sub path from the position of the given level.

Parameters:
pLevel - the start level.
Returns:
the sub path

set

public TreePath set(int pIndex,
                    int pValue)
Sets the value of a given index.

Parameters:
pIndex - the index.
pValue - the value.
Returns:
the new TreePath.

getChildPath

public TreePath getChildPath(int... pArray)
Adds the given array to this TreePath.

Parameters:
pArray - the array.
Returns:
the new TreePath.

getParentPath

public TreePath getParentPath()
Gets the parent tree path.

Returns:
the new TreePath.

containsAsParent

public boolean containsAsParent(TreePath pTreePath)
Returns true, if the given tree path is a parent path of this tree path. This means, that the tree path is either equal, or the given tree is a parent tree path of this tree path.

Parameters:
pTreePath - the parent tree path.
Returns:
true, if the given tree path is a parent path of this tree path.

toArray

public int[] toArray()
Gets a mutable array of this immutable array.

Returns:
a mutable array,


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.