public class CompartmentType extends SBase
SBML Level 2 Versions 2&ndash4 provide the compartment
type as a grouping construct that can be used to establish a
relationship between multiple Compartment
objects. A CompartmentType
object only has an identity, and this identity can only be used to
indicate that particular Compartment
objects in the model belong to this
type. This may be useful for conveying a modeling intention, such as
when a model contains many similar compartments, either by their
biological function or the reactions they carry. Without a compartment
type construct, it would be impossible within SBML itself to indicate
that all of the compartments share an underlying conceptual relationship
because each SBML compartment must be given a unique and separate
identity. Compartment
types have no mathematical meaning in
SBML&mdashthey have no effect on a model's mathematical interpretation.
Simulators and other numerical analysis software may ignore
CompartmentType
definitions and references to them in a model.
There is no mechanism in SBML Level 2 for representing hierarchies of
compartment types. One CompartmentType
instance cannot be the subtype
of another CompartmentType
instance SBML provides no means of defining
such relationships.
As with other major structures in SBML, CompartmentType
has a mandatory
attribute, 'id', used to give the compartment type an identifier. The
identifier must be a text string conforming to the identifer syntax
permitted in SBML. CompartmentType
also has an optional 'name'
attribute, of type string.
The 'id' and 'name' must be used
according to the guidelines described in the SBML specification (e.g.,
Section 3.3 in the Level 2 Version 4 specification).
CompartmentType
was introduced in SBML Level 2 Version 2. It is not
available in SBML Level 1 nor in Level 3.
Constructor and Description |
---|
CompartmentType(CompartmentType orig)
Copy constructor creates a copy of this
CompartmentType . |
CompartmentType(long level,
long version)
|
CompartmentType(SBMLNamespaces sbmlns)
|
Modifier and Type | Method and Description |
---|---|
CompartmentType |
cloneObject()
Creates and returns a deep copy of this
CompartmentType . |
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getElementName()
Returns the XML element name of this object, which for
CompartmentType , is always 'compartmentType'. |
java.lang.String |
getId()
Returns the value of the 'id' attribute of this
CompartmentType . |
java.lang.String |
getName()
Returns the value of the 'name' attribute of this
CompartmentType . |
int |
getTypeCode()
Returns the libSBML type code for this SBML object.
|
boolean |
hasRequiredAttributes()
Predicate returning
true if
all the required attributes for this CompartmentType object
have been set. |
boolean |
isSetId()
Predicate returning
true if this
CompartmentType 's 'id' attribute is set. |
boolean |
isSetName()
Predicate returning
true if this
CompartmentType 's 'name' attribute is set. |
int |
setId(java.lang.String sid)
Sets the value of the 'id' attribute of this
CompartmentType . |
int |
setName(java.lang.String name)
Sets the value of the 'name' attribute of this
CompartmentType . |
int |
unsetName()
Unsets the value of the 'name' attribute of this
CompartmentType . |
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getElementByMetaId, getElementBySId, 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, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetId, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm
public CompartmentType(CompartmentType orig) throws SBMLConstructorException
CompartmentType
.
orig
- the object to copy.
SBMLConstructorException
- Thrown if the argument orig
is null.
public CompartmentType(long level, long version) throws SBMLConstructorException
level
- a long integer, the SBML Level to assign to this
CompartmentType
version
- a long integer, the SBML Version to assign to this
CompartmentType
SBMLConstructorException
- Thrown if the given level
and version
combination, or this kind
of SBML object, are either invalid or mismatched with respect to the
parent SBMLDocument
object.
CompartmentType
object to an SBMLDocument
(e.g.,
using Model.addCompartmentType(CompartmentType c)
), the SBML
Level, SBML Version and XML namespace of the document override the
values used when creating the CompartmentType
object via the CompartmentType
constructors. This is necessary to ensure that an SBML document has a
consistent overall structure. Nevertheless, the ability to supply the
values at the time of creation of a CompartmentType
is an important aid to
producing valid SBML. Knowledge of the intented SBML Level and Version
determine whether it is valid to assign a particular value to an
attribute, or whether it is valid to add an object to an existing
SBMLDocument
.public CompartmentType(SBMLNamespaces sbmlns) throws SBMLConstructorException
CompartmentType
using the given SBMLNamespaces
object
sbmlns
.
The SBMLNamespaces
object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and (in
Level 3) packages used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces
facilities is to create an
SBMLNamespaces
object somewhere in a program once, then hand that object
as needed to object constructors that accept SBMLNamespaces
as arguments.
It is worth emphasizing that although this constructor does not take an
identifier argument, in SBML Level 2 and beyond, the 'id'
(identifier) attribute of a CompartmentType
is required to have a value.
Thus, callers are cautioned to assign a value after calling this
constructor. Setting the identifier can be accomplished using the
method setId(String id).
sbmlns
- an SBMLNamespaces
object.
SBMLConstructorException
- Thrown if the given level
and version
combination, or this kind
of SBML object, are either invalid or mismatched with respect to the
parent SBMLDocument
object.
CompartmentType
object to an SBMLDocument
(e.g.,
using Model.addCompartmentType(CompartmentType c)
), the SBML
Level, SBML Version and XML namespace of the document override the
values used when creating the CompartmentType
object via the CompartmentType
constructors. This is necessary to ensure that an SBML document has a
consistent overall structure. Nevertheless, the ability to supply the
values at the time of creation of a CompartmentType
is an important aid to
producing valid SBML. Knowledge of the intented SBML Level and Version
determine whether it is valid to assign a particular value to an
attribute, or whether it is valid to add an object to an existing
SBMLDocument
.public CompartmentType cloneObject()
CompartmentType
.
cloneObject
 in class SBase
CompartmentType
.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 CompartmentType.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 CompartmentType.delete()
themselves.
public java.lang.String getElementName()
CompartmentType
, is always 'compartmentType'.
getElementName
 in class SBase
'compartmentType'.
public java.lang.String getId()
CompartmentType
.
getId
 in class SBase
CompartmentType
.public java.lang.String getName()
CompartmentType
.
getName
 in class SBase
CompartmentType
.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 SBase
SBML_COMPARTMENT_TYPE
(default).
CompartmentType.getElementName()
,
SBase.getPackageName()
public boolean hasRequiredAttributes()
true
if
all the required attributes for this CompartmentType
object
have been set.
hasRequiredAttributes
 in class SBase
CompartmentType
object are:
public boolean isSetId()
true
if this
CompartmentType
's 'id' attribute is set.
isSetId
 in class SBase
true
if the 'id' attribute of this CompartmentType
is
set, false
otherwise.public boolean isSetName()
true
if this
CompartmentType
's 'name' attribute is set.
isSetName
 in class SBase
true
if the 'name' attribute of this CompartmentType
is
set, false
otherwise.public int setId(java.lang.String sid)
CompartmentType
.
The string sid
is copied.
SBML has strict requirements for the syntax of identifiers, that is, the
values of the 'id' attribute present on most types of SBML objects.
The following is a summary of the definition of the SBML identifier type
SId
, which defines the permitted syntax of identifiers. We
express the syntax using an extended form of BNF notation:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*The characters
(
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. In addition, there are a few
conditions for the uniqueness of identifiers in an SBML model. Please
consult the SBML specifications for the exact details of the uniqueness
requirements.
setId
 in class SBase
sid
- the string to use as the identifier of this CompartmentType
public int setName(java.lang.String name)
CompartmentType
.
The string in name
is copied.
setName
 in class SBase
name
- the new name for the CompartmentType
public int unsetName()
CompartmentType
.