public boolean isPeptideOrRna ( ) throws SimplePolymerSectionException { if ( polymerElements . size ( ) >= 1 ) { if ( polymerElements . get ( polymerElements . size ( ) - 1 ) . matches ( "(PEPTIDE[1-9][0-9]*+|RNA[1-9][0-9]*)" ) ) { return true ; } return false ; } else { throw new SimplePolymerSectionException ( "No Polymer Id is found" ) ; } }
method to check if the last added polymer element is a peptide or a rna