public void replace ( TLVElement childToBeReplaced , TLVElement newChild ) { for ( int i = 0 ; i < children . size ( ) ; i ++ ) { if ( children . get ( i ) . equals ( childToBeReplaced ) ) { children . set ( i , newChild ) ; return ; } } }
Replaces first element with given one .