Loading src/MDB.java +4 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,10 @@ public class MDB { Molecule result = dbMolecule.areMoleculesEqual(molecule); if (result != null) { this.db.get(numAtoms).remove(dbMolecule); if( this.db.get(numAtoms).size()==0 ) { this.db.remove(numAtoms); //prevents array index error when key becomes empty } return true; // successfully delete the molecule } } Loading src/MoleculeDatabase.java +4 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,10 @@ public class MoleculeDatabase { Molecule result = dbMolecule.areMoleculesEqual(molecule); if (result != null) { this.db.get(numAtoms).remove(dbMolecule); if( this.db.get(numAtoms).size()==0 ) { this.db.remove(numAtoms); //prevents array index error when key becomes empty } return true; // successfully delete the molecule } } Loading Loading
src/MDB.java +4 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,10 @@ public class MDB { Molecule result = dbMolecule.areMoleculesEqual(molecule); if (result != null) { this.db.get(numAtoms).remove(dbMolecule); if( this.db.get(numAtoms).size()==0 ) { this.db.remove(numAtoms); //prevents array index error when key becomes empty } return true; // successfully delete the molecule } } Loading
src/MoleculeDatabase.java +4 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,10 @@ public class MoleculeDatabase { Molecule result = dbMolecule.areMoleculesEqual(molecule); if (result != null) { this.db.get(numAtoms).remove(dbMolecule); if( this.db.get(numAtoms).size()==0 ) { this.db.remove(numAtoms); //prevents array index error when key becomes empty } return true; // successfully delete the molecule } } Loading