/** * Sets the scale of this Unit * * @param scale */ public void setScale(int scale) { Integer oldScale = this.scale; isSetScale = true; this.scale = scale; firePropertyChange(TreeNodeChangeEvent.scale, oldScale, scale); }
/** * */ public void unsetExponent() { Double oldExponent = exponent; exponent = null; isSetExponent = false; firePropertyChange(TreeNodeChangeEvent.exponent, oldExponent, exponent); }
/** * Sets the {@link Kind} of this {@link Unit} * * @param kind */ public void setKind(Kind kind) { Kind oldKind = this.kind; this.kind = (kind != null) ? kind : Kind.INVALID; firePropertyChange(TreeNodeChangeEvent.kind, oldKind, this.kind); }
/** * */ public void unsetScale() { Integer oldScale = scale; scale = null; isSetScale = false; firePropertyChange(TreeNodeChangeEvent.scale, oldScale, scale); }
/** * */ public void unsetKind() { Kind oldKind = kind; kind = Kind.INVALID; firePropertyChange(TreeNodeChangeEvent.kind, oldKind, kind); }
/** * */ public void unsetMultiplier() { Double oldMultipler = multiplier; multiplier = null; isSetMultiplier = false; firePropertyChange(TreeNodeChangeEvent.multiplier, oldMultipler, multiplier); }
/** * Sets the exponent of this {@link Unit} * * @param exponent */ public void setExponent(double exponent) { Double oldExponent = this.exponent; isSetExponent = true; this.exponent = Double.valueOf(exponent); firePropertyChange(TreeNodeChangeEvent.exponent, oldExponent, this.exponent); }
/** * @deprecated the offset attribute should no longer be used. */ @Deprecated public void unsetOffset() { Double oldOffset = offset; offset = null; isSetOffset = false; firePropertyChange(TreeNodeChangeEvent.offset, oldOffset, offset); }
/** * 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); } }
/** * Sets the multiplier of this {@link Unit} * * @param multiplier * @throws PropertyNotAvailableException * if Level < 2 and the given {@code multiplier != 1}. */ public void setMultiplier(double multiplier) { if ((getLevel() < 2) && (multiplier != 1d) && !isInvalidSBMLAllowed()) { // added the multiplier test != 1 to prevent error being reported when it is not necessary throw new PropertyNotAvailableException(TreeNodeChangeEvent.multiplier, this); } Double oldMultiplyer = this.multiplier; isSetMultiplier = true; this.multiplier = multiplier; firePropertyChange(TreeNodeChangeEvent.multiplier, oldMultiplyer, this.multiplier); }