@Override public boolean remove(MetabolicReaction rxn) { // remove links to metabolites for (MetabolicParticipant p : rxn.getParticipants()) { Metabolite m = p.getMolecule(); participantMap.get(m.getIdentifier()).remove(rxn); if (participantMap.get(m.getIdentifier()).isEmpty()) { participantMap.removeAll(m.getIdentifier()); } } reactionMap.remove(rxn.getIdentifier(), rxn); return super.remove(rxn); }
/** * Returns a list of reactions that contain Metabolite m If not mapping is found an empty * collection is returned */ public Collection<MetabolicReaction> getReactions(Metabolite m) { return participantMap.get(m.getIdentifier()); }
/** @inheritDoc */ public boolean removeKey(Metabolite m, Reaction reaction) { return participantMap.remove(m.getIdentifier(), reaction); }