nz.ac.waikato.jdsl.core.api
Interface InspectableBinaryTree

All Superinterfaces:
InspectableContainer, InspectablePositionalContainer, InspectableTree
All Known Subinterfaces:
BinaryTree
All Known Implementing Classes:
NodeBinaryTree

public interface InspectableBinaryTree
extends InspectableTree

Please refer to the documentation of the BinaryTree interface.

Version:
JDSL 2.1.1
Author:
Mike Boilen (mgb)
See Also:
BinaryTree

Method Summary
 Position leftChild(Position node)
          Provides the left child of a given node.
 Position rightChild(Position node)
          Provides the right child of a given node.
 Position sibling(Position node)
          Provides the sibling of a given node (the other child of the node's parent)
 
Methods inherited from interface nz.ac.waikato.jdsl.core.api.InspectableTree
childAtRank, children, firstChild, isExternal, isInternal, isRoot, lastChild, numChildren, parent, rankOfChild, root, siblingAfter, siblingBefore, siblings
 
Methods inherited from interface nz.ac.waikato.jdsl.core.api.InspectablePositionalContainer
positions
 
Methods inherited from interface nz.ac.waikato.jdsl.core.api.InspectableContainer
contains, elements, isEmpty, size
 

Method Detail

leftChild

Position leftChild(Position node)
                   throws BoundaryViolationException,
                          InvalidAccessorException
Provides the left child of a given node.

Parameters:
node - Any internal node of the tree
Returns:
left child of node
Throws:
BoundaryViolationException - if node is external
InvalidAccessorException - if node is null or does not belong to this binary tree.

rightChild

Position rightChild(Position node)
                    throws BoundaryViolationException,
                           InvalidAccessorException
Provides the right child of a given node.

Parameters:
node - Any internal node of the tree
Returns:
right child of node
Throws:
BoundaryViolationException - if node is external
InvalidAccessorException - if node is null or does not belong to this binary tree.

sibling

Position sibling(Position node)
                 throws InvalidAccessorException,
                        BoundaryViolationException
Provides the sibling of a given node (the other child of the node's parent)

Parameters:
node - a node of the binary tree.
Returns:
sibling of node.
Throws:
BoundaryViolationException - if node is the root
InvalidAccessorException - if node is null or does not belong to this binary tree.


Copyright © 2009 ModelJUnit Project. All Rights Reserved.