public class CompModelPlugin extends CompSBasePlugin
Model
.
The CompModelPlugin
class inherits from the SBMLSBasePlugin class, and
codifies the extentions to the Model
class defined in the SBML
Level 3 'Hierarchical Model Composition'
package (&ldquocomp&rdquo). This extention allows a Model
to define
Submodels (other Models that are instantiated as new parts of the parent
Model
), and Ports, a defined interface for including the given Model
as a
Submodel
of a different Model
.
Submodels are stored in an optional child ListOfSubmodels
object, which,
if present, must contain one or more Submodel
objects. All of the Submodels
present in the ListOfSubmodels
are defined to be instantiated in the
'complete' Model
.
Ports are stored in an optional child ListOfPorts
object, which,
if present, must contain one or more Port
objects. All of the Ports
present in the ListOfPorts
collectively define the 'port interface'
of the Model
.
Constructor and Description |
---|
CompModelPlugin(CompModelPlugin orig)
Copy constructor.
|
CompModelPlugin(java.lang.String uri,
java.lang.String prefix,
CompPkgNamespaces compns)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
addPort(Port port)
Adds a copy of the given
Port object to the list of ports. |
int |
addSubmodel(Submodel submodel)
Adds a copy of the given
Submodel object to the list of submodels. |
SBasePlugin |
cloneObject()
Creates and returns a deep copy of this
CompModelPlugin object. |
Port |
createPort()
Creates a
Port object, adds it to the end of the
port objects list and returns a pointer to the newly
created object. |
Submodel |
createSubmodel()
Creates a
Submodel object, adds it to the end of the
submodel objects list and returns a pointer to the newly
created object. |
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getDivider()
Get the string used as the divider between names when renaming and
flattening models.
|
SBase |
getElementByMetaId(java.lang.String metaid)
Returns the first child element it can find with the given meta
identifier, 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. |
ListOfPorts |
getListOfPorts()
Returns the
ListOf object that holds all ports. |
ListOfSubmodels |
getListOfSubmodels()
Returns the
ListOf object that holds all submodels. |
long |
getNumPorts()
Returns the number of ports for this
CompModelPlugin . |
long |
getNumSubmodels()
Returns the number of submodels for this
CompModelPlugin . |
Port |
getPort(long n)
Returns the port with the given index.
|
Port |
getPort(java.lang.String id)
Returns the port with the given identifier.
|
Submodel |
getSubmodel(long n)
Returns the submodel with the given index.
|
Submodel |
getSubmodel(java.lang.String id)
Returns the submodel with the given identifier.
|
SWIGTYPE_p_PrefixTransformer |
getTransformer()   |
boolean |
isSetTransformer()   |
Port |
removePort(long index)
Removes the port with the given index.
|
Submodel |
removeSubmodel(long index)
Removes the submodel with the given index.
|
int |
setDivider(java.lang.String divider)
Set the string used as the divider between names when renaming and
flattening models.
|
void |
setTransformer(SWIGTYPE_p_PrefixTransformer transformer)
Sets the custom transformer that is to be used, instead of the standard
prefixing with the given divider.
|
void |
unsetTransformer()
Unsets any custom prefix transformers.
|
addReplacedElement, clearReplacedElements, createReplacedBy, createReplacedElement, getListOfReplacedElements, getNumReplacedElements, getReplacedBy, getReplacedElement, isSetReplacedBy, logInvalidId, removeReplacedElement, setReplacedBy, unsetReplacedBy
getElementNamespace, getLevel, getListOfAllElements, getListOfAllElements, getPackageName, getPackageVersion, getParentSBMLObject, getPrefix, getSBMLDocument, getURI, getVersion, isValidTypeForList, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, setElementNamespace
public CompModelPlugin(java.lang.String uri, java.lang.String prefix, CompPkgNamespaces compns)
public CompModelPlugin(CompModelPlugin orig)
CompModelPlugin
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 CompModelPlugin.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 CompModelPlugin.delete()
themselves.
delete
 in class CompSBasePlugin
public SBasePlugin cloneObject()
CompModelPlugin
object.
cloneObject
 in class CompSBasePlugin
CompModelPlugin
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 CompSBasePlugin
id
- a string representing the id of objects to find.
SBase
element with the given id
.public SBase getElementByMetaId(java.lang.String metaid)
metaid
, or null
if no
such object is found.
getElementByMetaId
 in class CompSBasePlugin
metaid
- a string representing the metaid of objects to find.
SBase
element with the given metaid
.public ListOfSubmodels getListOfSubmodels()
ListOf
object that holds all submodels.
ListOf
object that holds all submodels.public Submodel getSubmodel(long n)
null
is returned.
n
- the index number of the Submodel
to get.
Submodel
in the ListOfSubmodels
.public Submodel getSubmodel(java.lang.String id)
id
- the identifier of the Submodel
to get.
Submodel
in the ListOfSubmodels
with the given identifier.
If no such submodel with identifier id
exists, null
is returned.public int addSubmodel(Submodel submodel)
Submodel
object to the list of submodels.
Fails if the added submodel is null
, does not match the
level/version/package of the parent object, or cannot be added to the
list of submodels.
submodel
- the Submodel
object to be added to the list of
submodels.
public long getNumSubmodels()
CompModelPlugin
.
CompModelPlugin
.public Submodel createSubmodel()
Submodel
object, adds it to the end of the
submodel objects list and returns a pointer to the newly
created object.
Submodel
objectpublic Submodel removeSubmodel(long index)
public ListOfPorts getListOfPorts()
ListOf
object that holds all ports.
ListOf
object that holds all ports.public Port getPort(long n)
n
- the index number of the Port
to get.
Port
in the ListOfPorts
. If the index n
is invalid,
null
is returned.public Port getPort(java.lang.String id)
id
- the id of the Port
to get.
Port
in the ListOfPorts
with the given identifier. If the
identifier is invalid, null
is returned.public int addPort(Port port)
Port
object to the list of ports.
port
- the Port
object to be added to the list of ports. Fails if
the added port is null
, does not match the level/version/package of the
parent object, or cannot be added to the list of ports.
public long getNumPorts()
CompModelPlugin
.
CompModelPlugin
.public Port createPort()
Port
object, adds it to the end of the
port objects list and returns a pointer to the newly
created object.
Port
objectpublic Port removePort(long index)
public int setDivider(java.lang.String divider)
The divider string consists of two underscore characters
("__
") by default. This method will fail if called
with an empty divider
, or a divider
that cannot be used internally as part
of a valid SBML SId.
public java.lang.String getDivider()
The divider string consists of two underscore characters
("__
") by default, and can be overridden
with the setDivider() function.
public void setTransformer(SWIGTYPE_p_PrefixTransformer transformer)
If not set, only ids and meta ids will be prefixed.
NOTE: the model plugin only holds the pointer to the element it does not take ownership of it. Thus the calling program is responsible of freeing the transformer when no longer needed (i.e after the SBML document has been deleted)
public SWIGTYPE_p_PrefixTransformer getTransformer()
public boolean isSetTransformer()
public void unsetTransformer()