public void onStoichiometryUpdate(T entity, Stoichiometry oldStoichiometry) { if (oldStoichiometry == null){ entityChangeLogger.log(Level.INFO, "The stoichiometry has been initialised for the entity " + entity.toString()); } else if (entity.getStoichiometry() == null){ entityChangeLogger.log(Level.INFO, "The stoichiometry has been reset for the entity " + entity.toString()); } else { entityChangeLogger.log(Level.INFO, "The stoichiometry " + oldStoichiometry + " has been updated with " + entity.getStoichiometry() + " in the entity " + entity.toString()); } }
/** * Use DefaultExactParticipantBaseComparator to know if two participants are equals. * @param participant1 * @param participant2 * @return true if the two participants are equal */ public static boolean areEquals(Participant participant1, Participant participant2, boolean ignoreInteractors){ if (participant1 == participant2){ return true; } else if (participant1 == null || participant2 == null){ return false; } else { if (!DefaultExactEntityBaseComparator.areEquals(participant1, participant2, ignoreInteractors)){ return false; } // then compares the stoichiometry Stoichiometry stc1 = participant1.getStoichiometry(); Stoichiometry stc2 = participant2.getStoichiometry(); return StoichiometryComparator.areEquals(stc1, stc2); } } }
public void writeParticipantStoichiometry(P participant) throws IOException { if (participant != null){ if (participant.getStoichiometry() != null){ Stoichiometry stc = participant.getStoichiometry(); // same stoichiometry max/end if (stc.getMaxValue() == stc.getMinValue()){ getWriter().write(Long.toString(stc.getMinValue())); } else{ getWriter().write(Long.toString(stc.getMinValue())); getWriter().write("-"); getWriter().write(Long.toString(stc.getMaxValue())); } } else{ getWriter().write(MitabUtils.EMPTY_COLUMN); } } else { getWriter().write(MitabUtils.EMPTY_COLUMN); } }
if (p.getStoichiometry() == null || p.getStoichiometry().getMaxValue() == 0){ else if (p.getStoichiometry().getMaxValue() == 1){ return ComplexType.self_intra_molecular;
ParticipantCloner.copyAndOverrideBasicParticipantProperties(first, clone, true); if (first.getStoichiometry() != null){ clone.setStoichiometry(0); ParticipantCloner.copyAndOverrideBasicParticipantProperties(first, clone2, true); if (first.getStoichiometry() != null){ clone2.setStoichiometry(0);
if (source != null && target != null){ target.setBiologicalRole(source.getBiologicalRole()); target.setStoichiometry(source.getStoichiometry());
getStoichiometryWriter().write(object.getStoichiometry());