com.ibm.ccd.ui.portlets.catalog
Class CatalogTree

java.lang.Object
  extended by com.ibm.ccd.ui.portlets.catalog.CatalogTree

public class CatalogTree
extends java.lang.Object

This class Constructs a logical tree structure which represents Catalog, Categories and Items. The item is the leaf in this catalog tree


Field Summary
static int CATALOG
           
static int CATEGORY
           
static int HIERARCHY
           
static int ITEM
           
static int ROOT
           
static int UNASSIGNED
           
 
Constructor Summary
CatalogTree()
          Creates a Catalog Tree with root node
 
Method Summary
 void add(ItemNodeCatalog child)
           
 void addChild(ItemNodeCatalog parent, ItemNodeCatalog child)
          Add child node to this parent node
 ItemNodeCatalog getRoot()
          Return the root node of the tree
 void removeChild(ItemNodeCatalog child)
          Removes this node from its Parent Node
 ItemNodeCatalog searchNode(ItemNodeCatalog start, ItemNodeCatalog search)
           
 ItemNodeCatalog searchNode(ItemNodeCatalog start, java.lang.String id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT

public static final int ROOT
See Also:
Constant Field Values

CATALOG

public static final int CATALOG
See Also:
Constant Field Values

CATEGORY

public static final int CATEGORY
See Also:
Constant Field Values

ITEM

public static final int ITEM
See Also:
Constant Field Values

HIERARCHY

public static final int HIERARCHY
See Also:
Constant Field Values

UNASSIGNED

public static final int UNASSIGNED
See Also:
Constant Field Values
Constructor Detail

CatalogTree

public CatalogTree()
Creates a Catalog Tree with root node

Method Detail

searchNode

public ItemNodeCatalog searchNode(ItemNodeCatalog start,
                                  java.lang.String id)
Parameters:
start - search for the item from this node
id - search by item id
Returns:
itemNode return itemNode from start of the tree otherwise null

searchNode

public ItemNodeCatalog searchNode(ItemNodeCatalog start,
                                  ItemNodeCatalog search)

getRoot

public ItemNodeCatalog getRoot()
Return the root node of the tree

Returns:
root

add

public void add(ItemNodeCatalog child)

addChild

public void addChild(ItemNodeCatalog parent,
                     ItemNodeCatalog child)
Add child node to this parent node

Parameters:
parent -
child -

removeChild

public void removeChild(ItemNodeCatalog child)
Removes this node from its Parent Node

Parameters:
child -