Traceability

org.topcased.traceability.hmi.util
Class Tree

java.lang.Object
  extended by org.topcased.traceability.hmi.util.Tree

public class Tree
extends java.lang.Object

Created on 21 f�vr. 07


Constructor Summary
Tree()
          Default constructor
 
Method Summary
 void addBranch(java.util.List<java.lang.Object> branch)
          Add to the tree a branch.
 void addNode(java.lang.Object parent, java.lang.Object child)
          Add to the tree under the given parent object, a given child
 void addRoots(java.util.List<java.lang.Object> roots)
          Add to the tree some roots
 boolean contains(java.lang.Object object)
          Return true if the given object belongs to this tree
 java.lang.Object[] getChildren(java.lang.Object parent)
          Get the children of the given object
 java.lang.Object getParent(java.lang.Object object)
          Return the model object parent of the given object
 java.lang.Object[] getRoots()
          Get the roots of the tree
 java.util.List<java.lang.Object> listChildren(java.lang.Object parent)
          Get the children of the given object
 void putRootAsParent(CoverPoint newRoot, java.util.List oldRoots)
          Insert a cover point node as a root node, parent of its document node.
 void removeNode(java.lang.Object parent, java.lang.Object child)
           
 void removeNodes(java.lang.Object parent)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tree

public Tree()
Default constructor

Method Detail

addRoots

public void addRoots(java.util.List<java.lang.Object> roots)
Add to the tree some roots

Parameters:
roots -

addBranch

public void addBranch(java.util.List<java.lang.Object> branch)
Add to the tree a branch. Missing nodes are created

Parameters:
branch -

addNode

public void addNode(java.lang.Object parent,
                    java.lang.Object child)
Add to the tree under the given parent object, a given child

Parameters:
parent -
child -

removeNode

public void removeNode(java.lang.Object parent,
                       java.lang.Object child)

removeNodes

public void removeNodes(java.lang.Object parent)

contains

public boolean contains(java.lang.Object object)
Return true if the given object belongs to this tree

Parameters:
object -
Returns:
true if model object is present.

getParent

public java.lang.Object getParent(java.lang.Object object)
Return the model object parent of the given object

Parameters:
object -
Returns:
a model object

getRoots

public java.lang.Object[] getRoots()
Get the roots of the tree

Returns:
an array of the top elements

getChildren

public java.lang.Object[] getChildren(java.lang.Object parent)
Get the children of the given object

Parameters:
parent -
Returns:
an array

listChildren

public java.util.List<java.lang.Object> listChildren(java.lang.Object parent)
Get the children of the given object

Parameters:
parent -
Returns:
a list

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

putRootAsParent

public void putRootAsParent(CoverPoint newRoot,
                            java.util.List oldRoots)
Insert a cover point node as a root node, parent of its document node. The old root nodes corresponding to documents are made 'non root' nodes.


Traceability

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.