public class CompSBMLDocumentPlugin extends SBMLDocumentPlugin
SBMLDocument.
The CompSBMLDocumentPlugin class inherits from the SBMLDocumentPlugin
class, and codifies the extentions to the SBMLDocument class defined in
the SBML Level 3
'Hierarchical Model Composition'
package (&ldquocomp&rdquo). This extention allows multiple Model
objects to be defined in a single SBMLDocument, stored in an optional
child ListOfModelDefinitions object, as well as define references to Model
objects in other files, stored in the optional child
ListOfExternalModelDefinitions object. These model definitions, if
present, allow Submodel objects to reference other Models to instantiate.
The presence of ModelDefinitions and ExternalModelDefinitions in an
SBMLDocument does not change the default Model in the file. If a
SBMLDocument is submitted somewhere to be simulated, it is still the
<model> child of the <sbml> element
that should be simulated.
In addition, as all packages do, the CompSBMLDocumentPlugin defines a
required flag named required, which indicates whether
&ldquocomp&rdquo constructs can be used to change the core mathematics of the
<model> child of the <sbml> element.
Because they can, this attribute must be set true.
| Constructor and Description |
|---|
CompSBMLDocumentPlugin(CompSBMLDocumentPlugin orig)
Copy constructor.
|
CompSBMLDocumentPlugin(java.lang.String uri,
java.lang.String prefix,
CompPkgNamespaces compns)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addExternalModelDefinition(ExternalModelDefinition externalModelDefinition)
Adds a copy of the given
ExternalModelDefinition object to the list of
ExternalModelDefinitions. |
int |
addModelDefinition(ModelDefinition modelDefinition)
Adds a copy of the given
ModelDefinition object to the list of
ModelDefinitions. |
SBasePlugin |
cloneObject()
Creates and returns a deep copy of this
CompSBMLDocumentPlugin object. |
ExternalModelDefinition |
createExternalModelDefinition()
Creates a
ExternalModelDefinition object, adds it to the end of the
ExternalModelDefinition objects list and returns a pointer to the newly
created object. |
ModelDefinition |
createModelDefinition()
Creates a
ModelDefinition object, adds it to the end of the
ModelDefinition objects list and returns a pointer to the newly
created object. |
void |
delete()
Explicitly deletes the underlying native object.
|
SBase |
getElementByMetaId(java.lang.String metaid)
Returns the first child element it can find with the given
metaid, or
itself if it has the given metaid, or null if no such object is
found. |
SBase |
getElementBySId(java.lang.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. |
ExternalModelDefinition |
getExternalModelDefinition(long n)
Returns the
ExternalModelDefinition with the given index. |
ExternalModelDefinition |
getExternalModelDefinition(java.lang.String sid)
Returns the model definition object based on its identifier.
|
ListOfExternalModelDefinitions |
getListOfExternalModelDefinitions()
Returns the
ListOf object that holds all ExternalModelDefinitions. |
ListOfModelDefinitions |
getListOfModelDefinitions()
Returns the
ListOf object that holds all ModelDefinitions. |
SBase |
getModel(java.lang.String sid)
Searches the model namespace of the document and returns the
Model,
ModelDefinition, or ExternalModelDefintion object with the given
identifier. |
ModelDefinition |
getModelDefinition(long n)
Returns the
ModelDefinition with the given index. |
ModelDefinition |
getModelDefinition(java.lang.String sid)
Returns the model definition object based on its identifier.
|
long |
getNumExternalModelDefinitions()
Returns the number of ExternalModelDefinitions for this
SBMLDocumentPlugin. |
long |
getNumModelDefinitions()
Returns the number of ModelDefinitions for this
SBMLDocumentPlugin. |
ExternalModelDefinition |
removeExternalModelDefinition(long index)
Removes the
ExternalModelDefinition with the given index. |
ExternalModelDefinition |
removeExternalModelDefinition(java.lang.String id)
Removes the
ExternalModelDefinition with the given id. |
ModelDefinition |
removeModelDefinition(long index)
Removes the
ModelDefinition with the given index from the CompSBMLDocumentPlugin. |
ModelDefinition |
removeModelDefinition(java.lang.String id)
|
int |
setRequired(boolean value)
Sets the boolean value of 'required' attribute of corresponding package
in
SBMLDocument element. |
getRequired, isSetRequired, unsetRequiredgetElementNamespace, getLevel, getListOfAllElements, getListOfAllElements, getPackageName, getPackageVersion, getParentSBMLObject, getPrefix, getSBMLDocument, getURI, getVersion, isValidTypeForList, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, setElementNamespacepublic CompSBMLDocumentPlugin(java.lang.String uri, java.lang.String prefix, CompPkgNamespaces compns)
public CompSBMLDocumentPlugin(CompSBMLDocumentPlugin orig)
CompSBMLDocumentPlugin object.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 CompSBMLDocumentPlugin.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 CompSBMLDocumentPlugin.delete() themselves.
delete in class SBMLDocumentPluginpublic SBasePlugin cloneObject()
CompSBMLDocumentPlugin object.
cloneObject in class SBMLDocumentPluginCompSBMLDocumentPlugin objectpublic SBase getElementBySId(java.lang.String id)
id in the
model-wide SId namespace, or null if no such object is found.
getElementBySId in class SBasePluginid - string representing the identifier of objects to find
SBase element with the given id.
ModelDefinition objects.public SBase getElementByMetaId(java.lang.String metaid)
metaid, or
itself if it has the given metaid, or null if no such object is
found.
getElementByMetaId in class SBasePluginmetaid - string representing the meta identifier of objects to find
SBase element with the given metaid.public ListOfModelDefinitions getListOfModelDefinitions()
ListOf object that holds all ModelDefinitions.
ListOf object that holds all ModelDefinitions.public ModelDefinition getModelDefinition(long n)
ModelDefinition with the given index.
n - the index number of the ModelDefinition to get.
ModelDefinition in the ListOfModelDefinitions. If the
index is invalid, null is returned.public ModelDefinition getModelDefinition(java.lang.String sid)
sid - a string representing the identifier
of the model definition to get.
ModelDefinition in the ListOfModelDefinitions with the given sid
or null if no such ModelDefinition exists.
CompSBMLDocumentPlugin.getModelDefinition(long n),
CompSBMLDocumentPlugin.getListOfModelDefinitions()public int addModelDefinition(ModelDefinition modelDefinition)
ModelDefinition object to the list of
ModelDefinitions.
modelDefinition - the ModelDefinition object to be added to the
list of ModelDefinitions. Fails if the added ModelDefinition is null,
does not match the level/version/package of the parent object, or cannot
be added to the list of replaced elements.
public long getNumModelDefinitions()
SBMLDocumentPlugin.
public ModelDefinition createModelDefinition()
ModelDefinition object, adds it to the end of the
ModelDefinition objects list and returns a pointer to the newly
created object.
ModelDefinition objectpublic ModelDefinition removeModelDefinition(long index)
ModelDefinition with the given index from the CompSBMLDocumentPlugin.
A pointer to the ModelDefinition that was removed is returned.
If no ModelDefinition has been removed, null is returned.
index - the index of the ModelDefinition object to remove
ModelDefinition object removed. As mentioned above,
the caller owns the returned object. null is returned if
the given index is out of range.public ModelDefinition removeModelDefinition(java.lang.String id)
ModelDefinition with the given id from the CompSBMLDocumentPlugin.
A pointer to the ModelDefinition that was removed is returned.
If no ModelDefinition has been removed, null is returned.
id - the id of the ModelDefinition object to remove
ModelDefinition object removed. As mentioned above,
the caller owns the returned object. null is returned if
the given index is out of range.public ListOfExternalModelDefinitions getListOfExternalModelDefinitions()
ListOf object that holds all ExternalModelDefinitions.
ListOf object that holds all ExternalModelDefinitions.public ExternalModelDefinition getExternalModelDefinition(long n)
ExternalModelDefinition with the given index.
n - the index number of the ExternalModelDefinition to get.
ExternalModelDefinition in the
ListOfExternalModelDefinitions. If the index is invalid, null is
returned.public ExternalModelDefinition getExternalModelDefinition(java.lang.String sid)
sid - a string representing the identifier
of the model definition to get.
ExternalModelDefinition in the ListOfExternalModelDefinitions with the given sid
or null if no such ExternalModelDefinition exists.
CompSBMLDocumentPlugin.getExternalModelDefinition(long n),
CompSBMLDocumentPlugin.getListOfExternalModelDefinitions()public SBase getModel(java.lang.String sid)
Model,
ModelDefinition, or ExternalModelDefintion object with the given
identifier.
sid - a string representing the identifier of the model definition to get.
SBase corresponding to the given sid or null if no such
model exists. If no such model exists, this will return null.public int setRequired(boolean value)
Sets the boolean value of 'required' attribute of corresponding package
in SBMLDocument element. The only legal value is 'true' for the
Hierarchical Model Composition package.
setRequired in class SBMLDocumentPluginvalue - the boolean value of 'required' attribute of corresponding
package in SBMLDocument element.
SBMLDocumentPlugin.getRequired(),
SBMLDocumentPlugin.isSetRequired(),
SBMLDocumentPlugin.unsetRequired()public int addExternalModelDefinition(ExternalModelDefinition externalModelDefinition)
ExternalModelDefinition object to the list of
ExternalModelDefinitions.
externalModelDefinition - the ExternalModelDefinition object to be
added to the list of ExternalModelDefinitions. Fails if the added
ExternalModelDefinition is null, does not match the
level/version/package of the parent object, or cannot be added to the
list of external model definitions.
public long getNumExternalModelDefinitions()
SBMLDocumentPlugin.
SBMLDocumentPlugin.public ExternalModelDefinition createExternalModelDefinition()
ExternalModelDefinition object, adds it to the end of the
ExternalModelDefinition objects list and returns a pointer to the newly
created object.
ExternalModelDefinition objectpublic ExternalModelDefinition removeExternalModelDefinition(long index)
ExternalModelDefinition with the given index.
A pointer to the ExternalModelDefinition that was removed is returned.
If no ExternalModelDefinition has been removed, null is returned.
index - the index of the ExternalModelDefinition object to remove
ExternalModelDefinition object removed. As mentioned above,
the caller owns the returned object. null is returned if
the given index is out of range.public ExternalModelDefinition removeExternalModelDefinition(java.lang.String id)
ExternalModelDefinition with the given id.
A pointer to the ExternalModelDefinition that was removed is returned.
If no ExternalModelDefinition has been removed, null is returned.
id - the id of the ExternalModelDefinition object to remove
ExternalModelDefinition object removed. As mentioned above,
the caller owns the returned object. null is returned if
the given index is out of range.