org.eclipse.actf.model.traverse
Interface ITreeNodeWalker

All Superinterfaces:
INodeWalker
All Known Implementing Classes:
AbstractTreeNodeWalker, AccessibleElementTreeWalker, DomTreeNodeWalker, MozillaDomTreeWalker

public interface ITreeNodeWalker
extends INodeWalker

used to traverse the nodes in a hierarchical structure. The nodes are usually of homogeneous in that the type of nodes is typically defined by an IModel object.

Author:
Mike Squillace

Method Summary
 Object getChild(Object element, int index)
          returns the child at the given index of the given node.
 Object[] getChildren(Object element)
          returns the children of the given node.
 Object[] getFilteredChildren(Object element)
          returns the children of the given node that pass all filteres that were added using the addNodeFilter method.
 Object getParent(Object element)
          return the parent of the given node.
 boolean hasChildren(Object element)
          returns whether or not the given node has any children.
 void setComponentBridgeMap(Map bridgeMap)
          map for associating nodes of heterogeneous types.
 
Methods inherited from interface org.eclipse.actf.model.traverse.INodeWalker
addNodeFilter, getFilteredSuccessorNodes, getPredecessorNodes, getStartNodes, getSuccessorNodes, removeAllFilters, removeNodeFilter
 

Method Detail

getChildren

Object[] getChildren(Object element)
                     throws InvalidComponentException
returns the children of the given node.

Parameters:
element - - node of tree
Returns:
children of given node or empty array if no children are found
Throws:
InvalidComponentException - if the element is disposed or otherwise invalid

getChild

Object getChild(Object element,
                int index)
                throws InvalidComponentException
returns the child at the given index of the given node.

Parameters:
element - - node of tree
index - - index of desired child
Returns:
child at index in given node or null if no child at the given index is available or the index is beyond the number of children for this element
Throws:
InvalidComponentException - if element is disposed or otherwise invalid

getFilteredChildren

Object[] getFilteredChildren(Object element)
                             throws InvalidComponentException
returns the children of the given node that pass all filteres that were added using the addNodeFilter method.

Parameters:
element - - node of tree
Returns:
filtered children of given node or empty array if no children are found
Throws:
InvalidComponentException - if component is disposed or otherwise invalid
See Also:
INodeWalker.getFilteredSuccessorNodes(Object), INodeWalker.addNodeFilter(INodeFilter)

hasChildren

boolean hasChildren(Object element)
                    throws InvalidComponentException
returns whether or not the given node has any children.

Parameters:
element - - node of tree
Returns:
true if node has children, false otherwise
Throws:
InvalidComponentException - if component is disposed or otherwise invalid

getParent

Object getParent(Object element)
                 throws InvalidComponentException
return the parent of the given node.

Parameters:
element - - node of tree
Returns:
parent of given node or null if node has no parent
Throws:
InvalidComponentException - if component is disposed or otherwise invalid

setComponentBridgeMap

void setComponentBridgeMap(Map bridgeMap)
map for associating nodes of heterogeneous types. The map should contain keys that are parents and each parent key should be associated with a child to which the walker can traverse once it encounters the parent. Bridge maps are useful for traversing nodes of vastly different types linked via unconventional mechanisms.

Parameters:
bridgeMap -