public void replace(int offset,int length,Element[] elems){
  int delta=elems.length - length;
  int src=offset + length;
  int nmove=nchildren - src;
  int dest=src + delta;
  if ((nchildren + delta) >= children.length) {
    int newLength=Math.max(2 * children.length,nchildren + delta);
    AbstractElement[] newChildren=new AbstractElement[newLength];
    System.arraycopy(children,0,newChildren,0,offset);
    System.arraycopy(elems,0,newChildren,offset,elems.length);
    System.arraycopy(children,src,newChildren,dest,nmove);
    children=newChildren;
  }
 else {
    System.arraycopy(children,src,children,dest,nmove);
    System.arraycopy(elems,0,children,offset,elems.length);
  }
  nchildren=nchildren + delta;
}

public void replace ( int offset , int length , Element [ ] elems ) { int delta = elems . length - length ; int src = offset + length ; int nmove = nchildren - src ; int dest = src + delta ; if ( ( nchildren + delta ) >= children . length ) { int newLength = Math . max ( 2 * children . length , nchildren + delta ) ; AbstractElement [ ] newChildren = new AbstractElement [ newLength ] ; System . arraycopy ( children , 0 , newChildren , 0 , offset ) ; System . arraycopy ( elems , 0 , newChildren , offset , elems . length ) ; System . arraycopy ( children , src , newChildren , dest , nmove ) ; children = newChildren ; } else { System . arraycopy ( children , src , children , dest , nmove ) ; System . arraycopy ( elems , 0 , children , offset , elems . length ) ; } nchildren = nchildren + delta ; }
replaces content with a new set of elements .
