com.sdm.quasar.client.core.common.hierarchy
Interface HierarchyManager

All Superinterfaces:
HierarchyProvider
All Known Implementing Classes:
DefaultHierarchyManager

public interface HierarchyManager
extends HierarchyProvider

Manages a hierarchy of IDs.

See com.sdm.quasar.client.comp.dlgdef.ctrl.DialogController for a description concerning the way the hierarchy manager is used to organize dialogs of the session.

Note: Implementations of this interface must be threadsafe.

Version:
1.0
Author:
Martin Haft, sd&m AG, Carsten Lucke, sd&m AG, Bernd Olleck, sd&m AG

Method Summary
 void addChild(ID parentId, ID childId)
          Adds a child to the node with the given parent id.
 void addRoot(ID rootId)
          Adds a new root node with the given id.
 void removeChild(ID parentId, ID childId)
          Removes the given child id from the node with the given parent id.
 void removeRoot(ID rootId)
          Removes an existing root node.
 
Methods inherited from interface com.sdm.quasar.client.core.common.hierarchy.HierarchyProvider
addHierarchyProviderListener, getChildCount, getChildren, getParentForChild, getRoots, hasID, isChild, removeHierarchyProviderListener
 

Method Detail

addRoot

public void addRoot(ID rootId)
Adds a new root node with the given id. The id must be unknown (i.e. it must not have a parent assigned or be registered as a root node yet.)

Parameters:
rootId - the id of the new root node
Throws:
java.lang.IllegalArgumentException - if the node id is known

removeRoot

public void removeRoot(ID rootId)
Removes an existing root node. The root node must not have any children.

Parameters:
rootId - the id of the root node
Throws:
java.lang.IllegalArgumentException - if the node id is unknown, the node is not a root node, or the node does have children assigned.

addChild

public void addChild(ID parentId,
                     ID childId)
Adds a child to the node with the given parent id. The child must be unknown (i.e. it must not have a parent assigned or be registered as a root node yet.)

Parameters:
parentId - the id of the parent node
childId - the id of the new child
Throws:
java.lang.IllegalArgumentException - if the parent id is unknown or the child id is known

removeChild

public void removeChild(ID parentId,
                        ID childId)
Removes the given child id from the node with the given parent id. The child must not have any children of its own.

Parameters:
parentId - the id of the parent node
childId - the id of the child node to be removed
Throws:
java.lang.IllegalArgumentException - if the parent id is unknown or the child id is unknown or if the child id is not a child of the parent id or the child has children of its own.