public class ModelDefinition extends Model
The Hierarchical Model Composition (&ldquocomp&rdquo) package allows multiple Model
objects
to be defined in a single SBMLDocument
. While these new Model
objects are
not new SBML classes, they are given a new name,
<modelDefinition>
, and reside in ListOfModelDefinition
objects. In libSBML, this class inherits from the Model
class, changing
only the expected parent of the object, and the XML name.
An additional restriction is placed on the 'id' attribute of ModelDefinition
objects: not only must it be unique across all such attributes of type SId
within the ModelDefintion, it must also be unique across all Model
,
ModelDefinition
, and ExternalModelDefinition
objects in the same SBMLDocument
.
Constructor and Description |
---|
ModelDefinition()
Creates a new
ModelDefinition with the given level, version, and package
version. |
ModelDefinition(CompPkgNamespaces compns)
Creates a new
ModelDefinition with the given CompPkgNamespaces object. |
ModelDefinition(long level)
Creates a new
ModelDefinition with the given level, version, and package
version. |
ModelDefinition(long level,
long version)
Creates a new
ModelDefinition with the given level, version, and package
version. |
ModelDefinition(long level,
long version,
long pkgVersion)
Creates a new
ModelDefinition with the given level, version, and package
version. |
ModelDefinition(Model source)
Copy constructor from base
Model object. |
Modifier and Type | Method and Description |
---|---|
ModelDefinition |
cloneObject()
Creates and returns a deep copy of this
ModelDefinition object. |
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getElementName()
Returns the XML element name of this object.
|
int |
getTypeCode()
Returns the libSBML type code of this object instance.
|
int |
removeFromParentAndDelete()
Finds this
Model 's parent ListOfModelDefinitions and removes itself from
it and deletes itself. |
addCompartment, addCompartmentType, addConstraint, addEvent, addFunctionDefinition, addInitialAssignment, addParameter, addReaction, addRule, addSpecies, addSpeciesType, addUnitDefinition, appendAnnotation, appendAnnotation, appendFrom, clearAllElementIdList, clearAllElementMetaIdList, connectToChild, createAlgebraicRule, createAssignmentRule, createCompartment, createCompartmentType, createConstraint, createDelay, createEvent, createEventAssignment, createFunctionDefinition, createInitialAssignment, createKineticLaw, createKineticLawLocalParameter, createKineticLawParameter, createModifier, createParameter, createProduct, createRateRule, createReactant, createReaction, createSpecies, createSpeciesType, createTrigger, createUnit, createUnitDefinition, getAllElementIdList, getAllElementMetaIdList, getAreaUnits, getAssignmentRule, getAssignmentRuleByVariable, getCompartment, getCompartment, getCompartmentType, getCompartmentType, getConstraint, getConversionFactor, getElementByMetaId, getElementBySId, getEvent, getEvent, getExtentUnits, getFunctionDefinition, getFunctionDefinition, getId, getInitialAssignment, getInitialAssignment, getInitialAssignmentBySymbol, getLengthUnits, getListOfCompartments, getListOfCompartmentTypes, getListOfConstraints, getListOfEvents, getListOfFunctionDefinitions, getListOfInitialAssignments, getListOfParameters, getListOfReactions, getListOfRules, getListOfSpecies, getListOfSpeciesTypes, getListOfUnitDefinitions, getModifierSpeciesReference, getName, getNumCompartments, getNumCompartmentTypes, getNumConstraints, getNumEvents, getNumFunctionDefinitions, getNumInitialAssignments, getNumParameters, getNumReactions, getNumRules, getNumSpecies, getNumSpeciesTypes, getNumSpeciesWithBoundaryCondition, getNumUnitDefinitions, getParameter, getParameter, getRateRule, getRateRuleByVariable, getReaction, getReaction, getRule, getRule, getRuleByVariable, getSpecies, getSpecies, getSpeciesReference, getSpeciesType, getSpeciesType, getSubstanceUnits, getTimeUnits, getUnitDefinition, getUnitDefinition, getVolumeUnits, hasRequiredElements, isPopulatedAllElementIdList, isPopulatedAllElementMetaIdList, isPopulatedListFormulaUnitsData, isSetAreaUnits, isSetConversionFactor, isSetExtentUnits, isSetId, isSetLengthUnits, isSetName, isSetSubstanceUnits, isSetTimeUnits, isSetVolumeUnits, populateAllElementIdList, populateAllElementMetaIdList, populateListFormulaUnitsData, removeCompartment, removeCompartment, removeCompartmentType, removeCompartmentType, removeConstraint, removeEvent, removeEvent, removeFunctionDefinition, removeFunctionDefinition, removeInitialAssignment, removeInitialAssignment, removeParameter, removeParameter, removeReaction, removeReaction, removeRule, removeRule, removeRuleByVariable, removeSpecies, removeSpecies, removeSpeciesType, removeSpeciesType, removeUnitDefinition, removeUnitDefinition, renameIDs, renameSIdRefs, renameUnitSIdRefs, setAnnotation, setAnnotation, setAreaUnits, setConversionFactor, setExtentUnits, setId, setLengthUnits, setName, setSubstanceUnits, setTimeUnits, setVolumeUnits, unsetAreaUnits, unsetConversionFactor, unsetExtentUnits, unsetId, unsetLengthUnits, unsetName, unsetSubstanceUnits, unsetTimeUnits, unsetVolumeUnits
addCVTerm, addCVTerm, appendNotes, appendNotes, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getIdAttribute, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getPackageCoreVersion, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setIdAttribute, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm, unsetUserData
public ModelDefinition(long level, long version, long pkgVersion) throws SBMLConstructorException
ModelDefinition
with the given level, version, and package
version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public ModelDefinition(long level, long version) throws SBMLConstructorException
ModelDefinition
with the given level, version, and package
version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public ModelDefinition(long level) throws SBMLConstructorException
ModelDefinition
with the given level, version, and package
version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public ModelDefinition() throws SBMLConstructorException
ModelDefinition
with the given level, version, and package
version.
level
- the SBML Level.version
- the Version within the SBML Level.pkgVersion
- the version of the package.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public ModelDefinition(CompPkgNamespaces compns) throws SBMLConstructorException
ModelDefinition
with the given CompPkgNamespaces
object.
The package namespaces object used in this constructor is derived from a
SBMLNamespaces
object, which encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
package version and name information used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces
facilities is to create an
package namespace object somewhere in a program once, then hand that object
as needed to object constructors of that package that accept it as and
argument, such as this one.
compns
- the CompPkgNamespaces
object.
SBMLConstructorException
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public ModelDefinition(Model source) throws SBMLConstructorException
Model
object.
source
- the instance to copy.SBMLConstructorException
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 ModelDefinition.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 ModelDefinition.delete()
themselves.
public ModelDefinition cloneObject()
ModelDefinition
object.
cloneObject
 in class Model
ModelDefinition
object.public java.lang.String getElementName()
The only difference between a Model
and a ModelDefinition
is the
element name ('modelDefinition').
getElementName
 in class Model
ModelDefinition.getTypeCode()
public int getTypeCode()
LibSBML attaches an identifying code to every kind of SBML object. These
are integer constants known as SBML type codes. The names of all
the codes begin with the characters SBML_
.
In the Java language interface for libSBML, the
type codes are defined as static integer constants in the interface class
libsbmlConstants
. Note that different Level 3
package plug-ins may use overlapping type codes to identify the package
to which a given object belongs, call the
method on the object.
SBase.getPackageName()
getTypeCode
 in class Model
SBML_COMP_MODELDEFINITION
ModelDefinition.getElementName()
,
SBase.getPackageName()
public int removeFromParentAndDelete()
Model
's parent ListOfModelDefinitions
and removes itself from
it and deletes itself.
This method actually just calls the SBase
function, since the Model
class overrides it, but that's actually what we want to happen here.
removeFromParentAndDelete
 in class Model