public void addResidue ( Residue residue ) { if ( residues == null ) residues = new ArrayList < Residue > ( ) ; //Check if exists if ( residues . contains ( residue ) ) { System . out . println ( "Residue: " + residue . getName ( ) + " already present in molecule: " + getID ( ) ) ; return ; } residues . add ( residue ) ; }
Add a Residue to the MDMolecule if not already present .