@ Override public void addAtom ( IAtom oAtom , IStrand oStrand ) { int atomCount = super . getAtomCount ( ) ; // Add atom to AtomContainer super . addAtom ( oAtom ) ; if ( atomCount != super . getAtomCount ( ) && oStrand != null ) { // Maybe better to throw null pointer exception here, so user realises that // Strand == null and Atom only gets added to this BioPolymer, but not to a Strand. oStrand . addAtom ( oAtom ) ; if ( ! strands . containsKey ( oStrand . getStrandName ( ) ) ) { strands . put ( oStrand . getStrandName ( ) , oStrand ) ; } } /* * notifyChanged() is called by addAtom in AtomContainer */ }
Adds the atom oAtom to a specified Strand whereas the Monomer is unspecified . Hence the atom will be added to a Monomer of type UNKNOWN in the specified Strand .