use of model.Monomer in project Smiles2Monomers by yoann-dufresne.
the class FamilyDB method addObject.
@Override
public void addObject(String id, Family f) {
Family prev = null;
for (Monomer m : f.getMonomers()) if (this.database.containsKey(m.getId())) {
prev = this.database.get(m.getId());
break;
}
if (prev == null) {
for (Monomer m : f.getMonomers()) {
super.addObject(m.getId(), f);
this.uniqFamilies.add(f);
}
} else {
for (Monomer m : f.getMonomers()) {
prev.addMonomer(m);
this.database.put(m.getId(), prev);
}
for (Residue res : f.getResidues()) prev.addResidue(res);
for (Link l : f.getDepandances()) prev.addDependance(l);
}
}
Aggregations