/** * Returns {@code true} if this model contains a reference to a * {@link Compartment} * with the given identifier. * * @param id the id to search for * @return {@code true} if this model contains a reference to a * {@link Compartment} * with the given identifier. */ public boolean containsCompartment(String id) { return getCompartment(id) != null; }
Compartment compartment = model.getCompartment(i); if (compartment.isSetCompartmentType() && !compartment.isSetCompartmentTypeInstance()) {
Compartment relatedCompartment = model.getCompartment(compartmentsIds[i]);
/** * Returns the compartment instance which matches the outside id in Model. * Return null if no compartment instance matches the outside id. * * @return the compartment instance which matches the outside id in Model. * Return null if no compartment instance matches the outside id. */ public Compartment getOutsideInstance() { Model m = getModel(); return m != null ? m.getCompartment(outsideID) : null; }
/** * Returns {@code true} if the compartment instance which matches the * outsideID of * this compartment is not {@code null}. * * @return {@code true} if the compartment instance which matches the * outsideID of * this compartment is not {@code null}. */ public boolean isSetOutsideInstance() { Model m = getModel(); return m != null ? m.getCompartment(outsideID) != null : false; }
@Override public Compartment getCompartmentInstance() { if (isSetCompartment()) { Model model = getModel(); if (model != null) { return model.getCompartment(compartmentID); } } return null; }
@Override public Compartment getCompartmentInstance() { if (isSetCompartment()) { Model m = getModel(); if (m != null) { return m.getCompartment(compartmentID); } } return null; }
@Override public Compartment getCompartmentInstance() { if (isSetCompartment()) { Model model = getModel(); if (model != null) { return model.getCompartment(getCompartment()); } } return null; }
@Override public Compartment getCompartmentInstance() { if (isSetCompartment()) { Model model = getModel(); if (model != null) { return model.getCompartment(getCompartment()); } } return null; }
@Override public Compartment getCompartmentInstance() { if (isSetCompartment()) { Model model = getModel(); if (model != null) { return model.getCompartment(getCompartment()); } } return null; }
@Override public boolean check(ValidationContext ctx, ASTNode node) { if (node.getParentSBMLObject() == null) { // something is wrong with the ASTNode return true; } Model m = node.getParentSBMLObject().getModel(); if (m != null && node.isName()) { Compartment c = m.getCompartment(node.getName()); if (c != null && c.getSpatialDimensions() == 0) { return false; } } return true; }
@Override public boolean check(ValidationContext ctx, LocalParameter lp) { Model m = lp.getModel(); if (m != null) { String id = lp.getId(); // ID should't be used by anything else return m.getFunctionDefinition(id) == null && m.getCompartment(id) == null && m.getSpecies(id) == null && m.getParameter(id) == null && m.getReaction(id) == null; } return true; } };
@Override public boolean check(ValidationContext ctx, InitialAssignment ia) { Model m = ia.getModel(); if (ia.isSetSymbol() && m != null) { String s = ia.getSymbol(); Compartment c = m.isSetListOfCompartments() ? m.getCompartment(s) : null; if (c != null && c.getSpatialDimensions() == 0) { ValidationConstraint.logError(ctx, CORE_20806, ia, ia.getVariable()); return false; } } return true; } };
@Override public boolean check(ValidationContext ctx, ExplicitRule r) { Model m = r.getModel(); String var = r.getVariable(); if (r.isSetVariable() && m != null) { Compartment c = m.getCompartment(var); if (c != null && c.isSetSpatialDimensions() && c.getSpatialDimensions() == 0) { ValidationConstraint.logError(ctx, CORE_20911, r, r.getElementName(), r.getVariable()); return false; } } return true; } };
if (m.getCompartment(name) == null && m.getSpecies(name) == null && m.getParameter(name) == null && (!allowReaction || m.getReaction(name) == null)
boolean checkL2 = (m.isSetListOfCompartments() && m.getCompartment(symbol) != null) || (m.isSetListOfSpecies() && m.getSpecies(symbol) != null) || (m.isSetListOfParameters() && m.getParameter(symbol) != null);