jdsl.core.api
Interface InspectableBinaryTree
- All Superinterfaces:
- InspectableContainer, InspectablePositionalContainer, InspectableTree
- All Known Subinterfaces:
- BinaryTree
- public interface InspectableBinaryTree
- extends InspectableTree
Please refer to the documentation of the BinaryTree
interface.
- Version:
- $Id: InspectableBinaryTree.java,v 1.4 1999/08/14 00:00:12 lv Exp $
- Author:
- Mike Boilen (mgb)
- See Also:
BinaryTree
Methods inherited from interface jdsl.core.api.InspectableTree |
childAtRank, children, firstChild, isExternal, isInternal, isRoot, lastChild, numChildren, parent, rankOfChild, root, siblingAfter, siblingBefore, siblings |
leftChild
public 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
externalInvalidAccessorException
- if node
is null
or does not belong to this binary tree.
rightChild
public 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
externalInvalidAccessorException
- if node
is null
or does not belong to this binary tree.
sibling
public 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
rootInvalidAccessorException
- if node
is null
or does not belong to this binary tree.