/** * Returns the extent units ID of this {@link Model}. * * @return the extent units ID of this {@link Model}. Returns an empty * {@link String} if it is not set. */ public String getExtentUnits() { return isSetExtentUnits() ? extentUnitsID : ""; }
model.getElementName(), SBMLtools.getIdOrName(model))); if (model.isSetExtentUnits() && !model.isSetExtentUnitsInstance()) { logger.warn(MessageFormat.format( bundle.getString("SBMLCoreParser.unknownReferenceError1"),
@Override public boolean check(ValidationContext ctx, Model m) { boolean extendUsed = false; for (int n = 0; !extendUsed && n < m.getNumReactions(); n++) { if (m.getReaction(n).isSetKineticLaw()) { extendUsed = true; } } return !extendUsed || m.isSetExtentUnits(); } };
@Override public boolean check(ValidationContext ctx, Model m) { if (m.isSetExtentUnits()) { UnitDefinition ud = m.getExtentUnitsInstance(); if (ud != null && ud.getUnitCount() == 0) { return false; } if (ud != null) { return ud.isVariantOfSubstance() || ud.isVariantOfDimensionless(); } } return true; } };
@Override public int hashCode() { final int prime = 887; int hashCode = super.hashCode(); if (isSetTimeUnits()) { hashCode += prime * getTimeUnits().hashCode(); } if (isSetAreaUnits()) { hashCode += prime * getAreaUnits().hashCode(); } if (isSetConversionFactor()) { hashCode += prime * getConversionFactor().hashCode(); } if (isSetExtentUnits()) { hashCode += prime * getExtentUnits().hashCode(); } if (isSetLengthUnits()) { hashCode += prime * getLengthUnits().hashCode(); } if (isSetSubstanceUnits()) { hashCode += prime * getSubstanceUnits().hashCode(); } if (isSetVolumeUnits()) { hashCode += prime * getVolumeUnits().hashCode(); } return hashCode; }
@Override public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (getLevel() > 2) { if (isSetSubstanceUnits()) { attributes.put("substanceUnits", getSubstanceUnits()); } if (isSetTimeUnits()) { attributes.put("timeUnits", getTimeUnits()); } if (isSetVolumeUnits()) { attributes.put("volumeUnits", getVolumeUnits()); } if (isSetAreaUnits()) { attributes.put("areaUnits", getAreaUnits()); } if (isSetLengthUnits()) { attributes.put("lengthUnits", getLengthUnits()); } if (isSetExtentUnits()) { attributes.put("extentUnits", getExtentUnits()); } if (isSetConversionFactor()) { attributes.put("conversionFactor", getConversionFactor()); } } return attributes; }
equals &= getConversionFactor().equals(m.getConversionFactor()); equals &= m.isSetExtentUnits() == isSetExtentUnits(); if (equals && isSetExtentUnits()) { equals &= getExtentUnits().equals(m.getExtentUnits());
} else if (m.isSetTimeUnits() && m.isSetExtentUnits()) { expectedUnit = m.getExtentUnitsInstance().clone().divideBy(m.getTimeUnitsInstance());
setConversionFactor(model.getConversionFactor()); if (model.isSetExtentUnits()) { setExtentUnits(model.getExtentUnits());