/** * Sets the {@link #lengthUnitsID} of this {@link Model} to {@code null}. */ public void unsetLengthUnits() { setLengthUnits((String) null); }
/** * @param kind */ public void setLengthUnits(Unit.Kind kind) { // TODO: Check if kind is variant of length setLengthUnits(kind.toString().toLowerCase()); }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { if (attributeName.equals("substanceUnits")) { setSubstanceUnits(value); return true; } else if (attributeName.equals("timeUnits")) { setTimeUnits(value); return true; } else if (attributeName.equals("volumeUnits")) { setVolumeUnits(value); return true; } else if (attributeName.equals("areaUnits")) { setAreaUnits(value); return true; } else if (attributeName.equals("lengthUnits")) { setLengthUnits(value); return true; } else if (attributeName.equals("extentUnits")) { setExtentUnits(value); return true; } else if (attributeName.equals("conversionFactor")) { setConversionFactor(value); return true; } } return isAttributeRead; }
/** * Sets the lengthUnitsID of this {@link Model} to the id of the * UnitDefinition 'lengthUnits'. * * @param lengthUnits */ public void setLengthUnits(UnitDefinition lengthUnits) { if (!getListOfUnitDefinitions().contains(lengthUnits)) { addUnitDefinition(lengthUnits); } setLengthUnits(lengthUnits != null ? lengthUnits.getId() : null); }
model.addUnitDefinition(SBMLtools.setLevelAndVersion(UnitDefinition.length(2, 4), model.getLevel(), model.getVersion())); if (isL3) { model.setLengthUnits(UnitDefinition.LENGTH);
setLengthUnits(model.getLengthUnits());