public class Port extends SBaseRef
The Port class was introduced by the SBML Level 3
'Hierarchical Model Composition' package
(&ldquocomp&rdquo) to allow a Model to define a standard interface
between it and other models that might use it as a submodel. It derives
from the SBaseRef class, and the elements defined there refer to elements
in the same parent Model as the Port object. A Port object instance
therefore uses those attributes to define a port for a component in a
model. When other SBaseRef or SBaseRef-derived classes refer to a Port
object using a 'portRef' attribute, the element being referenced is the
element the Port object itself points to.
In the present formulation of the Hierarchical Model Composition package, the use of ports is not enforced, nor is there any mechanism to restrict which ports may be used in what ways&mdashthey are only an advisory construct. Future versions of this SBML package may provide additional functionality to support explicit restrictions on port use. For the present definition of Hierarchical Model Composition, users of models containing ports are encouraged to respect the modeler's intention in defining ports, and use the port definitions to interact with components through their ports (when they have ports defined) rather than interact directly with the components.
The required attribute 'id' is used to give an identifier to a
Port object so that other objects can refer to it. The attribute has
type PortSId and is essentially identical to the SBML
primitive type SId, except that its namespace is limited to
the identifiers of Port objects defined within a Model object. In
parallel, the PortSId type has a companion type,
PortSIdRef, that corresponds to the SBML primitive type
SIdRef the value space of PortSIdRef is limited
to PortSId values.
| Constructor and Description |
|---|
Port()
Creates a new
Port with the given level, version, and package version. |
Port(CompPkgNamespaces compns)
Creates a new
Port with the given CompPkgNamespaces object. |
Port(long level)
Creates a new
Port with the given level, version, and package version. |
Port(long level,
long version)
Creates a new
Port with the given level, version, and package version. |
Port(long level,
long version,
long pkgVersion)
Creates a new
Port with the given level, version, and package version. |
Port(Port source)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
SBase |
cloneObject()
Creates and returns a deep copy of this
Port 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
Port. |
java.lang.String |
getName()
Returns the value of the 'name' attribute of this
Port. |
int |
getTypeCode()
Returns the libSBML type code of this object instance.
|
boolean |
hasRequiredAttributes()
Returns true if the 'id' attribute is set, and if exactly one of
the optional attributes of
SBaseRef (portRef, idRef, metaIdRef,
and unitRef)are set. |
boolean |
isSetId()
|
boolean |
isSetName()
|
void |
renameMetaIdRefs(java.lang.String oldid,
java.lang.String newid)
Renames the metaIdRef attribute on this element if the oldid matches.
|
void |
renameSIdRefs(java.lang.String oldid,
java.lang.String newid)
Renames the idRef attribute on this element if the oldid matches.
|
void |
renameUnitSIdRefs(java.lang.String oldid,
java.lang.String newid)
Renames the unitRef attribute on this element if the oldid matches.
|
int |
saveReferencedElement()
Finds and stores the referenced object by finding its
Model parent,
calling 'getReferencedElementFrom()' on that model, and storing the
result. |
int |
setId(java.lang.String id)
Sets the value of the 'id' attribute of this
Port. |
int |
setName(java.lang.String name)
Sets the value of the 'name' attribute of this
Port. |
int |
setPortRef(java.lang.String id)
Overrides SBaseRef.setPortRef to always fail, because
Port objects
themselves cannot refer to model elements by PortSId. |
int |
unsetId()
Unsets the value of the 'id' attribute of this
Port. |
int |
unsetName()
Unsets the value of the 'name' attribute of this
Port. |
clearReferencedElement, createSBaseRef, getElementByMetaId, getElementBySId, getIdRef, getMetaIdRef, getNumReferents, getPortRef, getReferencedElement, getReferencedElementFrom, getSBaseRef, getUnitRef, isSetIdRef, isSetMetaIdRef, isSetPortRef, isSetSBaseRef, isSetUnitRef, performDeletion, removeFromParentAndDelete, setIdRef, setMetaIdRef, setSBaseRef, setUnitRef, unsetIdRef, unsetMetaIdRef, unsetPortRef, unsetSBaseRef, unsetUnitRefgetPackageName, getPackageURI, getPackageVersion, getParentModeladdCVTerm, 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, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTermpublic Port() throws SBMLConstructorException
Port with the given level, version, and package version.
level - the SBML Levelversion - the Version within the SBML LevelpkgVersion - the version of the packageSBMLConstructorExceptionpublic Port(CompPkgNamespaces compns) throws SBMLConstructorException
Port with the given CompPkgNamespaces object.
compns - the namespace to useSBMLConstructorExceptionpublic Port(long level) throws SBMLConstructorException
Port with the given level, version, and package version.
level - the SBML Levelversion - the Version within the SBML LevelpkgVersion - the version of the packageSBMLConstructorExceptionpublic Port(long level, long version) throws SBMLConstructorException
Port with the given level, version, and package version.
level - the SBML Levelversion - the Version within the SBML LevelpkgVersion - the version of the packageSBMLConstructorExceptionpublic Port(long level, long version, long pkgVersion) throws SBMLConstructorException
Port with the given level, version, and package version.
level - the SBML Levelversion - the Version within the SBML LevelpkgVersion - the version of the packageSBMLConstructorExceptionpublic Port(Port source) throws SBMLConstructorException
SBMLConstructorExceptionpublic SBase cloneObject()
Port object.
cloneObject in class SBaseRefPort 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 Port.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 Port.delete() themselves.
public java.lang.String getElementName()
getElementName in class SBaseRefpublic java.lang.String getName()
Port.
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 SBaseRefSBML_COMP_PORT
Port.getElementName(),
CompBase.getPackageName()public boolean hasRequiredAttributes()
SBaseRef (portRef, idRef, metaIdRef,
and unitRef)are set.
hasRequiredAttributes in class SBaseRefpublic boolean isSetId()
public boolean isSetName()
public void renameMetaIdRefs(java.lang.String oldid, java.lang.String newid)
renameMetaIdRefs in class SBaseoldid - the old identifiernewid - the new identifierpublic void renameSIdRefs(java.lang.String oldid, java.lang.String newid)
renameSIdRefs in class SBaseRefoldid - the old identifiernewid - the new identifierpublic void renameUnitSIdRefs(java.lang.String oldid, java.lang.String newid)
renameUnitSIdRefs in class SBaseoldid - the old identifiernewid - the new identifierpublic int saveReferencedElement()
Model parent,
calling 'getReferencedElementFrom()' on that model, and storing the
result.
saveReferencedElement in class SBaseRefpublic int setId(java.lang.String id)
Port.
This method fails if the id is not a valid syntax for an SId.
public int setName(java.lang.String name)
Port.
public int setPortRef(java.lang.String id)
Port objects
themselves cannot refer to model elements by PortSId.
setPortRef in class SBaseRefid - the identifier to set for the port reference
public int unsetId()
Port.