public final static void deleteMonomerNotation ( int position , PolymerNotation polymer ) throws NotationException { MonomerNotation monomerNotation = polymer . getPolymerElements ( ) . getListOfElements ( ) . get ( position ) ; if ( polymer . getPolymerElements ( ) . getListOfElements ( ) . size ( ) == 1 ) { throw new NotationException ( monomerNotation . toString ( ) + " can't be removed. Polymer has to have at least one Monomer Notation" ) ; } polymer . getPolymerElements ( ) . getListOfElements ( ) . remove ( monomerNotation ) ; }
method to delete a MonomerNotation at a specific position of the PolymerNotation