public void addChild(TreeElement child)
            throws IllegalArgumentException
    {

        TreeElement theChild = child;
        theChild.setParent(this);
        if (getName() == null) {
            setName("0");
        }
        if (_children == null) {
            _children = new ArrayList();
        }
        //int n = _children.size();
        //if (n > 0) {
        //    TreeElement node = (TreeElement) _children.get(n - 1);
        //    node.setLast(false);
        //}
        //theChild.setLast(true);
        _children.add(child);
        int n = _children.size();
        theChild.updateName(this, n - 1);
    }
public void addChild ( TreeElement child ) throws IllegalArgumentException { TreeElement theChild = child ; theChild . setParent ( this ) ; if ( getName ( ) == null ) { setName ( "0" ) ; } if ( _children == null ) { _children = new ArrayList ( ) ; } _children . add ( child ) ; int n = _children . size ( ) ; theChild . updateName ( this , n - 1 ) ; }
Add a new child node to the end of the list.
@param child The new child node
@throws IllegalArgumentException if the name of the new child
node is not unique