public class Replacing extends SBaseRef
The Replacing
class does not exist officialy in the the Hierarchical Model Composition
(&ldquocomp&rdquo) package, but is implemented here as a convenience
subclass of the ReplacedElement
and ReplacedBy
classes, since both of
those classes define a 'submodelRef' attribute.
The required attribute 'submodelRef' takes a value of type
SIdRef, which must be the identifier of a Submodel
object in
the containing model. The model referenced by the
Submodel
object establishes the object namespaces for the
'portRef', 'idRef', 'unitRef' and 'metaIdRef'
attributes: only objects within the Model
object may be referenced by
those attributes.
Modifier and Type | Method and Description |
---|---|
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getSubmodelRef()
Returns the value of the 'submodelRef' attribute of this
SBaseRef . |
boolean |
hasRequiredAttributes()
Returns true if getNumReferents() is exactly 1 and if the submodelRef is set.
|
boolean |
isSetSubmodelRef()
Predicate returning
true or false depending on whether this
SBaseRef 's 'submodelRef' attribute has been set. |
int |
performReplacement()
DEPRECATED FUNCTION: DO NOT USE
|
void |
renameSIdRefs(java.lang.String oldid,
java.lang.String newid)
Replaces all uses of a given
SIdRef type attribute value with another
value. |
int |
saveReferencedElement()
Finds and stores the referenced object.
|
int |
setSubmodelRef(java.lang.String id)
Sets the value of the 'submodelRef' attribute of this
SBaseRef . |
int |
unsetSubmodelRef()
Unsets the value of the 'SubmodelRef' attribute of this
SBaseRef . |
clearReferencedElement, cloneObject, connectToChild, createSBaseRef, getElementByMetaId, getElementBySId, getElementName, getIdRef, getMetaIdRef, getNumReferents, getPortRef, getReferencedElement, getReferencedElementFrom, getSBaseRef, getTypeCode, getUnitRef, isSetIdRef, isSetMetaIdRef, isSetPortRef, isSetSBaseRef, isSetUnitRef, performDeletion, removeFromParentAndDelete, setIdRef, setMetaIdRef, setPortRef, setSBaseRef, setUnitRef, unsetIdRef, unsetMetaIdRef, unsetPortRef, unsetSBaseRef, unsetUnitRef
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetId, unsetMetaId, unsetModelHistory, unsetName, unsetNotes, unsetSBOTerm, unsetUserData
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 Replacing.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 Replacing.delete()
themselves.
public java.lang.String getSubmodelRef()
SBaseRef
.
SBaseRef
.public boolean isSetSubmodelRef()
true
or false
depending on whether this
SBaseRef
's 'submodelRef' attribute has been set.
true
if this SBaseRef
's 'submodelRef' attribute has been set,
otherwise false
is returned.public int setSubmodelRef(java.lang.String id)
SBaseRef
. Fails
if the id is not a valid syntax for an SIdRef.
public int unsetSubmodelRef()
SBaseRef
.
public boolean hasRequiredAttributes()
hasRequiredAttributes
 in class SBaseRef
public int saveReferencedElement()
Submodel
to which
it refers, getting the instantiated Model
inside that Submodel
, calling
'getReferencedElementFrom' on that model, and storing the result.
saveReferencedElement
 in class SBaseRef
public void renameSIdRefs(java.lang.String oldid, java.lang.String newid)
Replaces all uses of a given SIdRef
type attribute value with another
value.
In SBML, object identifiers are of a data type called SId
.
In SBML Level 3, an explicit data type called SIdRef
was
introduced for attribute values that refer to SId
values in
previous Levels of SBML, this data type did not exist and attributes were
simply described to as 'referring to an identifier', but the effective
data type was the same as SIdRef
in Level 3. These and
other methods of libSBML refer to the type SIdRef
for all
Levels of SBML, even if the corresponding SBML specification did not
explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of oldid
. If any matches are found, the
matching values are replaced with newid
. The method does not
descend into child elements.
renameSIdRefs
 in class SBaseRef
oldid
- the old identifiernewid
- the new identifierpublic int performReplacement()
To retain old functionality, this function calls performReplacementAndCollect, and then actually removes the now-redundant element. However, this can lead to doubly-deleted elements, as well as the incorrect interpretation of some models. The replacement function performReplacementAndCollect has been marked protected, in the hopes that people will instead simply use CompModelPlugin.instantiateSubmodels, which hides all the complexity while still allowing access to a non-flattened version of a hierarchical model.