/** * Initializes the default values using the current Level/Version configuration. */ public void initDefaults() { initDefaults(getLevel(), getVersion()); }
/** * Sets the offset of this {@link Unit} * * @param offset * @deprecated Only defined for SBML Level 2 Version 1. * @throws PropertyNotAvailableException * if Level/Version combination is not 2.1. */ @Deprecated public void setOffset(double offset) { if ((getLevel() == 2) && (getVersion() == 1)) { Double oldOffset = this.offset; isSetOffset = true; this.offset = Double.valueOf(offset); firePropertyChange(TreeNodeChangeEvent.offset, oldOffset, this.offset); } else { throw new PropertyNotAvailableException(TreeNodeChangeEvent.offset, this); } }
/** * Checks whether the given {@link Unit} and the {@link Unit} represented by * the given {@link String} are equivalent. * * @param unit * @param units * @return * @see #areEquivalent(Unit, Unit) */ public static boolean areEquivalent(Unit unit, String units) { return areEquivalent(unit, new Unit(1d, 0, Unit.Kind.valueOf(units), 1d, unit.getLevel(), unit.getVersion())); }
@Override public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); int level = getLevel(), version = getVersion(); Locale en = Locale.ENGLISH;
Kind kind = getKind(); if ((kind == Kind.MOLE) || (kind == Kind.ITEM) || ((((getLevel() == 2) && (getVersion() > 1)) || (getLevel() > 2)) && ((kind == Kind.GRAM) || isKilogram())) || (getLevel() > 2 && kind == Kind.AVOGADRO))
int scale = unit.getScale(); int l = unit.getLevel(); int v = unit.getVersion(); UnitDefinition ud = new UnitDefinition(l, v);