/** * Gets the list element which has the id 'id'. * * <p>The elements of the list have to implement {@link SBase}, if they are not * or if the id is not found, null is returned. * * @param id the id to search for. * @return the list element which has the id 'id'. */ public T get(String id) { T foundElement = null; for (T element : listOf) { if (element instanceof SBase) { if (((SBase) element).getId().equals(id)) { foundElement = element; break; } } if (element instanceof ExplicitRule) { if (((ExplicitRule) element).getVariable().equals(id)) { foundElement = element; break; } } } return foundElement; }
@Override public String getNextObject(ValidationContext ctx, Model m, int n) { int count = 0; if (m.isSetListOfRules()) { for (Rule r : m.getListOfRules()) { if (r instanceof ExplicitRule) { if (count == n) { return ((ExplicitRule) r).getVariable(); } else { count++; } } } } return null; } };
@Override public int hashCode() { final int prime = 919; int hashCode = super.hashCode(); if (isSetVariable()) { hashCode += prime * getVariable().hashCode(); } if (isSetUnits()) { hashCode += prime * getUnits().hashCode(); } return hashCode; }
attributes.put("variable", getVariable()); } else if (getLevel() == 1) { if (isSpeciesConcentration()) { attributes.put((getVersion() == 1) ? "specie" : "species", getVariable()); } else if (isCompartmentVolume()) { attributes.put("compartment", getVariable()); } else if (isParameter()) { attributes.put("name", getVariable());
String variableId = ((ExplicitRule) rule).getVariable();
if (eRule.getVariable() == r.getVariable()) { later = true; definedLater.add(eRule.getVariable());
/** * Creates a new {@link ExplicitRule} * * @param rule */ public ExplicitRule(ExplicitRule rule) { super(rule); initDefaults(); if (rule.isSetVariable()) { setVariable(new String(rule.getVariable())); } if (rule.isSetUnits()) { setUnits(new String(rule.getUnits())); } }
@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; } };
@Override public boolean equals(Object object) { boolean equals = super.equals(object); if (equals) { ExplicitRule r = (ExplicitRule) object; equals &= isSetVariable() == r.isSetVariable(); if (equals && isSetVariable()) { equals &= getVariable().equals(r.getVariable()); } equals &= isSetUnits() == r.isSetUnits(); if (equals && isSetUnits()) { equals &= getUnits().equals(r.getUnits()); } } return equals; }
if (er.getVariable().equals(s.getId()))