/** * Returns the {@link UnitDefinition} instance which has the * {@link #areaUnitsID} of * this {@link Model} as id. * * @return the {@link UnitDefinition} instance which has the * {@link #areaUnitsID} of * this {@link Model} as id. {@code null} if it doesn't exist. */ public UnitDefinition getAreaUnitsInstance() { return getUnitDefinition(getAreaUnits()); }
@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; }
@Override public String getUnits() { String units = super.getUnits(); if ((units == null) && (getLevel() > 2)) { int dim = (int) getSpatialDimensions(); if (dim - getSpatialDimensions() == 0d) { Model model = getModel(); if (model != null) { switch (dim) { case 1: return model.getLengthUnits(); case 2: return model.getAreaUnits(); case 3: return model.getVolumeUnits(); default: break; } } } } return units; }
equals &= getAreaUnits().equals(m.getAreaUnits());
logger.warn(MessageFormat.format( bundle.getString("SBMLCoreParser.unknownReferenceError1"), "UnitDefinition", "areaUnitsID", model.getAreaUnits(), model.getElementName(), SBMLtools.getIdOrName(model)));
boolean isUnitsValid = ValidationTools.checkUnit(ctx, m, m.getAreaUnits()); ValidationConstraint.logError(ctx, CORE_10313, m, m.getAreaUnits(), m.getElementName(), m.getId()); isCheckValid = false;
boolean isUnitsValid = SyntaxChecker.isValidId(m.getAreaUnits(), ctx.getLevel(), ctx.getVersion()); ValidationConstraint.logError(ctx, CORE_10311, m, m.getAreaUnits(), m.getElementName(), m.getId()); isCheckValid = false;
setAreaUnits(model.getAreaUnits());