org.eclipse.actf.accservice.core
Class AccessibleElementTreeWalker

java.lang.Object
  extended by org.eclipse.actf.model.traverse.AbstractNodeWalker
      extended by org.eclipse.actf.model.traverse.AbstractTreeNodeWalker
          extended by org.eclipse.actf.accservice.core.AccessibleElementTreeWalker
All Implemented Interfaces:
INodeWalker, ITreeNodeWalker

public class AccessibleElementTreeWalker
extends AbstractTreeNodeWalker

implementation of TreeWalker for walking a tree of IAccessibleElement

Author:
Mike Squillace
See Also:
IAccessibleElement

Field Summary
 
Fields inherited from class org.eclipse.actf.model.traverse.AbstractTreeNodeWalker
clCache, componentBridgeMap, configuration
 
Fields inherited from class org.eclipse.actf.model.traverse.AbstractNodeWalker
nodeFilters
 
Constructor Summary
AccessibleElementTreeWalker()
           
 
Method Summary
 Object getChild(Object element, int index)
          default implementation returns the child at the specified index in the array returned by a call to getChildren.
 Object[] getChildren(Object element)
          returns the children of the given node.
 Object getParent(Object element)
          return the parent of the given node.
 Object[] getStartNodes()
          get the starting nodes of the graph.
 boolean hasChildren(Object element)
          returns whether or not the given node has any children.
 
Methods inherited from class org.eclipse.actf.model.traverse.AbstractTreeNodeWalker
getBridgedChild, getBridgedParent, getFilteredChildren, getFilteredSuccessorNodes, getPredecessorNodes, getSuccessorNodes, setComponentBridgeMap
 
Methods inherited from class org.eclipse.actf.model.traverse.AbstractNodeWalker
addNodeFilter, removeAllFilters, removeNodeFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.actf.model.traverse.INodeWalker
addNodeFilter, removeAllFilters, removeNodeFilter
 

Constructor Detail

AccessibleElementTreeWalker

public AccessibleElementTreeWalker()
Method Detail

getChildren

public Object[] getChildren(Object element)
                     throws InvalidComponentException
Description copied from interface: ITreeNodeWalker
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

public Object getChild(Object element,
                       int index)
                throws InvalidComponentException
default implementation returns the child at the specified index in the array returned by a call to getChildren. This method should be overwritten by clients (if possible) for the sake of performance.

Specified by:
getChild in interface ITreeNodeWalker
Overrides:
getChild in class AbstractTreeNodeWalker
Parameters:
element - - node of tree
index - - index of desired child
Returns:
child at specified index in array of children returned by getChildren
Throws:
InvalidComponentException - if element is disposed or otherwise invalid

getParent

public 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

hasChildren

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

Specified by:
hasChildren in interface ITreeNodeWalker
Overrides:
hasChildren in class AbstractTreeNodeWalker
Parameters:
element - - node of tree
Returns:
true if node has children, false otherwise
Throws:
InvalidComponentException - if component is disposed or otherwise invalid

getStartNodes

public Object[] getStartNodes()
Description copied from interface: INodeWalker
get the starting nodes of the graph. These are the nodes of the graph that have no predecessors.

Returns:
starting nodes of graph