package jdsl.tree; import jdsl.Position; import jdsl.InvalidPositionException; public interface BinaryTree { public boolean isRoot(Position pos) throws InvalidPositionException; public boolean isInternal(Position pos) throws InvalidPositionException; public boolean isExternal(Position pos) throws InvalidPositionException; public Position root( ); public Position parent(Position pos) throws InvalidPositionException; public Position leftChild(Position pos) throws InvalidPositionException; public Position rightChild(Position pos) throws InvalidPositionException; public Position sibling(Position pos) throws InvalidPositionException; public void swap(Position one, Position two) throws InvalidPositionException; public Object replace(Position pos, Object item) throws InvalidPositionException; public Position expandExternal(Position pos) throws InvalidPositionException; public Object removeAboveExternal(Position pos) throws InvalidPositionException; }