All Packages Class Hierarchy This Package Previous Next Index
Interface jdsl.core.api.InspectableBinaryTree
- public interface InspectableBinaryTree
- extends InspectableTree
Interface for a binary tree, or a data structure that can be viewed
as a binary tree. No methods that modify the tree are provided;
the tree can only be viewed.
For a binary tree, methods Container.elements() and
PositionalContainer.positions() are guaranteed to return
enumerations in preorder order.
- Version:
- Mon Aug 11 20:39:06 EDT 1997
- Author:
- Mark Handy
-
leftChild(Position)
-
Gets the left child of p
-
rightChild(Position)
-
Gets the right child of p.
-
sibling(Position)
-
Gets the sibling
Position
of the
Position
passed in.
leftChild
public abstract Position leftChild(Position p) throws InvalidPositionException, BoundaryViolationException, InvalidContainerException
- Gets the left child of p
- Parameters:
- p - Any node of the tree
- Returns:
- left child of the given node
- Throws: BoundaryViolationException
- If Position p is external
- Throws: InvalidPositionException
- If Position p is null or incompatible
with this container
- Throws: InvalidContainerException
- If this container is invalid.
rightChild
public abstract Position rightChild(Position p) throws InvalidPositionException, BoundaryViolationException, InvalidContainerException
- Gets the right child of p.
- Parameters:
- p - Any node of the tree
- Returns:
- right child of the given node
- Throws: BoundaryViolationException
- If Position p is external
- Throws: InvalidPositionException
- If Position p is null or incompatible
with this container
- Throws: InvalidContainerException
- If this container is invalid.
sibling
public abstract Position sibling(Position p) throws InvalidPositionException, BoundaryViolationException, InvalidContainerException
- Gets the sibling
Position
of the
Position
passed in.
- Parameters:
- otherChild - Any node of the tree
- Returns:
- sibling of the given node (the other child of this node's parent)
- Throws: BoundaryViolationException
- If Position p is the root
- Throws: InvalidPositionException
- If Position p is null or incompatible
with this container
- Throws: InvalidContainerException
- If this container is invalid.
All Packages Class Hierarchy This Package Previous Next Index