public boolean replaceDataset ( InvDatasetImpl remove , InvDatasetImpl add ) { for ( int i = 0 ; i < datasets . size ( ) ; i ++ ) { InvDataset dataset = datasets . get ( i ) ; if ( dataset . equals ( remove ) ) { datasets . set ( i , add ) ; InvCatalogImpl cat = ( InvCatalogImpl ) getParentCatalog ( ) ; if ( cat != null ) { cat . removeDatasetByID ( remove ) ; cat . addDatasetByID ( add ) ; } return true ; } } return false ; }
Replace the given dataset if it is a nesetd dataset .