public class Deletion extends SBaseRef
The Deletion
class was introduced by the SBML Level 3
'Hierarchical Model Composition' package
(&ldquocomp&rdquo) to allow elements of submodels to be removed before
instantiation.
The Deletion
object class is used to define a deletion operation
to be applied when a submodel instantiates a model definition.
Deletions may be useful in hierarchical model composition scenarios for
various reasons. For example, some components in a submodel may be
redundant in the composed model, perhaps because the same features are
implemented in a different way in the new model.
Deletions function as follows. When the Model
to which the Submodel
object refers (via the 'modelRef' attribute) is read and processed for
inclusion into the composed model, each Deletion
object identifies an
object to remove from that Model
instance. The resulting submodel
instance consists of everything in the Model
object instance minus the
entities referenced by the list of Deletion
objects.
As might be expected, deletions can have wide-ranging implications, especially when the object deleted has substantial substructure, as in the case of reactions. The following are rules regarding deletions and their effects.
SBaseRef
object.
The Deletion
object class is subclassed from SBaseRef
, and reuses all the
machinery provided by SBaseRef
. In addition, it defines two optional
attributes, 'id' and 'name'. The 'id' attribute can be used to give an
identifier to a given deletion operation. The identifier has no
mathematical meaning, but it may be useful for creating submodels that
can be manipulated more directly by other submodels. (Indeed, it is
legitimate for an enclosing model definition to delete a deletion!)
The optional 'name' attribute is provided on Deletion
for the
same reason it is provided on other elements that have identifiers
viz., to provide for the possibility of giving a human-readable name to
the object. The name may be useful in situations when deletions are
displayed to modelers.
Constructor and Description |
---|
Deletion()
Creates a new
Deletion with the given level, version, and package version. |
Deletion(CompPkgNamespaces compns)
Creates a new
Deletion with the given CompPkgNamespaces object. |
Deletion(Deletion source)
Copy constructor.
|
Deletion(long level)
Creates a new
Deletion with the given level, version, and package version. |
Deletion(long level,
long version)
Creates a new
Deletion with the given level, version, and package version. |
Deletion(long level,
long version,
long pkgVersion)
Creates a new
Deletion with the given level, version, and package version. |
Modifier and Type | Method and Description |
---|---|
SBase |
cloneObject()
Creates and returns a deep copy of this
Deletion object. |
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getElementName()
Returns the XML element name of this SBML object.
|
java.lang.String |
getId()
Returns the value of the 'id' attribute of this
Deletion . |
java.lang.String |
getName()
Returns the value of the 'name' attribute of this
Deletion . |
int |
getTypeCode()
Returns the libSBML type code of this object instance.
|
boolean |
isSetId()
Predicate returning
true or false depending on whether this
object's 'id' attribute has been set. |
boolean |
isSetName()
Predicate returning
true or false depending on whether this
object's 'name' attribute has been set. |
int |
saveReferencedElement()
Finds and stores the referenced object.
|
int |
setId(java.lang.String id)
Sets the value of the 'id' attribute of this
Deletion . |
int |
setName(java.lang.String name)
Sets the value of the 'name' attribute of this
Deletion . |
int |
unsetId()
Unsets the value of the 'id' attribute of this
Deletion . |
int |
unsetName()
Unsets the value of the 'name' attribute of this
Deletion . |
clearReferencedElement, createSBaseRef, getElementByMetaId, getElementBySId, getIdRef, getMetaIdRef, getNumReferents, getPortRef, getReferencedElement, getReferencedElementFrom, getSBaseRef, getUnitRef, hasRequiredAttributes, isSetIdRef, isSetMetaIdRef, isSetPortRef, isSetSBaseRef, isSetUnitRef, performDeletion, removeFromParentAndDelete, renameSIdRefs, setIdRef, setMetaIdRef, setPortRef, setSBaseRef, setUnitRef, unsetIdRef, unsetMetaIdRef, unsetPortRef, unsetSBaseRef, unsetUnitRef
getPackageName, getPackageURI, getPackageVersion, getParentModel
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, 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, 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, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm
public Deletion() throws SBMLConstructorException
Deletion
with the given level, version, and package version.
level
- the SBML Levelversion
- the Version within the SBML LevelpkgVersion
- the version of the packageSBMLConstructorException
public Deletion(CompPkgNamespaces compns) throws SBMLConstructorException
Deletion
with the given CompPkgNamespaces
object.SBMLConstructorException
public Deletion(Deletion source) throws SBMLConstructorException
SBMLConstructorException
public Deletion(long level) throws SBMLConstructorException
Deletion
with the given level, version, and package version.
level
- the SBML Levelversion
- the Version within the SBML LevelpkgVersion
- the version of the packageSBMLConstructorException
public Deletion(long level, long version) throws SBMLConstructorException
Deletion
with the given level, version, and package version.
level
- the SBML Levelversion
- the Version within the SBML LevelpkgVersion
- the version of the packageSBMLConstructorException
public Deletion(long level, long version, long pkgVersion) throws SBMLConstructorException
Deletion
with the given level, version, and package version.
level
- the SBML Levelversion
- the Version within the SBML LevelpkgVersion
- the version of the packageSBMLConstructorException
public SBase cloneObject()
Deletion
object.
cloneObject
 in class SBaseRef
Deletion
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 Deletion.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 Deletion.delete()
themselves.
public java.lang.String getElementName()
getElementName
 in class SBaseRef
public java.lang.String getId()
Deletion
.
public java.lang.String getName()
Deletion
.
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 SBaseRef
SBML_COMP_DELETION
Deletion.getElementName()
,
CompBase.getPackageName()
public boolean isSetId()
true
or false
depending on whether this
object's 'id' attribute has been set.
Some words of explanation about the
set
/unset
/isSet
methods:
The SBML specifications define certain attributes on some classes of
objects as being optional. This requires an application to be careful
about the distinction between two cases when reading a model: (1) a given
attribute has never been set to a value, and therefore should be
assumed to have the SBML-defined default value if one exists, and (2) a
given attribute has been set to a value, but the value happens to be an
empty string. The situation can be ambiguous when reading a model from a
file or data stream and then examining the data objects that libSBML
constructs as a result. LibSBML supports these distinctions by providing
methods to set, unset, and query the status of attributes that are
optional. The methods have names of the form set
Attribute(...)
,
unset
Attribute()
, and
isSet
Attribute()
, where Attribute is the the name of the optional
attribute in question.
public boolean isSetName()
true
or false
depending on whether this
object's 'name' attribute has been set.
Some words of explanation about the
set
/unset
/isSet
methods:
The SBML specifications define certain attributes on some classes of
objects as being optional. This requires an application to be careful
about the distinction between two cases when reading a model: (1) a given
attribute has never been set to a value, and therefore should be
assumed to have the SBML-defined default value if one exists, and (2) a
given attribute has been set to a value, but the value happens to be an
empty string. The situation can be ambiguous when reading a model from a
file or data stream and then examining the data objects that libSBML
constructs as a result. LibSBML supports these distinctions by providing
methods to set, unset, and query the status of attributes that are
optional. The methods have names of the form set
Attribute(...)
,
unset
Attribute()
, and
isSet
Attribute()
, where Attribute is the the name of the optional
attribute in question.
public int saveReferencedElement()
Submodel
parent,
gets its instantiated Model
object, calls
'getReferencedElementFrom' on that model, and stores the result.
saveReferencedElement
 in class SBaseRef
public int setId(java.lang.String id)
Deletion
.
This method fails if the id
is not a valid syntax for an SId.
public int setName(java.lang.String name)
Deletion
.
The string in name
is copied.
public int unsetId()
Deletion
.