public class Replacing extends SBaseRef
The Replacing
class does not exist officialy in the the
'Hierarchical Model Composition' package
(&ldquocomp&rdquo), 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)
Renames all the SIdRef attributes on this element if they match
oldid , but not any found in child or plugin elements. |
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, 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
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, unsetId, unsetMetaId, unsetModelHistory, unsetName, unsetNotes, unsetSBOTerm
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 hasRequiredAttributes()
hasRequiredAttributes
 in class 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 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.
public void renameSIdRefs(java.lang.String oldid, java.lang.String newid)
oldid
, but not any found in child or plugin elements.renameSIdRefs
 in class SBaseRef
oldid
- the old identifiernewid
- the new identifierpublic 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 int setSubmodelRef(java.lang.String id)
SBaseRef
. Fails
if the id is not a valid syntax for an SIdRef.
public int unsetSubmodelRef()
SBaseRef
.