|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Provides a hierarchy organized as a tree of IDs.
The hierarchy is managed using only the IDs
of the entities and their parent-child relationship.
The hierarchy provider implies no meaning concerning these 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.
| Method Summary | |
void |
addHierarchyProviderListener(HierarchyProviderListener listener)
Registers a listener that observes changes in the hierarchy. |
int |
getChildCount(ID parentId,
boolean deep,
boolean leafesOnly)
Returns the number of childs for the given parent id. |
ID[] |
getChildren(ID parentId)
Returns the children of a node. |
ID |
getParentForChild(ID id)
Returns the parent id of a node. |
ID[] |
getRoots()
Returns the root nodes. |
boolean |
hasID(ID id)
Tests whether a given ID is known in the hierarchy either as a parent or as a child. |
boolean |
isChild(ID id1,
ID id2,
boolean deep)
Checks if id2 is a child of id1.
|
void |
removeHierarchyProviderListener(HierarchyProviderListener listener)
Unregisters a listener. |
| Method Detail |
public boolean hasID(ID id)
id - the id to be tested
public ID[] getChildren(ID parentId)
parentId - the id of the parent node
IDs of the children
java.lang.IllegalArgumentException - if the parent id is unknownpublic ID getParentForChild(ID id)
id - the id of the child node
java.lang.IllegalArgumentException - if the id is unknown
public boolean isChild(ID id1,
ID id2,
boolean deep)
id2 is a child of id1.
The check is done down the whole sub hierarchy of id1
if deep = true.
Else only direct childs are considered.
id1 - the potential parentid2 - the potential childdeep - true: The check is done down the whole sub hierarchy
false: only direct childs are considered
public int getChildCount(ID parentId,
boolean deep,
boolean leafesOnly)
parentId - the ID of the parent to count childs ofdeep - if true, the whole subtree will be counted,
if false, only direct childs are countedleafesOnly - if true, the returned number is
restricted to leafes (childs, that have no childs themselfes)
public ID[] getRoots()
IDs of the root nodes.public void addHierarchyProviderListener(HierarchyProviderListener listener)
listener - the listener to be addedpublic void removeHierarchyProviderListener(HierarchyProviderListener listener)
listener - the listener to be removed
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||