@Override public void unsetConstant() { if (constant != null) { Boolean oldConstant = constant; constant = null; isSetConstant = false; firePropertyChange(TreeNodeChangeEvent.constant, oldConstant, constant); } }
/** * Unsets the stoichiometry property of this element. */ public void unsetStoichiometry() { if (stoichiometry != null) { Double oldStoichiometry = stoichiometry; stoichiometry = null; isSetStoichiometry = false; firePropertyChange(TreeNodeChangeEvent.stoichiometry, oldStoichiometry, stoichiometry); } }
@Override public void setConstant(boolean constant) { if (getLevel() < 3) { throw new PropertyNotAvailableException(TreeNodeChangeEvent.constant, this); } Boolean oldConstant = this.constant; this.constant = Boolean.valueOf(constant); isSetConstant = true; firePropertyChange(TreeNodeChangeEvent.constant, oldConstant, this.constant); }
/** * Sets the denominator of this {@link SpeciesReference}. * * @param denominator * @deprecated */ @Deprecated public void setDenominator(int denominator) { if ((getLevel() == 1) && (getVersion() == 2)) { if (denominator < 0) { throw new IllegalArgumentException(MessageFormat.format( ILLEGAL_STOCHIOMETRY_VALUE, "denominator", stoichiometry)); } } Integer oldDenominator = this.denominator; this.denominator = denominator; isSetDenominator = true; firePropertyChange(TreeNodeChangeEvent.denominator, oldDenominator, this.denominator); }
/** * Sets the stoichiometry of this {@link SpeciesReference}. * * @param stoichiometry */ public void setStoichiometry(double stoichiometry) { if ((getLevel() == 1) && (getVersion() == 2)) { int stoch = (int) stoichiometry; if ((stoch < 0) || (stoch - stoichiometry != 0d)) { throw new IllegalArgumentException(MessageFormat.format( ILLEGAL_STOCHIOMETRY_VALUE, "stoichiometry", stoichiometry)); } } Double oldStoichiometry = this.stoichiometry; this.stoichiometry = Double.valueOf(stoichiometry); if (isSetStoichiometryMath()) { stoichiometryMath = null; } if (Double.isNaN(stoichiometry)) { isSetStoichiometry = false; } else { isSetStoichiometry = true; } firePropertyChange(TreeNodeChangeEvent.stoichiometry, oldStoichiometry, this.stoichiometry); }