public class ModelDefinition extends Model
The 'Hierarchical Model Composition'
package (&ldquocomp&rdquo) 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()
The only difference between a
Model and a ModelDefinition is the
element name ('modelDefinition') |
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, createAlgebraicRule, createAssignmentRule, createCompartment, createCompartmentType, createConstraint, createDelay, createEvent, createEventAssignment, createFunctionDefinition, createInitialAssignment, createKineticLaw, createKineticLawLocalParameter, createKineticLawParameter, createModifier, createParameter, createProduct, createRateRule, createReactant, createReaction, createSpecies, createSpeciesType, createTrigger, createUnit, createUnitDefinition, 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, isPopulatedListFormulaUnitsData, isSetAreaUnits, isSetConversionFactor, isSetExtentUnits, isSetId, isSetLengthUnits, isSetName, isSetSubstanceUnits, isSetTimeUnits, isSetVolumeUnits, populateListFormulaUnitsData, removeCompartment, removeCompartment, removeCompartmentType, removeCompartmentType, removeConstraint, removeEvent, removeEvent, removeFunctionDefinition, removeFunctionDefinition, removeInitialAssignment, removeInitialAssignment, removeParameter, removeParameter, removeReaction, removeReaction, removeRule, removeRule, 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, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isSetAnnotation, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm
public ModelDefinition() throws SBMLConstructorException
ModelDefinition
with the given level, version, and package
version.
level
- the SBML Levelversion
- the Version within the SBML LevelpkgVersion
- the version of the packageSBMLConstructorException
public ModelDefinition(CompPkgNamespaces compns) throws SBMLConstructorException
ModelDefinition
with the given CompPkgNamespaces
object.
compns
- the namespace to useSBMLConstructorException
public ModelDefinition(long level) throws SBMLConstructorException
ModelDefinition
with the given level, version, and package
version.
level
- the SBML Levelversion
- the Version within the SBML LevelpkgVersion
- the version of the packageSBMLConstructorException
public ModelDefinition(long level, long version) throws SBMLConstructorException
ModelDefinition
with the given level, version, and package
version.
level
- the SBML Levelversion
- the Version within the SBML LevelpkgVersion
- the version of the packageSBMLConstructorException
public ModelDefinition(long level, long version, long pkgVersion) throws SBMLConstructorException
ModelDefinition
with the given level, version, and package
version.
level
- the SBML Levelversion
- the Version within the SBML LevelpkgVersion
- the version of the packageSBMLConstructorException
public ModelDefinition(Model source) throws SBMLConstructorException
Model
object.SBMLConstructorException
public ModelDefinition cloneObject()
ModelDefinition
object.
cloneObject
 in class Model
ModelDefinition
objectpublic 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 java.lang.String getElementName()
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 &ldquoSBML_
&rdquo.
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 getPackageName()
method on the object.
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