/** * * @param id * @param species * @return */ public SpeciesReference createReactant(String id, String species) { SpeciesReference specRef = createReactant(id); specRef.setSpecies(species); return specRef; }
/** * * @param id * @param species * @return */ public SpeciesReference createProduct(String id, String species) { SpeciesReference specRef = createProduct(id); specRef.setSpecies(species); return specRef; }
/** * Creates a new {@link SpeciesReference} with the given {@code id} as * identifier, which points to the given {@link Species} and adds it to the * {@link #listOfReactants}. * * @param id * the identifier of the {@link SpeciesReference} to be created. * @param species * the {@link Species} to which this reactant should point. * @return a pointer to the newly created {@link SpeciesReference}. */ public SpeciesReference createReactant(String id, Species species) { SpeciesReference specRef = createReactant(id); specRef.setSpecies(species); return specRef; }
/** * Creates a new {@link SpeciesReference} with the given {@code id} as * its identifier, which points to the given {@link Species}, adds it to * this {@link Reaction}'s {@link #listOfProducts} and returns a pointer to * it. * * @param id * the identifier of the {@link SpeciesReference} to be created. * @param species * the {@link Species} to which the {@link SpeciesReference} * should point. * @return a pointer to a newly created {@link SpeciesReference} that has * been added to this {@link Reaction}'s {@link #listOfProducts}. */ public SpeciesReference createProduct(String id, Species species) { SpeciesReference specRef = createProduct(id); specRef.setSpecies(species); return specRef; }
/** * This builds multiple reaction participants in one step and adds them to * the given list of {@link SpeciesReference}s. * * @param listOf * where to add new {@link SpeciesReference} * @param participants * the definition of stoichiometry and {@link Species} for which a * reaction participant is to be created. */ private static void buildParticipants(ListOf<SpeciesReference> listOf, Pair<Double, Species>... participants) { for (Pair<Double, Species> participant : participants) { SpeciesReference sr = new SpeciesReference(listOf.getLevel(), listOf.getVersion()); if (participant.isSetKey()) { sr.setStoichiometry(participant.getKey().doubleValue()); } if (participant.isSetValue()) { sr.setSpecies(participant.getValue()); } if (listOf.getLevel() > 2) { sr.setConstant(true); } listOf.add(sr); } }