private static boolean checkSingleAttachment ( List < Monomer > monomers , String rGroup , HELM2Notation helm2notation , ConnectionNotation not , InterConnections interconnection , String id ) throws AttachmentException { for ( Monomer monomer : monomers ) { /* Are the attachment points there */ checkAttachmentPoint ( monomer , rGroup ) ; /* is the attachment point already occupied by another monomer? */ String detail = not . getSourceUnit ( ) + "$" + not . getrGroupSource ( ) ; /* Is the attachment point already occupied by another monomer */ /* Intra connections */ if ( helm2notation . getSimplePolymer ( id ) . getMapIntraConnection ( ) . containsKey ( detail ) ) { throw new AttachmentException ( "Attachment point is already occupied" ) ; } /* Inter connections */ detail = id + "$" + detail ; /* check */ if ( interconnection . hasKey ( detail ) ) { throw new AttachmentException ( "Attachment point is already occupied" ) ; } } return true ; }
method to check for one attachment point the validation