public boolean addChild(E edge,V parent,V child,EdgeType edgeType){
  Collection<V> vertices=delegate.getVertices();
  if (vertices.contains(parent) == false) {
    throw new IllegalArgumentException("Tree must already contain parent " + parent);
  }
  if (vertices.contains(child)) {
    throw new IllegalArgumentException("Tree must not already contain child " + child);
  }
  vertex_depths.put(child,vertex_depths.get(parent) + 1);
  return delegate.addEdge(edge,parent,child,edgeType);
}

public boolean addChild ( E edge , V parent , V child , EdgeType edgeType ) { Collection < V > vertices = delegate . getVertices ( ) ; if ( vertices . contains ( parent ) == false ) { throw new IllegalArgumentException ( "Tree must already contain parent " + parent ) ; } if ( vertices . contains ( child ) ) { throw new IllegalArgumentException ( "Tree must not already contain child " + child ) ; } vertex_depths . put ( child , vertex_depths . get ( parent ) + 1 ) ; return delegate . addEdge ( edge , parent , child , edgeType ) ; }
add the passed child node as a child of parent . parent must exist in the tree , and child must not already exist .
