All Packages Class Hierarchy This Package Previous Next Index
Interface jdsl.core.api.InspectableTree
- public interface InspectableTree
- extends PositionalContainer
Interface that defines the properties of an InspectableTree
- Version:
- $Revision: 1.3 $, $Date: 1998/07/07 19:27:42 $
- Author:
- Mike Boilen (mgb)
-
children(Position)
-
The returned Enumeration is guaranteed to give the children in order from left to right.
-
isExternal(Position)
-
-
isInternal(Position)
-
-
isRoot(Position)
-
-
parent(Position)
-
-
root()
-
Note that trees always have at least one external node, so they always
have a root.
-
siblings(Position)
-
The returned Enumeration is guaranteed to give the siblings in order from left to right.
isRoot
public abstract boolean isRoot(Position p) throws InvalidPositionException, InvalidContainerException
- Parameters:
- p - Any node of the tree
- Returns:
- Whether the given node is the root of the tree
- Throws: InvalidPositionException
- if p is null or is incompatible with
this container
- Throws: InvalidContainerException
- if this container is invalid
isInternal
public abstract boolean isInternal(Position p) throws InvalidPositionException, InvalidContainerException
- Parameters:
- p - Any node of the tree
- Returns:
- Whether the given node has at least one child
- Throws: InvalidPositionException
- if p is null or is incompatible with
this container
- Throws: InvalidContainerException
- if this container is invalid
isExternal
public abstract boolean isExternal(Position p) throws InvalidPositionException, InvalidContainerException
- Parameters:
- p - Any node of the tree
- Returns:
- Whether the given node has zero children
- Throws: InvalidPositionException
- if p is null or is incompatible with
this container
- Throws: InvalidContainerException
- if this container is invalid
root
public abstract Position root() throws InvalidContainerException
- Note that trees always have at least one external node, so they always
have a root.
- Returns:
- The top node of the tree
- Throws: InvalidContainerException
- if this container is invalid
parent
public abstract Position parent(Position p) throws InvalidPositionException, BoundaryViolationException, InvalidContainerException
- Parameters:
- p - Any node of the tree
- Returns:
- Parent Position of the given node
- Throws: BoundaryViolationException
- If p is the root of the tree
- Throws: InvalidPositionException
- if p is null or is incompatible with
this container
- Throws: InvalidContainerException
- if this container is invalid
children
public abstract Enumeration children(Position p) throws InvalidPositionException, InvalidContainerException
- The returned Enumeration is guaranteed to give the children in order from left to right.
- Parameters:
- p - Any node of the tree
- Returns:
- Enumeration of all the children of that node
- Throws: InvalidPositionException
- if p is null or is incompatible with
this container
- Throws: InvalidContainerException
- if this container is invalid
siblings
public abstract Enumeration siblings(Position p) throws InvalidPositionException, InvalidContainerException
- The returned Enumeration is guaranteed to give the siblings in order from left to right.
- Parameters:
- p - Any node of the tree
- Returns:
- Enumeration of all the other children of the same parent
- Throws: InvalidPositionException
- if p is null or is incompatible with
this container
- Throws: InvalidContainerException
- if this container is invalid
All Packages Class Hierarchy This Package Previous Next Index