@Override public SpeciesReference clone() { return new SpeciesReference(this); }
/** * * @param id * @return */ public SpeciesReference createProduct(String id) { SpeciesReference product = new SpeciesReference(id, getLevel(), getVersion()); addProduct(product); return product; }
/** * Creates a new {@link SpeciesReference} with the given identifier and adds * it to this {@link Reaction}'s {@link #listOfReactants}. * * @param id * the id of the {@link SpeciesReference} that is to be created. * @return a new instance of {@link SpeciesReference}, which is already linked * to this {@link Reaction}. */ public SpeciesReference createReactant(String id) { SpeciesReference reactant = new SpeciesReference(id, getLevel(), getVersion()); addReactant(reactant); return reactant; }
/** * 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); } }