@Override public Variable getVariableInstance() { Model m = getModel(); return m != null ? m.findVariable(variableID) : null; }
@Override public boolean isSetVariableInstance() { Model m = getModel(); return m != null ? m.findVariable(variableID) != null : false; }
@Override public Variable getVariableInstance() { Model m = getModel(); return m != null ? m.findVariable(variableID) : null; }
@Override public Variable getVariableInstance() { Model m = getModel(); return m != null ? m.findVariable(variableID) : null; }
@Override public boolean isSetVariableInstance() { Model m = getModel(); return m != null ? m.findVariable(variableID) != null : false; }
@Override public boolean isSetVariableInstance() { Model m = getModel(); return m != null ? m.findVariable(variableID) != null : false; }
/** * Searches for an instance of {@link Quantity} within all of this * {@link Model}'s components that has the given identifier (or name attribute for SBML level 1) * and returns it. There might be multiple instances of {@link LocalParameter} * with the same identifier or name, each located in different * {@link Reaction}s. In this case, the first match will be returned. Note * that also global {@link Parameter} instances have a higher priority and are * returned first. * * @param id an id indicating an {@link Quantity} element of the {@link Model}. * @return the {@link Compartment}, {@link Species}, {@link SpeciesReference} * or {@link Parameter}, or the first {@link LocalParameter} which has * 'id' as id. * @see #findLocalParameters(String) */ public Quantity findQuantity(String id) { Quantity nsb = findVariable(id); if (nsb == null) { List<LocalParameter> list = findLocalParameters(id); if (!list.isEmpty()) { return list.get(0); } } return nsb; }
/** * Sets the variableID of this {@link InitialAssignment} to 'variable'. If this * variableID doesn't match any {@link Variable} id in {@link Model} ( * {@link Compartment}, {@link Species}, {@link SpeciesReference}, or * {@link Parameter}), an {@link IllegalArgumentException} is thrown. * * @param variable * the symbol to set */ public void checkAndSetVariable(String variable) { Variable nsb = null; Model m = getModel(); if (m != null) { nsb = m.findVariable(variable); } if (nsb == null) { throw new IllegalArgumentException(MessageFormat.format( resourceBundle.getString("Assignment.NO_SUCH_VARIABLE_EXCEPTION_MSG"), m.getId(), variable)); } setVariable(nsb.getId()); }
/** * Sets the variableID of this EventAssignment to 'variable'. If 'variable' * doesn't match any id of Compartment , Species, SpeciesReference or * Parameter in Model, an {@link IllegalArgumentException} is thrown. * * @param variable * @throws IllegalArgumentException */ public void checkAndSetVariable(String variable) { Model m = getModel(); if (m != null) { Variable nsb = getModel().findVariable(variable); if (nsb == null) { throw new IllegalArgumentException(MessageFormat.format( resourceBundle.getString("Assignment.NO_SUCH_VARIABLE_EXCEPTION_MSG"), m.getId(), variable)); } setVariable(nsb); } else { throw new NullPointerException(JSBML.UNDEFINED_MODEL_MSG); } }