/** * Sets the extentUnitsID of this {@link Model} to the id of the * {@link UnitDefinition} 'extentUnits'. * * @param extentUnits */ public void setExtentUnits(UnitDefinition extentUnits) { if (!getListOfUnitDefinitions().contains(extentUnits)) { addUnitDefinition(extentUnits); } setExtentUnits(extentUnits != null ? extentUnits.getId() : null); }
/** * Sets the substanceUnitsID of this {@link Model} to the id of * 'substanceUnits'. * * @param substanceUnits */ public void setSubstanceUnits(UnitDefinition substanceUnits) { if (!getListOfUnitDefinitions().contains(substanceUnits)) { addUnitDefinition(substanceUnits); } setSubstanceUnits(substanceUnits != null ? substanceUnits.getId() : null); }
@Override public UnitDefinition getDerivedUnitDefinition() { if (isSetStoichiometryMath()) { return stoichiometryMath.getDerivedUnitDefinition(); } UnitDefinition ud = new UnitDefinition(getLevel(), getVersion()); ud.addUnit(Unit.Kind.DIMENSIONLESS); return ud; }
/** * Sets the areaUnitsID of this {@link Model} to the id of the * {@link UnitDefinition} 'areaUnits'. * * @param areaUnits */ public void setAreaUnits(UnitDefinition areaUnits) { if (!getListOfUnitDefinitions().contains(areaUnits)) { addUnitDefinition(areaUnits); } setAreaUnits(areaUnits != null ? areaUnits.getId() : null); }
/** * Sets the volumeUnitsID of this {@link Model} to the id of the * {@link UnitDefinition} 'volumeUnits'. * * @param volumeUnits */ public void setVolumeUnits(UnitDefinition volumeUnits) { if (!getListOfUnitDefinitions().contains(volumeUnits)) { addUnitDefinition(volumeUnits); } setVolumeUnits(volumeUnits != null ? volumeUnits.getId() : null); }
/** * 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); }
/** * Sets the timeUnitsID of this {@link Model} to the id of the * {@link UnitDefinition} 'timeUnits'. * * @param timeUnits */ public void setTimeUnits(UnitDefinition timeUnits) { if (!getListOfUnitDefinitions().contains(timeUnits)) { addUnitDefinition(timeUnits); } setTimeUnits(timeUnits != null ? timeUnits.getId() : null); }
@Override public boolean isSetUnitsInstance() { if (isSetUnits()) { if (Unit.isUnitKind(unitsID, getLevel(), getVersion())) { return true; } Model model = getModel(); return model == null ? false : model .getUnitDefinition(unitsID) != null; } return false; }
/** * Creates a new {@link Delay} instance and sets it to this {@link Event}. * * @return the new {@link Delay} instance. */ public Delay createDelay() { Delay d = new Delay(getLevel(), getVersion()); d.addAllChangeListeners(getListOfTreeNodeChangeListeners()); setDelay(d); return d; }
@Override public boolean check(ValidationContext ctx, Parameter p) { UnitDefinition def = p.getUnitsInstance(); if (def != null && def.isSetListOfUnits() && def.getUnitCount() == 1) { // Celsius not allowed return !def.getUnit(0).isCelsius(); } return true; } };
@Override public String getDerivedUnits() { if (isSetStoichiometryMath()) { return stoichiometryMath.getDerivedUnits(); } return Unit.Kind.DIMENSIONLESS.toString(); }
/** * Creates a new, empty {@link Priority}, sets it to this {@link Event} and * returns the {@link Priority}. * * @return the newly created {@link Priority} object instance */ public Priority createPriority() { Priority p = new Priority(getLevel(), getVersion()); setPriority(p); return p; }
/** * Changes the {@link History} instance to 'history' * * @param history the history to set. */ public void setHistory(History history) { History oldHistory = this.history; this.history = history; this.history.parent = this; this.history.addAllChangeListeners(getListOfTreeNodeChangeListeners()); firePropertyChange(TreeNodeChangeEvent.history, oldHistory, this.history); }
/** * Creates a new {@link Priority}, sets it to this {@link Event} and * returns it. * * @return the newly created {@link Priority} object instance * @param math the {@link ASTNode} representing the expression to be set to the {@link Priority} */ public Priority createPriority(ASTNode math) { Priority p = createPriority(); p.setMath(math); return p; }
/** * Creates a new {@link Trigger} instance and sets it to this {@link Event}. * * @param math math the math expression for the new {@link Trigger} * @return the new {@link Trigger} instance. */ public Trigger createTrigger(ASTNode math) { Trigger t = createTrigger(); t.setMath(math); return t; }
@Override public boolean isSetVariableInstance() { Model m = getModel(); return m != null ? m.findVariable(variableID) != null : false; }
/** * Sets the model qualifier type of this {@link CVTerm}, using the {@link Qualifier#values()} array. * * @param specificQualifierType * @libsbml.deprecated use {@link #setQualifier(Qualifier)} */ public void setModelQualifierType(int specificQualifierType) { final int NUM_BIOLOGICAL_QUALIFIER_TYPES = 11; setBiologicalQualifierType(Qualifier.values()[specificQualifierType - NUM_BIOLOGICAL_QUALIFIER_TYPES]); }
/** * Sets the type of this {@link CVTerm} to the {@link Type} represented by * 'qualifierType'. * * @param qualifierType * the Type to set as an integer. * @libsbml.deprecated use {@link #setQualifier(Qualifier)}. */ public void setQualifierType(int qualifierType) { setQualifierType(Type.values()[qualifierType]); }