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


Method Index

 o children(Position)
The returned Enumeration is guaranteed to give the children in order from left to right.
 o isExternal(Position)
 o isInternal(Position)
 o isRoot(Position)
 o parent(Position)
 o root()
Note that trees always have at least one external node, so they always have a root.
 o siblings(Position)
The returned Enumeration is guaranteed to give the siblings in order from left to right.

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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