|
libSBML 5.8.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sbml.libsbml.SBase
org.sbml.libsbml.Model
public class Model
Implementation of SBML's Model construct.
In an SBML model definition, a single object of class Model serves as
the overall container for the lists of the various model components.
All of the lists are optional, but if a given list container is present
within the model, the list must not be empty; that is, it must have
length one or more. The following are the components and lists
permitted in different Levels and Versions of SBML in
version 5.8.0
of libSBML:
UnitDefinition, Compartment,
Species, Parameter, Rule, and Reaction. Instances of the classes are
placed inside instances of classes ListOfUnitDefinitions,
ListOfCompartments, ListOfSpecies, ListOfParameters, ListOfRules, and
ListOfReactions.
FunctionDefinition,
UnitDefinition, Compartment, Species, Parameter, Rule, Reaction and
Event. Instances of the classes are placed inside instances of classes
ListOfFunctionDefinitions, ListOfUnitDefinitions, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfRules, ListOfReactions, and
ListOfEvents.
FunctionDefinition, UnitDefinition, CompartmentType, SpeciesType,
Compartment, Species, Parameter, InitialAssignment, Rule, Constraint,
Reaction and Event. Instances of the classes are placed inside
instances of classes ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments, ListOfRules,
ListOfConstraints, ListOfReactions, and ListOfEvents.
FunctionDefinition,
UnitDefinition, Compartment, Species, Parameter, InitialAssignment,
Rule, Constraint, Reaction and Event. Instances of the classes are
placed inside instances of classes ListOfFunctionDefinitions,
ListOfUnitDefinitions, ListOfCompartments, ListOfSpecies,
ListOfParameters, ListOfInitialAssignments, ListOfRules,
ListOfConstraints, ListOfReactions, and ListOfEvents.
Although all the lists are optional, there are dependencies between SBML components such that defining some components requires defining others. An example is that defining a species requires defining a compartment, and defining a reaction requires defining a species. The dependencies are explained in more detail in the SBML specifications.
In addition to the above lists and attributes, the Model class in both
SBML Level 2 and Level 3 has the usual two attributes of 'id'
and 'name', and both are optional. As is the case for other SBML
components with 'id' and 'name' attributes, they must be used according
to the guidelines described in the SBML specifications. (Within the
frameworks of SBML Level 2 and Level 3 Version 1 Core, a
Model object identifier has no assigned meaning, but extension packages
planned for SBML Level 3 are likely to make use of this
identifier.)
Finally, SBML Level 3 has introduced a number of additional Model
attributes. They are discussed in a separate section below.
LibSBML provides two main mechanisms for creating objects: class
constructors
(e.g., Species() ),
and createObject()
methods (such as Model.createSpecies()) provided by certain Object classes such as Model. These
multiple mechanisms are provided by libSBML for flexibility and to
support different use-cases, but they also have different implications
for the overall model structure.
In general, the recommended approach is to use the createObject() methods. These
methods both create an object and link it to the parent in one step.
Here is an example:
// Create anSBMLDocumentobject in Level 3 Version 1 format:SBMLDocumentsbmlDoc = newSBMLDocument(3, 1); // Create aModelobject inside theSBMLDocumentobject and set // its identifier. The call returns a pointer to theModelobject // created, and methods called on that object affect the attributes // of the object attached to the model (as expected). Note that // the call to setId() returns a status code, and a real program // should check this status code to make sure everything went okay.Modelmodel = sbmlDoc.createModel(); model.setId("BestModelEver"); // Create aSpeciesobject inside theModeland set its identifier. // Similar to the lines above, this call returns a pointer to theSpecies// object created, and methods called on that object affect the attributes // of the object attached to the model (as expected). Note that, like // withModel, the call to setId() returns a status code, and a real program // should check this status code to make sure everything went okay.Speciessp = model.createSpecies(); sp.setId("BestSpeciesEver");
The createObject() methods return a
pointer to the object created, but they also add the object to the
relevant list of object instances contained in the parent. (These lists
become the <listOfObjects> elements in the
finished XML rendition of SBML.) In the example above,
Model.createSpecies() adds the created species directly to the
<listOfSpecies> list in the model. Subsequently,
methods called on the species change the species in the model (which is
what is expected in most situations).
To make it easier for applications to do whatever they need,
libSBML version 5.8.0
is relatively lax when it comes to enforcing correctness and
completeness of models during model construction and editing.
Essentially, libSBML will not in most cases check automatically
that a model's components have valid attribute values, or that the
overall model is consistent and free of errors—even obvious errors
such as duplication of identifiers. This allows applications great
leeway in how they build their models, but it means that software
authors must take deliberate steps to ensure that the model will be, in
the end, valid SBML. These steps include such things as keeping track
of the identifiers used in a model, manually performing updates in
certain situations where an entity is referenced in more than one place
(e.g., a species that is referenced by multiple SpeciesReference
objects), and so on.
That said, libSBML does provide powerful features for deliberately
performing validation of SBML when an application decides it is time to
do so. The interfaces to these facilities are on the SBMLDocument
class, in the form of SBMLDocument.checkInternalConsistency() and
SBMLDocument.checkConsistency(). Please refer to the documentation for
SBMLDocument for more information about this.
While applications may play fast and loose and live like free spirits
during the construction and editing of SBML models, they should always
make sure to call SBMLDocument.checkInternalConsistency() and/or
SBMLDocument.checkConsistency() before writing out the final version of
an SBML model.
As mentioned above, the Model class has a number of optional attributes
in SBML Level 3 Version 1 Core. These are 'substanceUnits',
'timeUnits', 'volumeUnits', 'areaUnits', 'lengthUnits', 'extentUnits',
and 'conversionFactor. The following provide more information about
them.
The 'substanceUnits' attribute is used to specify the unit of
measurement associated with substance quantities of Species objects that
do not specify units explicitly. If a given Species object definition
does not specify its unit of substance quantity via the 'substanceUnits'
attribute on the Species object instance, then that species inherits the
value of the Model 'substanceUnits' attribute. If the Model does not
define a value for this attribute, then there is no unit to inherit, and
all species that do not specify individual 'substanceUnits' attribute
values then have no declared units for their quantities. The
SBML Level 3 Version 1 Core specification provides more
details.
Note that when the identifier of a species appears in a model's
mathematical expressions, the unit of measurement associated with that
identifier is not solely determined by setting 'substanceUnits'
on Model or Species. Please see the discussion about units given in
the documentation for the Species class.
The 'timeUnits' attribute on SBML Level 3's Model object is used to
specify the unit in which time is measured in the model. This attribute
on Model is the only way to specify a unit for time in a model.
It is a global attribute; time is measured in the model everywhere in
the same way. This is particularly relevant to Reaction and RateRule
objects in a model: all Reaction and RateRule objects in SBML define
per-time values, and the unit of time is given by the 'timeUnits'
attribute on the Model object instance. If the Model 'timeUnits'
attribute has no value, it means that the unit of time is not defined
for the model's reactions and rate rules. Leaving it unspecified in an
SBML model does not result in an invalid model in SBML Level 3;
however, as a matter of best practice, we strongly recommend that all
models specify units of measurement for time.
The attributes 'volumeUnits', 'areaUnits' and 'lengthUnits' together are
used to set the units of measurements for the sizes of Compartment
objects in an SBML Level 3 model when those objects do not
otherwise specify units. The three attributes correspond to the most
common cases of compartment dimensions: 'volumeUnits' for compartments
having a 'spatialDimensions' attribute value of '3', 'areaUnits' for
compartments having a 'spatialDimensions' attribute value of '2', and
'lengthUnits' for compartments having a 'spatialDimensions' attribute
value of '1'. The attributes are not applicable to compartments
whose 'spatialDimensions' attribute values are not one of '1',
'2' or '3'.
If a given Compartment object instance does not provide a value for its
'units' attribute, then the unit of measurement of that compartment's
size is inherited from the value specified by the Model 'volumeUnits',
'areaUnits' or 'lengthUnits' attribute, as appropriate based on the
Compartment object's 'spatialDimensions' attribute value. If the Model
object does not define the relevant attribute, then there are no units
to inherit, and all Compartment objects that do not set a value for
their 'units' attribute then have no units associated with
their compartment sizes.
The use of three separate attributes is a carry-over from SBML Level 2. Note that it is entirely possible for a model to define a value for two or more of the attributes 'volumeUnits', 'areaUnits' and 'lengthUnits' simultaneously, because SBML models may contain compartments with different numbers of dimensions.
Reactions are processes that occur over time. These processes involve events of some sort, where a single ``reaction event'' is one in which some set of entities (known as reactants, products and modifiers in SBML) interact, once. The extent of a reaction is a measure of how many times the reaction has occurred, while the time derivative of the extent gives the instantaneous rate at which the reaction is occurring. Thus, what is colloquially referred to as the 'rate of the reaction' is in fact equal to the rate of change of reaction extent.
In SBML Level 3, the combination of 'extentUnits' and 'timeUnits'
defines the units of kinetic laws in SBML and establishes how the
numerical value of each KineticLaw object's mathematical formula is
meant to be interpreted in a model. The units of the kinetic laws are
taken to be 'extentUnits' divided by 'timeUnits'.
Note that this embodies an important principle in SBML Level 3 models: all reactions in an SBML model must have the same units for the rate of change of extent. In other words, the units of all reaction rates in the model must be the same. There is only one global value for 'extentUnits' and one global value for 'timeUnits'.
The attribute 'conversionFactor' in SBML Level 3's Model object
defines a global value inherited by all Species object instances that do
not define separate values for their 'conversionFactor' attributes. The
value of this attribute must refer to a Parameter object instance
defined in the model. The Parameter object in question must be a
constant; ie it must have its 'constant' attribute value set to
'true'.
If a given Species object definition does not specify a conversion
factor via the 'conversionFactor' attribute on Species, then the species
inherits the conversion factor specified by the Model 'conversionFactor'
attribute. If the Model does not define a value for this attribute,
then there is no conversion factor to inherit. More information about
conversion factors is provided in the SBML Level 3 Version 1
specification.
| Constructor Summary | |
|---|---|
Model(long level,
long version)
Creates a new Model using the given SBML level and version
values. |
|
Model(Model orig)
Copy constructor; creates a (deep) copy of the given Model object. |
|
Model(SBMLNamespaces sbmlns)
Creates a new Model using the given SBMLNamespaces object
sbmlns. |
|
| Method Summary | |
|---|---|
int |
addCompartment(Compartment c)
Adds a copy of the given Compartment object to this Model. |
int |
addCompartmentType(CompartmentType ct)
Adds a copy of the given CompartmentType object to this Model. |
int |
addConstraint(Constraint c)
Adds a copy of the given Constraint object to this Model. |
int |
addEvent(Event e)
Adds a copy of the given Event object to this Model. |
int |
addFunctionDefinition(FunctionDefinition fd)
Adds a copy of the given FunctionDefinition object to this Model. |
int |
addInitialAssignment(InitialAssignment ia)
Adds a copy of the given InitialAssignment object to this Model. |
int |
addParameter(Parameter p)
Adds a copy of the given Parameter object to this Model. |
int |
addReaction(Reaction r)
Adds a copy of the given Reaction object to this Model. |
int |
addRule(Rule r)
Adds a copy of the given Rule object to this Model. |
int |
addSpecies(Species s)
Adds a copy of the given Species object to this Model. |
int |
addSpeciesType(SpeciesType st)
Adds a copy of the given SpeciesType object to this Model. |
int |
addUnitDefinition(UnitDefinition ud)
Adds a copy of the given UnitDefinition object to this Model. |
int |
appendAnnotation(String annotation)
Appends annotation content to any existing content in the 'annotation' subelement of this object. |
int |
appendAnnotation(XMLNode annotation)
Appends annotation content to any existing content in the 'annotation' subelement of this object. |
int |
appendFrom(Model model)
Takes the contents of the passed-in Model, makes copies of everything,
and appends those copies to the appropriate places in this Model. |
Model |
cloneObject()
Creates and returns a deep copy of this Model object. |
AlgebraicRule |
createAlgebraicRule()
Creates a new AlgebraicRule inside this Model and returns it. |
AssignmentRule |
createAssignmentRule()
Creates a new AssignmentRule inside this Model and returns it. |
Compartment |
createCompartment()
Creates a new Compartment inside this Model and returns it. |
CompartmentType |
createCompartmentType()
Creates a new CompartmentType inside this Model and returns it. |
Constraint |
createConstraint()
Creates a new Constraint inside this Model and returns it. |
Delay |
createDelay()
Creates a new Delay inside the last Event object created in
this Model, and returns a pointer to it. |
Event |
createEvent()
Creates a new Event inside this Model and returns it. |
EventAssignment |
createEventAssignment()
Creates a new EventAssignment inside the last Event object created in
this Model, and returns a pointer to it. |
FunctionDefinition |
createFunctionDefinition()
Creates a new FunctionDefinition inside this Model and returns it. |
InitialAssignment |
createInitialAssignment()
Creates a new InitialAssignment inside this Model and returns it. |
KineticLaw |
createKineticLaw()
Creates a new KineticLaw inside the last Reaction object created in
this Model, and returns a pointer to it. |
LocalParameter |
createKineticLawLocalParameter()
Creates a new LocalParameter inside the KineticLaw object of the last
Reaction created inside this Model, and returns a pointer to it. |
Parameter |
createKineticLawParameter()
Creates a new local Parameter inside the KineticLaw object of the last
Reaction created inside this Model, and returns a pointer to it. |
ModifierSpeciesReference |
createModifier()
Creates a new ModifierSpeciesReference object for a modifier species
inside the last Reaction object in this Model, and returns a pointer
to it. |
Parameter |
createParameter()
Creates a new Parameter inside this Model and returns it. |
SpeciesReference |
createProduct()
Creates a new SpeciesReference object for a product inside the last
Reaction object in this Model, and returns a pointer to it. |
RateRule |
createRateRule()
Creates a new RateRule inside this Model and returns it. |
SpeciesReference |
createReactant()
Creates a new SpeciesReference object for a reactant inside the last
Reaction object in this Model, and returns a pointer to it. |
Reaction |
createReaction()
Creates a new Reaction inside this Model and returns it. |
Species |
createSpecies()
Creates a new Species inside this Model and returns it. |
SpeciesType |
createSpeciesType()
Creates a new SpeciesType inside this Model and returns it. |
Trigger |
createTrigger()
Creates a new Trigger inside the last Event object created in
this Model, and returns a pointer to it. |
Unit |
createUnit()
Creates a new Unit object within the last UnitDefinition object
created in this model and returns a pointer to it. |
UnitDefinition |
createUnitDefinition()
Creates a new UnitDefinition inside this Model and returns it. |
void |
delete()
Explicitly deletes the underlying native object. |
String |
getAreaUnits()
Returns the value of the 'areaUnits' attribute of this Model. |
Compartment |
getCompartment(long n)
Get the nth Compartment object in this Model. |
Compartment |
getCompartment(String sid)
Get a Compartment object based on its identifier. |
CompartmentType |
getCompartmentType(long n)
Get the nth CompartmentType object in this Model. |
CompartmentType |
getCompartmentType(String sid)
Get a CompartmentType object based on its identifier. |
Constraint |
getConstraint(long n)
Get the nth Constraint object in this Model. |
String |
getConversionFactor()
Returns the value of the 'conversionFactor' attribute of this Model. |
SBase |
getElementByMetaId(String metaid)
Returns the first child element it can find with the given metaid, or
null if no such object is found. |
SBase |
getElementBySId(String id)
Returns the first child element found that has the given id in the
model-wide SId namespace, or null if no such object is found. |
String |
getElementName()
Returns the XML element name of this object, which for Model, is
always 'model'. |
Event |
getEvent(long n)
Get the nth Event object in this Model. |
Event |
getEvent(String sid)
Get an Event object based on its identifier. |
String |
getExtentUnits()
Returns the value of the 'extentUnits' attribute of this Model. |
FunctionDefinition |
getFunctionDefinition(long n)
Get the nth FunctionDefinitions object in this Model. |
FunctionDefinition |
getFunctionDefinition(String sid)
Get a FunctionDefinition object based on its identifier. |
String |
getId()
Returns the value of the 'id' attribute of this Model. |
InitialAssignment |
getInitialAssignment(long n)
Get the nth InitialAssignment object in this Model. |
InitialAssignment |
getInitialAssignment(String symbol)
Get an InitialAssignment object based on the symbol to which it
assigns a value. |
String |
getLengthUnits()
Returns the value of the 'lengthUnits' attribute of this Model. |
ListOfCompartments |
getListOfCompartments()
Get the ListOfCompartments object in this Model. |
ListOfCompartmentTypes |
getListOfCompartmentTypes()
Get the ListOfCompartmentTypes object in this Model. |
ListOfConstraints |
getListOfConstraints()
Get the ListOfConstraints object in this Model. |
ListOfEvents |
getListOfEvents()
Get the ListOfEvents object in this Model. |
ListOfFunctionDefinitions |
getListOfFunctionDefinitions()
Get the ListOfFunctionDefinitions object in this Model. |
ListOfInitialAssignments |
getListOfInitialAssignments()
Get the ListOfInitialAssignments object in this Model. |
ListOfParameters |
getListOfParameters()
Get the ListOfParameters object in this Model. |
ListOfReactions |
getListOfReactions()
Get the ListOfReactions object in this Model. |
ListOfRules |
getListOfRules()
Get the ListOfRules object in this Model. |
ListOfSpecies |
getListOfSpecies()
Get the ListOfSpecies object in this Model. |
ListOfSpeciesTypes |
getListOfSpeciesTypes()
Get the ListOfSpeciesTypes object in this Model. |
ListOfUnitDefinitions |
getListOfUnitDefinitions()
Get the ListOfUnitDefinitions object in this Model. |
String |
getName()
Returns the value of the 'name' attribute of this Model. |
long |
getNumCompartments()
Get the number of Compartment objects in this Model. |
long |
getNumCompartmentTypes()
Get the number of CompartmentType objects in this Model. |
long |
getNumConstraints()
Get the number of Constraint objects in this Model. |
long |
getNumEvents()
Get the number of Event objects in this Model. |
long |
getNumFunctionDefinitions()
Get the number of FunctionDefinition objects in this Model. |
long |
getNumInitialAssignments()
Get the number of InitialAssignment objects in this Model. |
long |
getNumParameters()
Get the number of Parameter objects in this Model. |
long |
getNumReactions()
Get the number of Reaction objects in this Model. |
long |
getNumRules()
Get the number of Rule objects in this Model. |
long |
getNumSpecies()
Get the number of Specie objects in this Model. |
long |
getNumSpeciesTypes()
Get the number of SpeciesType objects in this Model. |
long |
getNumSpeciesWithBoundaryCondition()
Get the number of Species in this Model having their
'boundaryCondition' attribute value set to true. |
long |
getNumUnitDefinitions()
Get the number of UnitDefinition objects in this Model. |
Parameter |
getParameter(long n)
Get the nth Parameter object in this Model. |
Parameter |
getParameter(String sid)
Get a Parameter object based on its identifier. |
Reaction |
getReaction(long n)
Get the nth Reaction object in this Model. |
Reaction |
getReaction(String sid)
Get a Reaction object based on its identifier. |
Rule |
getRule(long n)
Get the nth Rule object in this Model. |
Rule |
getRule(String variable)
Get a Rule object based on the variable to which it assigns a value. |
Species |
getSpecies(long n)
Get the nth Species object in this Model. |
Species |
getSpecies(String sid)
Get a Species object based on its identifier. |
SpeciesReference |
getSpeciesReference(String sid)
Get a SpeciesReference object based on its identifier. |
SpeciesType |
getSpeciesType(long n)
Get the nth SpeciesType object in this Model. |
SpeciesType |
getSpeciesType(String sid)
Get a SpeciesType object based on its identifier. |
String |
getSubstanceUnits()
Returns the value of the 'substanceUnits' attribute of this Model. |
String |
getTimeUnits()
Returns the value of the 'timeUnits' attribute of this Model. |
int |
getTypeCode()
Returns the libSBML type code for this SBML object. |
UnitDefinition |
getUnitDefinition(long n)
Get the nth UnitDefinition object in this Model. |
UnitDefinition |
getUnitDefinition(String sid)
Get a UnitDefinition based on its identifier. |
String |
getVolumeUnits()
Returns the value of the 'volumeUnits' attribute of this Model. |
boolean |
hasRequiredElements()
Predicate returning true if
all the required elements for this Model object
have been set. |
boolean |
isPopulatedListFormulaUnitsData()
Predicate returning true if
the list of FormulaUnitsData is populated. |
boolean |
isSetAreaUnits()
Predicate returning true if this
Model's 'areaUnits' attribute is set. |
boolean |
isSetConversionFactor()
Predicate returning true if this
Model's 'conversionFactor' attribute is set. |
boolean |
isSetExtentUnits()
Predicate returning true if this
Model's 'extentUnits' attribute is set. |
boolean |
isSetId()
Predicate returning true if this
Model's 'id' attribute is set. |
boolean |
isSetLengthUnits()
Predicate returning true if this
Model's 'lengthUnits' attribute is set. |
boolean |
isSetName()
Predicate returning true if this
Model's 'name' attribute is set. |
boolean |
isSetSubstanceUnits()
Predicate returning true if this
Model's 'substanceUnits' attribute is set. |
boolean |
isSetTimeUnits()
Predicate returning true if this
Model's 'timeUnits' attribute is set. |
boolean |
isSetVolumeUnits()
Predicate returning true if this
Model's 'volumeUnits' attribute is set. |
void |
populateListFormulaUnitsData()
Populates the list of FormulaDataUnits with the units derived for the model. |
Compartment |
removeCompartment(long n)
Removes the nth Compartment object from this Model object and
returns a pointer to it. |
Compartment |
removeCompartment(String sid)
Removes the Compartment object with the given identifier from this Model
object and returns a pointer to it. |
CompartmentType |
removeCompartmentType(long n)
Removes the nth CompartmentType object from this Model object and
returns a pointer to it. |
CompartmentType |
removeCompartmentType(String sid)
Removes the CompartmentType object with the given identifier from this Model
object and returns a pointer to it. |
Constraint |
removeConstraint(long n)
Removes the nth Constraint object from this Model object and
returns a pointer to it. |
Event |
removeEvent(long n)
Removes the nth Event object from this Model object and
returns a pointer to it. |
Event |
removeEvent(String sid)
Removes the Event object with the given identifier from this Model
object and returns a pointer to it. |
int |
removeFromParentAndDelete()
Finds this Model's parent SBMLDocument and calls setModel(null) on it,
indirectly deleting itself. |
FunctionDefinition |
removeFunctionDefinition(long n)
Removes the nth FunctionDefinition object from this Model object and
returns a pointer to it. |
FunctionDefinition |
removeFunctionDefinition(String sid)
Removes the FunctionDefinition object with the given identifier from this Model
object and returns a pointer to it. |
InitialAssignment |
removeInitialAssignment(long n)
Removes the nth InitialAssignment object from this Model object and
returns a pointer to it. |
InitialAssignment |
removeInitialAssignment(String symbol)
Removes the InitialAssignment object with the given 'symbol' attribute
from this Model object and returns a pointer to it. |
Parameter |
removeParameter(long n)
Removes the nth Parameter object from this Model object and
returns a pointer to it. |
Parameter |
removeParameter(String sid)
Removes the Parameter object with the given identifier from this Model
object and returns a pointer to it. |
Reaction |
removeReaction(long n)
Removes the nth Reaction object from this Model object and
returns a pointer to it. |
Reaction |
removeReaction(String sid)
Removes the Reaction object with the given identifier from this Model
object and returns a pointer to it. |
Rule |
removeRule(long n)
Removes the nth Rule object from this Model object and
returns a pointer to it. |
Rule |
removeRule(String variable)
Removes the Rule object with the given 'variable' attribute from this Model
object and returns a pointer to it. |
Species |
removeSpecies(long n)
Removes the nth Species object from this Model object and
returns a pointer to it. |
Species |
removeSpecies(String sid)
Removes the Species object with the given identifier from this Model
object and returns a pointer to it. |
SpeciesType |
removeSpeciesType(long n)
Removes the nth SpeciesType object from this Model object and
returns a pointer to it. |
SpeciesType |
removeSpeciesType(String sid)
Removes the SpeciesType object with the given identifier from this Model
object and returns a pointer to it. |
UnitDefinition |
removeUnitDefinition(long n)
Removes the nth UnitDefinition object from this Model object and
returns a pointer to it. |
UnitDefinition |
removeUnitDefinition(String sid)
Removes the UnitDefinition object with the given identifier from this Model
object and returns a pointer to it. |
void |
renameSIdRefs(String oldid,
String newid)
Renames all the SIdRef attributes on this element, including any found in MathML |
void |
renameUnitSIdRefs(String oldid,
String newid)
Renames all the UnitSIdRef attributes on this element |
int |
setAnnotation(String annotation)
Sets the value of the 'annotation' subelement of this SBML object to a copy of annotation. |
int |
setAnnotation(XMLNode annotation)
Sets the value of the 'annotation' subelement of this SBML object to a copy of annotation. |
int |
setAreaUnits(String units)
Sets the value of the 'areaUnits' attribute of this Model. |
int |
setConversionFactor(String units)
Sets the value of the 'conversionFactor' attribute of this Model. |
int |
setExtentUnits(String units)
Sets the value of the 'extentUnits' attribute of this Model. |
int |
setId(String sid)
Sets the value of the 'id' attribute of this Model. |
int |
setLengthUnits(String units)
Sets the value of the 'lengthUnits' attribute of this Model. |
int |
setName(String name)
Sets the value of the 'name' attribute of this Model. |
int |
setSubstanceUnits(String units)
Sets the value of the 'substanceUnits' attribute of this Model. |
int |
setTimeUnits(String units)
Sets the value of the 'timeUnits' attribute of this Model. |
int |
setVolumeUnits(String units)
Sets the value of the 'volumeUnits' attribute of this Model. |
int |
unsetAreaUnits()
Unsets the value of the 'areaUnits' attribute of this Model. |
int |
unsetConversionFactor()
Unsets the value of the 'conversionFactor' attribute of this Model. |
int |
unsetExtentUnits()
Unsets the value of the 'extentUnits' attribute of this Model. |
int |
unsetId()
Unsets the value of the 'id' attribute of this Model. |
int |
unsetLengthUnits()
Unsets the value of the 'lengthUnits' attribute of this Model. |
int |
unsetName()
Unsets the value of the 'name' attribute of this Model. |
int |
unsetSubstanceUnits()
Unsets the value of the 'substanceUnits' attribute of this Model. |
int |
unsetTimeUnits()
Unsets the value of the 'timeUnits' attribute of this Model. |
int |
unsetVolumeUnits()
Unsets the value of the 'volumeUnits' attribute of this Model. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Model(long level,
long version)
throws SBMLConstructorException
Model using the given SBML level and version
values.
level - a long integer, the SBML Level to assign to this Model
version - a long integer, the SBML Version to assign to this
Model
SBMLConstructorException - Thrown if the given level and version combination, or this kind
of SBML object, are either invalid or mismatched with respect to the
parent SBMLDocument object.
Model object to an SBMLDocument
(e.g., using SBMLDocument.setModel(Model m)), the SBML Level, SBML Version
and XML namespace of the document override the values used
when creating the Model object via this constructor. This is
necessary to ensure that an SBML document is a consistent structure.
Nevertheless, the ability to supply the values at the time of creation
of a Model is an important aid to producing valid SBML. Knowledge
of the intented SBML Level and Version determine whether it is valid
to assign a particular value to an attribute, or whether it is valid
to add an object to an existing SBMLDocument.
public Model(SBMLNamespaces sbmlns)
throws SBMLConstructorException
Model using the given SBMLNamespaces object
sbmlns.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core.
A common approach to using this class constructor is to create an
SBMLNamespaces object somewhere in a program, once, then pass it to
object constructors such as this one when needed.
sbmlns - an SBMLNamespaces object.
SBMLConstructorException - Thrown if the given level and version combination, or this kind
of SBML object, are either invalid or mismatched with respect to the
parent SBMLDocument object.
Model object to an SBMLDocument (e.g.,
using SBMLDocument.setModel(Model m)), the SBML XML namespace of the document
overrides the value used when creating the Model object via this
constructor. This is necessary to ensure that an SBML document is a
consistent structure. Nevertheless, the ability to supply the values
at the time of creation of a Model is an important aid to producing
valid SBML. Knowledge of the intented SBML Level and Version
determine whether it is valid to assign a particular value to an
attribute, or whether it is valid to add an object to an existing
SBMLDocument.
public Model(Model orig)
throws SBMLConstructorException
Model object.
orig - the object to copy.
SBMLConstructorException - Thrown if the argument orig is null.| Method Detail |
|---|
public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize() methods for the objects. The finalize() methods in turn call the Model.delete() method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke Model.delete() themselves.
delete in class SBasepublic Model cloneObject()
Model object.
cloneObject in class SBaseModel.public SBase getElementBySId(String id)
id in the
model-wide SId namespace, or null if no such object is found.
getElementBySId in class SBaseid - string representing the id of objects to find.
id.public SBase getElementByMetaId(String metaid)
metaid, or
null if no such object is found.
getElementByMetaId in class SBasemetaid - string representing the metaid of objects to find
metaid.public String getId()
Model.
getId in class SBaseModel.SBase.isSetMetaId(),
SBase.setMetaId(String metaid)public String getName()
Model.
getName in class SBaseModel.SBase.isSetMetaId(),
SBase.setMetaId(String metaid)public String getSubstanceUnits()
Model.
Model.
Model in lower Levels of SBML.public String getTimeUnits()
Model.
Model.
Model in lower Levels of SBML.public String getVolumeUnits()
Model.
Model.
Model in lower Levels of SBML.public String getAreaUnits()
Model.
Model.
Model in lower Levels of SBML.public String getLengthUnits()
Model.
Model.
Model in lower Levels of SBML.public String getExtentUnits()
Model.
Model.
Model in lower Levels of SBML.public String getConversionFactor()
Model.
Model.
Model in lower Levels of SBML.public boolean isSetId()
true if this
Model's 'id' attribute is set.
isSetId in class SBasetrue if the 'id' attribute of this Model is
set, false otherwise.SBase.getMetaId(),
SBase.setMetaId(String metaid)public boolean isSetName()
true if this
Model's 'name' attribute is set.
isSetName in class SBasetrue if the 'name' attribute of this Model is
set, false otherwise.SBase.getMetaId(),
SBase.setMetaId(String metaid)public boolean isSetSubstanceUnits()
true if this
Model's 'substanceUnits' attribute is set.
true if the 'substanceUnits' attribute of this Model is
set, false otherwise.
Model in lower Levels of SBML.public boolean isSetTimeUnits()
true if this
Model's 'timeUnits' attribute is set.
true if the 'timeUnits' attribute of this Model is
set, false otherwise.
Model in lower Levels of SBML.public boolean isSetVolumeUnits()
true if this
Model's 'volumeUnits' attribute is set.
true if the 'volumeUnits' attribute of this Model is
set, false otherwise.
Model in lower Levels of SBML.public boolean isSetAreaUnits()
true if this
Model's 'areaUnits' attribute is set.
true if the 'areaUnits' attribute of this Model is
set, false otherwise.
Model in lower Levels of SBML.public boolean isSetLengthUnits()
true if this
Model's 'lengthUnits' attribute is set.
true if the 'lengthUnits' attribute of this Model is
set, false otherwise.
Model in lower Levels of SBML.public boolean isSetExtentUnits()
true if this
Model's 'extentUnits' attribute is set.
true if the 'extentUnits' attribute of this Model is
set, false otherwise.
Model in lower Levels of SBML.public boolean isSetConversionFactor()
true if this
Model's 'conversionFactor' attribute is set.
true if the 'conversionFactor' attribute of this Model is
set, false otherwise.
Model in lower Levels of SBML.public int setId(String sid)
Model.
The string sid is copied. Note that SBML has strict requirements
for the syntax of identifiers. The following is a summary of the definition of the SBML identifier type
SId, which defines the permitted syntax of identifiers. We
express the syntax using an extended form of BNF notation:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*The characters
( and ) are used for grouping, the
character * 'zero or more times', and the character
| indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match; i.e., comparisons must be
performed in a case-sensitive manner. In addition, there are a few
conditions for the uniqueness of identifiers in an SBML model. Please
consult the SBML specifications for the exact formulations.
setId in class SBasesid - the string to use as the identifier of this Model
public int setName(String name)
Model.
The string in name is copied.
setName in class SBasename - the new name for the Model
public int setSubstanceUnits(String units)
Model.
The string in units is copied.
units - the new substanceUnits for the Model
Model in lower Levels of SBML.public int setTimeUnits(String units)
Model.
The string in units is copied.
units - the new timeUnits for the Model
Model in lower Levels of SBML.public int setVolumeUnits(String units)
Model.
The string in units is copied.
units - the new volumeUnits for the Model
Model in lower Levels of SBML.public int setAreaUnits(String units)
Model.
The string in units is copied.
units - the new areaUnits for the Model
Model in lower Levels of SBML.public int setLengthUnits(String units)
Model.
The string in units is copied.
units - the new lengthUnits for the Model
Model in lower Levels of SBML.public int setExtentUnits(String units)
Model.
The string in units is copied.
units - the new extentUnits for the Model
Model in lower Levels of SBML.public int setConversionFactor(String units)
Model.
The string in units is copied.
units - the new conversionFactor for the Model
Model in lower Levels of SBML.public int unsetId()
Model.
unsetId in class SBasepublic int unsetName()
Model.
unsetName in class SBasepublic int unsetSubstanceUnits()
Model.
Model in lower Levels of SBML.public int unsetTimeUnits()
Model.
Model in lower Levels of SBML.public int unsetVolumeUnits()
Model.
Model in lower Levels of SBML.public int unsetAreaUnits()
Model.
Model in lower Levels of SBML.public int unsetLengthUnits()
Model.
Model in lower Levels of SBML.public int unsetExtentUnits()
Model.
Model in lower Levels of SBML.public int unsetConversionFactor()
Model.
Model in lower Levels of SBML.public int addFunctionDefinition(FunctionDefinition fd)
FunctionDefinition object to this Model.
fd - the FunctionDefinition to add
Model.createFunctionDefinition()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see Model.createFunctionDefinition()
for a method that does not lead to these issues.
public int addUnitDefinition(UnitDefinition ud)
UnitDefinition object to this Model.
ud - the UnitDefinition object to add
Model.createUnitDefinition()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see Model.createUnitDefinition() for
a method that does not lead to these issues.
public int addCompartmentType(CompartmentType ct)
CompartmentType object to this Model.
ct - the CompartmentType object to add
Model.createCompartmentType()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see Model.createCompartmentType()
for a method that does not lead to these issues.
, The CompartmentType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.
public int addSpeciesType(SpeciesType st)
SpeciesType object to this Model.
st - the SpeciesType object to add
Model.createSpeciesType()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see Model.createSpeciesType() for a
method that does not lead to these issues.
, The SpeciesType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.
public int addCompartment(Compartment c)
Compartment object to this Model.
c - the Compartment object to add
Model.createCompartment()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see Model.createCompartment() for a
method that does not lead to these issues.
public int addSpecies(Species s)
Species object to this Model.
s - the Species object to add
Model.createSpecies()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see Model.createSpecies() for a
method that does not lead to these issues.
public int addParameter(Parameter p)
Parameter object to this Model.
p - the Parameter object to add
Model.createParameter()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see Model.createParameter() for a
method that does not lead to these issues.
public int addInitialAssignment(InitialAssignment ia)
InitialAssignment object to this Model.
ia - the InitialAssignment object to add
Model.createInitialAssignment()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see Model.createInitialAssignment()
for a method that does not lead to these issues.
public int addRule(Rule r)
Rule object to this Model.
r - the Rule object to add
Model.createAlgebraicRule(),
Model.createAssignmentRule(),
Model.createRateRule()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see the methods
Model.createAlgebraicRule(), Model.createAssignmentRule() and
Model.createRateRule() for methods that do not lead to these issues.
public int addConstraint(Constraint c)
Constraint object to this Model.
c - the Constraint object to add
Model.createConstraint()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see Model.createConstraint() for a
method that does not lead to these issues.
public int addReaction(Reaction r)
Reaction object to this Model.
r - the Reaction object to add
Model.createReaction()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see Model.createReaction() for a
method that does not lead to these issues.
public int addEvent(Event e)
Event object to this Model.
e - the Event object to add
Model.createEvent()Model. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Model. In addition, the caller should make sure
to free the original object if it is no longer being used, or else a
memory leak will result. Please see Model.createEvent() for a method
that does not lead to these issues.
public FunctionDefinition createFunctionDefinition()
FunctionDefinition inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
FunctionDefinition object created
Model.addFunctionDefinition(FunctionDefinition fd)public UnitDefinition createUnitDefinition()
UnitDefinition inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
UnitDefinition object created
Model.addUnitDefinition(UnitDefinition ud)public Unit createUnit()
Unit object within the last UnitDefinition object
created in this model and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the UnitDefinition was created is not
significant. If a UnitDefinition object does not exist in this model,
a new Unit is not created and null is returned instead.
Unit object created
Model.addUnitDefinition(UnitDefinition ud)public CompartmentType createCompartmentType()
CompartmentType inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
CompartmentType object created
Model.addCompartmentType(CompartmentType ct)CompartmentType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.
public SpeciesType createSpeciesType()
SpeciesType inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
SpeciesType object created
Model.addSpeciesType(SpeciesType st)SpeciesType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.
public Compartment createCompartment()
Compartment inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Compartment object created
Model.addCompartment(Compartment c)public Species createSpecies()
Species inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Species object created
Model.addSpecies(Species s)public Parameter createParameter()
Parameter inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Parameter object created
Model.addParameter(Parameter p)public InitialAssignment createInitialAssignment()
InitialAssignment inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
InitialAssignment object created
Model.addInitialAssignment(InitialAssignment ia)public AlgebraicRule createAlgebraicRule()
AlgebraicRule inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
AlgebraicRule object created
Model.addRule(Rule r)public AssignmentRule createAssignmentRule()
AssignmentRule inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
AssignmentRule object created
Model.addRule(Rule r)public RateRule createRateRule()
RateRule inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
RateRule object created
Model.addRule(Rule r)public Constraint createConstraint()
Constraint inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Constraint object created
Model.addConstraint(Constraint c)public Reaction createReaction()
Reaction inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Reaction object created
Model.addReaction(Reaction r)public SpeciesReference createReactant()
SpeciesReference object for a reactant inside the last
Reaction object in this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Reaction object was created and added
to this Model is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, a new SpeciesReference is not
created and null is returned instead.
SpeciesReference object createdpublic SpeciesReference createProduct()
SpeciesReference object for a product inside the last
Reaction object in this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Reaction object was created and added
to this Model is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, a new SpeciesReference is not
created and null is returned instead.
SpeciesReference object createdpublic ModifierSpeciesReference createModifier()
ModifierSpeciesReference object for a modifier species
inside the last Reaction object in this Model, and returns a pointer
to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Reaction object was created and added
to this Model is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, a new ModifierSpeciesReference is
not created and null is returned instead.
SpeciesReference object createdpublic KineticLaw createKineticLaw()
KineticLaw inside the last Reaction object created in
this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Reaction object was created and added
to this Model is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, or a Reaction exists but already has a
KineticLaw, a new KineticLaw is not created and null is returned
instead.
KineticLaw object createdpublic Parameter createKineticLawParameter()
Parameter inside the KineticLaw object of the last
Reaction created inside this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The last KineticLaw object in this Model could have been created in a
variety of ways. For example, it could have been added using
createKineticLaw(), or it could be the result of using
Reaction.createKineticLaw() on the Reaction object created by a
createReaction(). If a Reaction does not exist for this model, or the
last Reaction does not contain a KineticLaw object, a new Parameter is
not created and null is returned instead.
Parameter object createdpublic LocalParameter createKineticLawLocalParameter()
LocalParameter inside the KineticLaw object of the last
Reaction created inside this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The last KineticLaw object in this Model could have been created in a
variety of ways. For example, it could have been added using
createKineticLaw(), or it could be the result of using
Reaction.createKineticLaw() on the Reaction object created by a
createReaction(). If a Reaction does not exist for this model, or the
last Reaction does not contain a KineticLaw object, a new Parameter is
not created and null is returned instead.
Parameter object createdpublic Event createEvent()
Event inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Event object createdpublic EventAssignment createEventAssignment()
EventAssignment inside the last Event object created in
this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Event object in this model was created
is not significant. It could have been created in a variety of ways,
for example by using createEvent(). If no Event object exists in this
Model object, a new EventAssignment is not created and null is
returned instead.
EventAssignment object createdpublic Trigger createTrigger()
Trigger inside the last Event object created in
this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Event object in this model was created
is not significant. It could have been created in a variety of ways,
for example by using createEvent(). If no Event object exists in this
Model object, a new Trigger is not created and null is
returned instead.
Trigger object createdpublic Delay createDelay()
Delay inside the last Event object created in
this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Event object in this model was created
is not significant. It could have been created in a variety of ways,
for example by using createEvent(). If no Event object exists in this
Model object, a new Delay is not created and null is
returned instead.
Delay object createdpublic int setAnnotation(XMLNode annotation)
annotation.
Any existing content of the 'annotation' subelement is discarded.
Unless you have taken steps to first copy and reconstitute any
existing annotations into the annotation that is about to be
assigned, it is likely that performing such wholesale replacement is
unfriendly towards other software applications whose annotations are
discarded. An alternative may be to use appendAnnotation().
setAnnotation in class SBaseannotation - an XML structure that is to be used as the content
of the 'annotation' subelement of this object
Model.appendAnnotation(XMLNode annotation)public int setAnnotation(String annotation)
annotation.
Any existing content of the 'annotation' subelement is discarded.
Unless you have taken steps to first copy and reconstitute any
existing annotations into the annotation that is about to be
assigned, it is likely that performing such wholesale replacement is
unfriendly towards other software applications whose annotations are
discarded. An alternative may be to use appendAnnotation().
setAnnotation in class SBaseannotation - an XML string that is to be used as the content
of the 'annotation' subelement of this object
Model.appendAnnotation(String annotation)public int appendAnnotation(XMLNode annotation)
The content in annotation is copied. Unlike setAnnotation(), this
method allows other annotations to be preserved when an application
adds its own data.
appendAnnotation in class SBaseannotation - an XML structure that is to be copied and appended
to the content of the 'annotation' subelement of this object
Model.setAnnotation(XMLNode annotation)public int appendAnnotation(String annotation)
The content in annotation is copied. Unlike setAnnotation(), this
method allows other annotations to be preserved when an application
adds its own data.
appendAnnotation in class SBaseannotation - an XML string that is to be copied and appended
to the content of the 'annotation' subelement of this object
Model.setAnnotation(String annotation)public ListOfFunctionDefinitions getListOfFunctionDefinitions()
ListOfFunctionDefinitions object in this Model.
Model.public ListOfUnitDefinitions getListOfUnitDefinitions()
ListOfUnitDefinitions object in this Model.
Model.public ListOfCompartmentTypes getListOfCompartmentTypes()
ListOfCompartmentTypes object in this Model.
Model.
CompartmentType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.public ListOfSpeciesTypes getListOfSpeciesTypes()
ListOfSpeciesTypes object in this Model.
Model.
SpeciesType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.public ListOfCompartments getListOfCompartments()
ListOfCompartments object in this Model.
Model.public ListOfSpecies getListOfSpecies()
ListOfSpecies object in this Model.
Species for this Model.public ListOfParameters getListOfParameters()
ListOfParameters object in this Model.
Model.public ListOfInitialAssignments getListOfInitialAssignments()
ListOfInitialAssignments object in this Model.
Model.public ListOfRules getListOfRules()
ListOfRules object in this Model.
Model.public ListOfConstraints getListOfConstraints()
ListOfConstraints object in this Model.
Model.public ListOfReactions getListOfReactions()
ListOfReactions object in this Model.
Model.public ListOfEvents getListOfEvents()
ListOfEvents object in this Model.
Model.public FunctionDefinition getFunctionDefinition(long n)
Model.
FunctionDefinition of this Model.public FunctionDefinition getFunctionDefinition(String sid)
FunctionDefinition object based on its identifier.
FunctionDefinition in this Model with the identifier
sid or null if no such FunctionDefinition exists.public UnitDefinition getUnitDefinition(long n)
UnitDefinition object in this Model.
UnitDefinition of this Model.public UnitDefinition getUnitDefinition(String sid)
UnitDefinition based on its identifier.
UnitDefinition in this Model with the identifier sid or
null if no such UnitDefinition exists.public CompartmentType getCompartmentType(long n)
CompartmentType object in this Model.
CompartmentType of this Model.
CompartmentType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.public CompartmentType getCompartmentType(String sid)
CompartmentType object based on its identifier.
CompartmentType in this Model with the identifier sid
or null if no such CompartmentType exists.
CompartmentType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.public SpeciesType getSpeciesType(long n)
SpeciesType object in this Model.
SpeciesType of this Model.
SpeciesType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.public SpeciesType getSpeciesType(String sid)
SpeciesType object based on its identifier.
SpeciesType in this Model with the identifier sid or
null if no such SpeciesType exists.
SpeciesType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.public Compartment getCompartment(long n)
Compartment object in this Model.
Compartment of this Model.public Compartment getCompartment(String sid)
Compartment object based on its identifier.
Compartment in this Model with the identifier sid or
null if no such Compartment exists.public Species getSpecies(long n)
Species object in this Model.
Species of this Model.public Species getSpecies(String sid)
Species object based on its identifier.
Species in this Model with the identifier sid or null
if no such Species exists.public Parameter getParameter(long n)
Parameter object in this Model.
Parameter of this Model.public Parameter getParameter(String sid)
Parameter object based on its identifier.
Parameter in this Model with the identifier sid or null
if no such Parameter exists.public InitialAssignment getInitialAssignment(long n)
InitialAssignment object in this Model.
InitialAssignment of this Model.public InitialAssignment getInitialAssignment(String symbol)
InitialAssignment object based on the symbol to which it
assigns a value.
InitialAssignment in this Model with the given 'symbol'
attribute value or null if no such InitialAssignment exists.public Rule getRule(long n)
Rule object in this Model.
Rule of this Model.public Rule getRule(String variable)
Rule object based on the variable to which it assigns a value.
Rule in this Model with the given 'variable' attribute
value or null if no such Rule exists.public Constraint getConstraint(long n)
Constraint object in this Model.
Constraint of this Model.public Reaction getReaction(long n)
Reaction object in this Model.
Reaction of this Model.public Reaction getReaction(String sid)
Reaction object based on its identifier.
Reaction in this Model with the identifier sid or null
if no such Reaction exists.public SpeciesReference getSpeciesReference(String sid)
SpeciesReference object based on its identifier.
SpeciesReference in this Model with the identifier sid or null
if no such SpeciesReference exists.public Event getEvent(long n)
Event object in this Model.
Event of this Model.public Event getEvent(String sid)
Event object based on its identifier.
Event in this Model with the identifier sid or null if
no such Event exists.public long getNumFunctionDefinitions()
FunctionDefinition objects in this Model.
Model.public long getNumUnitDefinitions()
UnitDefinition objects in this Model.
Model.public long getNumCompartmentTypes()
CompartmentType objects in this Model.
Model.
CompartmentType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.public long getNumSpeciesTypes()
SpeciesType objects in this Model.
Model.
SpeciesType object class is only available in SBML
Level 2 Versions 2–4. It is not available in
Level 1 nor Level 3.public long getNumCompartments()
Compartment objects in this Model.
Model.public long getNumSpecies()
Model.
Species in this Model.public long getNumSpeciesWithBoundaryCondition()
Species in this Model having their
'boundaryCondition' attribute value set to true.
Species in this Model with boundaryCondition set
to true.public long getNumParameters()
Parameter objects in this Model.
Model. Parameters defined in
KineticLaws are not included.public long getNumInitialAssignments()
InitialAssignment objects in this Model.
Model.public long getNumRules()
Rule objects in this Model.
Model.public long getNumConstraints()
Constraint objects in this Model.
Model.public long getNumReactions()
Reaction objects in this Model.
Model.public long getNumEvents()
Event objects in this Model.
Model.public int removeFromParentAndDelete()
Model's parent SBMLDocument and calls setModel(null) on it,
indirectly deleting itself. Overridden from the SBase function since
the parent is not a ListOf.
removeFromParentAndDelete in class SBase
public void renameSIdRefs(String oldid,
String newid)
renameSIdRefs in class SBaseoldid - the old identifiernewid - the new identifier
public void renameUnitSIdRefs(String oldid,
String newid)
renameUnitSIdRefs in class SBaseoldid - the old identifiernewid - the new identifierpublic int getTypeCode()
LibSBML attaches an identifying code to every
kind of SBML object. These are known as SBML type codes. In
other languages, the set of type codes is stored in an enumeration; in
the Java language interface for libSBML, the type codes are defined as
static integer constants in the interface class libsbmlConstants. The names of the type codes all begin with the
characters SBML_.
getTypeCode in class SBaseSBML_UNKNOWN (default).
Model.getElementName()public String getElementName()
Model, is
always 'model'.
getElementName in class SBase'model'.public void populateListFormulaUnitsData()
The first element of the list refers to the default units of 'substance per time' derived from the model and has the unitReferenceId 'subs_per_time'. This facilitates the comparison of units derived from mathematical formula with the expected units.
The next elements of the list record the units of the compartments and species established from either explicitly declared or default units.
The next elements record the units of any parameters.
Subsequent elements of the list record the units derived for each mathematical expression encountered within the model.
Unit Consistency Validator.
The list is populated prior to running the validation and thus
the consistency of units can be checked by accessing the members
of the list and comparing the appropriate data.public boolean isPopulatedListFormulaUnitsData()
true if
the list of FormulaUnitsData is populated.
true if the list of FormulaUnitsData is populated,
false otherwise.public boolean hasRequiredElements()
true if
all the required elements for this Model object
have been set.
hasRequiredElements in class SBaseModel object are:
listOfCompartments (L1 only); listOfSpecies (L1V1 only);
listOfReactions(L1V1 only)
public FunctionDefinition removeFunctionDefinition(long n)
FunctionDefinition object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the FunctionDefinition object to remove
FunctionDefinition object removed. As mentioned above,
the caller owns the returned item. null is returned if the given index
is out of range.
public FunctionDefinition removeFunctionDefinition(String sid)
FunctionDefinition object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
If none of the FunctionDefinition objects in this Model object have the identifier
sid, then null is returned.
sid - the identifier of the FunctionDefinition object to remove
FunctionDefinition object removed. As mentioned above, the
caller owns the returned object. null is returned if no FunctionDefinition
object with the identifier exists in this Model object.public UnitDefinition removeUnitDefinition(long n)
UnitDefinition object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the UnitDefinition object to remove
UnitDefinition object removed. As mentioned above,
the caller owns the returned item. null is returned if the given index
is out of range.
public UnitDefinition removeUnitDefinition(String sid)
UnitDefinition object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
If none of the UnitDefinition objects in this Model object have the identifier
sid, then null is returned.
sid - the identifier of the UnitDefinition object to remove
UnitDefinition object removed. As mentioned above, the
caller owns the returned object. null is returned if no UnitDefinition
object with the identifier exists in this Model object.public CompartmentType removeCompartmentType(long n)
CompartmentType object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the CompartmentType object to remove
null is returned if the given index
is out of range.
public CompartmentType removeCompartmentType(String sid)
CompartmentType object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
If none of the CompartmentType objects in this Model object have the identifier
sid, then null is returned.
sid - the identifier of the object to remove
CompartmentType object removed. As mentioned above, the
caller owns the returned object. null is returned if no CompartmentType
object with the identifier exists in this Model object.public SpeciesType removeSpeciesType(long n)
SpeciesType object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the SpeciesType object to remove
SpeciesType object removed. As mentioned above,
the caller owns the returned item. null is returned if the given index
is out of range.
public SpeciesType removeSpeciesType(String sid)
SpeciesType object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
If none of the SpeciesType objects in this Model object have the identifier
sid, then null is returned.
sid - the identifier of the SpeciesType object to remove
SpeciesType object removed. As mentioned above, the
caller owns the returned object. null is returned if no SpeciesType
object with the identifier exists in this Model object.
public Compartment removeCompartment(long n)
Compartment object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the Compartment object to remove
Compartment object removed. As mentioned above,
the caller owns the returned item. null is returned if the given index
is out of range.
public Compartment removeCompartment(String sid)
Compartment object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
If none of the Compartment objects in this Model object have the identifier
sid, then null is returned.
sid - the identifier of the Compartment object to remove
Compartment object removed. As mentioned above, the
caller owns the returned object. null is returned if no Compartment
object with the identifier exists in this Model object.public Species removeSpecies(long n)
Species object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the Species object to remove
Species object removed. As mentioned above,
the caller owns the returned item. null is returned if the given index
is out of range.
public Species removeSpecies(String sid)
Species object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
If none of the Species objects in this Model object have the identifier
sid, then null is returned.
sid - the identifier of the Species object to remove
Species object removed. As mentioned above, the
caller owns the returned object. null is returned if no Species
object with the identifier exists in this Model object.
public Parameter removeParameter(long n)
Parameter object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the Parameter object to remove
Parameter object removed. As mentioned above,
the caller owns the returned item. null is returned if the given index
is out of range.
public Parameter removeParameter(String sid)
Parameter object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
If none of the Parameter objects in this Model object have the identifier
sid, then null is returned.
sid - the identifier of the Parameter object to remove
Parameter object removed. As mentioned above, the
caller owns the returned object. null is returned if no Parameter
object with the identifier exists in this Model object.public InitialAssignment removeInitialAssignment(long n)
InitialAssignment object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the InitialAssignment object to remove
InitialAssignment object removed. As mentioned above,
the caller owns the returned item. null is returned if the given index
is out of range.
public InitialAssignment removeInitialAssignment(String symbol)
InitialAssignment object with the given 'symbol' attribute
from this Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
If none of the InitialAssignment objects in this Model object have the
'symbol' attribute symbol, then null is returned.
symbol - the 'symbol' attribute of the InitialAssignment object to remove
InitialAssignment object removed. As mentioned above, the
caller owns the returned object. null is returned if no InitialAssignment
object with the 'symbol' attribute exists in this Model object.public Rule removeRule(long n)
Rule object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the Rule object to remove
Rule object removed. As mentioned above,
the caller owns the returned item. null is returned if the given index
is out of range.
public Rule removeRule(String variable)
Rule object with the given 'variable' attribute from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
If none of the Rule objects in this Model object have the 'variable' attribute
variable, then null is returned.
variable - the 'variable' attribute of the Rule object to remove
Rule object removed. As mentioned above, the
caller owns the returned object. null is returned if no Rule
object with the 'variable' attribute exists in this Model object.public Constraint removeConstraint(long n)
Constraint object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the Constraint object to remove
Constraint object removed. As mentioned above,
the caller owns the returned item. null is returned if the given index
is out of range.
public Reaction removeReaction(long n)
Reaction object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the Reaction object to remove
Reaction object removed. As mentioned above,
the caller owns the returned item. null is returned if the given index
is out of range.
public Reaction removeReaction(String sid)
Reaction object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
If none of the Reaction objects in this Model object have the identifier
sid, then null is returned.
sid - the identifier of the Reaction object to remove
Reaction object removed. As mentioned above, the
caller owns the returned object. null is returned if no Reaction
object with the identifier exists in this Model object.
public Event removeEvent(long n)
Event object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n - the index of the Event object to remove
Event object removed. As mentioned above,
the caller owns the returned item. null is returned if the given index
is out of range.
public Event removeEvent(String sid)
Event object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
If none of the Event objects in this Model object have the identifier
sid, then null is returned.
sid - the identifier of the Event object to remove
Event object removed. As mentioned above, the
caller owns the returned object. null is returned if no Event
object with the identifier exists in this Model object.
public int appendFrom(Model model)
Model, makes copies of everything,
and appends those copies to the appropriate places in this Model. Also
calls 'appendFrom' on all plugin objects.
model - the Model to merge with this one.
|
libSBML 5.8.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||