libSBML C# API  libSBML 5.13.0 C# API
libsbmlcs.SBMLNamespaces Class Reference
Inheritance diagram for libsbmlcs.SBMLNamespaces:
[legend]

Detailed Description

{core}

Set of SBML Level + Version + namespace triples.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.

There are differences in the definitions of components between different SBML Levels, as well as Versions within Levels. For example, the 'sboTerm' attribute was not introduced until Level 2 Version 2, and then only on certain component classes; the SBML Level 2 Version 3 specification moved the 'sboTerm' attribute to the SBase class, thereby allowing nearly all components to have SBO annotations. As a result of differences such as those, libSBML needs to track the SBML Level and Version of every object created.

The purpose of the SBMLNamespaces object class is to make it easier to communicate SBML Level and Version data between libSBML constructors and other methods. The SBMLNamespaces object class tracks 3-tuples (triples) consisting of SBML Level, Version, and the corresponding SBML XML namespace.

The plural name (SBMLNamespaces) is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model and therefore may have multiple namespaces associated with them; however, until the introduction of SBML Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

Public Member Functions

int addNamespace (string uri, string prefix)
 Add an XML namespace (a pair of URI and prefix) to the set of namespaces within this SBMLNamespaces object. More...
 
int addNamespaces (XMLNamespaces xmlns)
 Add the given XML namespaces list to the set of namespaces within this SBMLNamespaces object. More...
 
int addPackageNamespace (string pkgName, long pkgVersion, string prefix)
 Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object. More...
 
int addPackageNamespace (string pkgName, long pkgVersion)
 Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object. More...
 
int addPackageNamespaces (XMLNamespaces xmlns)
 Add the XML namespaces of package extensions in the given XMLNamespace object to the set of namespaces within this SBMLNamespaces object (Non-package XML namespaces are not added by this function). More...
 
int addPkgNamespace (string pkgName, long pkgVersion, string prefix)
 
int addPkgNamespace (string pkgName, long pkgVersion)
 
int addPkgNamespaces (XMLNamespaces xmlns)
 
new SBMLNamespaces clone ()
 Creates and returns a deep copy of this SBMLNamespaces object. More...
 
virtual void Dispose ()
 
override bool Equals (Object sb)
 
override int GetHashCode ()
 
long getLevel ()
 Get the SBML Level of this SBMLNamespaces object. More...
 
XMLNamespaces getNamespaces ()
 Get the XML namespaces list for this SBMLNamespaces object. More...
 
new string getPackageName ()
 Returns the name of the main package for this namespace. More...
 
new string getURI ()
 Returns a string representing the SBML XML namespace of this object. More...
 
long getVersion ()
 Get the SBML Version of this SBMLNamespaces object. More...
 
bool isValidCombination ()
 Predicate returning true if the given set of namespaces represent a valid set. More...
 
int removeNamespace (string uri)
 Removes an XML namespace from the set of namespaces within this SBMLNamespaces object. More...
 
int removePackageNamespace (long level, long version, string pkgName, long pkgVersion)
 Removes an XML namespace of a package extension from the set of namespaces within this SBMLNamespaces object. More...
 
int removePkgNamespace (long level, long version, string pkgName, long pkgVersion)
 
 SBMLNamespaces (long level, long version)
 Creates a new SBMLNamespaces object corresponding to the given SBML level and version. More...
 
 SBMLNamespaces (long level)
 Creates a new SBMLNamespaces object corresponding to the given SBML level and version. More...
 
 SBMLNamespaces ()
 Creates a new SBMLNamespaces object corresponding to the given SBML level and version. More...
 
 SBMLNamespaces (long level, long version, string pkgName, long pkgVersion, string pkgPrefix)
 (For extensions) Creates a new SBMLNamespaces object corresponding to the combination of (1) the given SBML level and version, and (2) the given package with the package version. More...
 
 SBMLNamespaces (long level, long version, string pkgName, long pkgVersion)
 (For extensions) Creates a new SBMLNamespaces object corresponding to the combination of (1) the given SBML level and version, and (2) the given package with the package version. More...
 
 SBMLNamespaces (SBMLNamespaces orig)
 Copy constructor; creates a copy of a SBMLNamespaces. More...
 

Static Public Member Functions

static void freeSBMLNamespaces (SWIGTYPE_p_List supportedNS)
 Frees the list of supported namespaces as generated by getSupportedNamespaces(). More...
 
static string getSBMLNamespaceURI (long level, long version)
 Returns a string representing the SBML XML namespace for the given level and version of SBML. More...
 
static SBMLNamespacesList getSupportedNamespaces ()
 Returns a list of all supported SBMLNamespaces in this version of libsbml. More...
 
static bool isSBMLNamespace (string uri)
 Predicate returning true if the given URL is one of SBML XML namespaces. More...
 
static bool operator!= (SBMLNamespaces lhs, SBMLNamespaces rhs)
 
static bool operator== (SBMLNamespaces lhs, SBMLNamespaces rhs)
 

Protected Attributes

bool swigCMemOwn
 

Constructor & Destructor Documentation

§ SBMLNamespaces() [1/6]

libsbmlcs.SBMLNamespaces.SBMLNamespaces ( long  level,
long  version 
)

Creates a new SBMLNamespaces object corresponding to the given SBML level and version.

SBMLNamespaces objects are used in libSBML to communicate SBML Level and Version data between constructors and other methods. The SBMLNamespaces object class holds triples consisting of SBML Level, Version, and the corresponding SBML XML namespace. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

The plural name (SBMLNamespaces) is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model and therefore may have multiple namespaces associated with them. In SBML Levels below Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

Parameters
levelthe SBML level
versionthe SBML version
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ SBMLNamespaces() [2/6]

libsbmlcs.SBMLNamespaces.SBMLNamespaces ( long  level)

Creates a new SBMLNamespaces object corresponding to the given SBML level and version.

SBMLNamespaces objects are used in libSBML to communicate SBML Level and Version data between constructors and other methods. The SBMLNamespaces object class holds triples consisting of SBML Level, Version, and the corresponding SBML XML namespace. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

The plural name (SBMLNamespaces) is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model and therefore may have multiple namespaces associated with them. In SBML Levels below Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

Parameters
levelthe SBML level
versionthe SBML version
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ SBMLNamespaces() [3/6]

libsbmlcs.SBMLNamespaces.SBMLNamespaces ( )

Creates a new SBMLNamespaces object corresponding to the given SBML level and version.

SBMLNamespaces objects are used in libSBML to communicate SBML Level and Version data between constructors and other methods. The SBMLNamespaces object class holds triples consisting of SBML Level, Version, and the corresponding SBML XML namespace. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

The plural name (SBMLNamespaces) is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model and therefore may have multiple namespaces associated with them. In SBML Levels below Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

Parameters
levelthe SBML level
versionthe SBML version
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ SBMLNamespaces() [4/6]

libsbmlcs.SBMLNamespaces.SBMLNamespaces ( long  level,
long  version,
string  pkgName,
long  pkgVersion,
string  pkgPrefix 
)

(For extensions) Creates a new SBMLNamespaces object corresponding to the combination of (1) the given SBML level and version, and (2) the given package with the package version.

SBMLNamespaces objects are used in libSBML to communicate SBML Level and Version data between constructors and other methods. The SBMLNamespaces object class holds triples consisting of SBML Level, Version, and the corresponding SBML XML namespace. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

The plural name (SBMLNamespaces) is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model and therefore may have multiple namespaces associated with them. In SBML Levels below Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

Parameters
levelthe SBML Level
versionthe SBML Version
pkgNamethe string of package name (e.g. 'layout', 'multi')
pkgVersionthe package version
pkgPrefixthe prefix of the package namespace (e.g. 'layout', 'multi') to be added. The package's name will be used if the given string is empty (default).
Exceptions
SBMLExtensionExceptionif the extension module that supports the combination of the given SBML Level, SBML Version, package name, and package version has not been registered with libSBML.

§ SBMLNamespaces() [5/6]

libsbmlcs.SBMLNamespaces.SBMLNamespaces ( long  level,
long  version,
string  pkgName,
long  pkgVersion 
)

(For extensions) Creates a new SBMLNamespaces object corresponding to the combination of (1) the given SBML level and version, and (2) the given package with the package version.

SBMLNamespaces objects are used in libSBML to communicate SBML Level and Version data between constructors and other methods. The SBMLNamespaces object class holds triples consisting of SBML Level, Version, and the corresponding SBML XML namespace. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

The plural name (SBMLNamespaces) is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model and therefore may have multiple namespaces associated with them. In SBML Levels below Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

Parameters
levelthe SBML Level
versionthe SBML Version
pkgNamethe string of package name (e.g. 'layout', 'multi')
pkgVersionthe package version
pkgPrefixthe prefix of the package namespace (e.g. 'layout', 'multi') to be added. The package's name will be used if the given string is empty (default).
Exceptions
SBMLExtensionExceptionif the extension module that supports the combination of the given SBML Level, SBML Version, package name, and package version has not been registered with libSBML.

§ SBMLNamespaces() [6/6]

libsbmlcs.SBMLNamespaces.SBMLNamespaces ( SBMLNamespaces  orig)

Copy constructor; creates a copy of a SBMLNamespaces.

Parameters
origthe SBMLNamespaces instance to copy.

Member Function Documentation

§ addNamespace()

int libsbmlcs.SBMLNamespaces.addNamespace ( string  uri,
string  prefix 
)

Add an XML namespace (a pair of URI and prefix) to the set of namespaces within this SBMLNamespaces object.

Parameters
urithe XML namespace to be added.
prefixthe prefix of the namespace to be added.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:

§ addNamespaces()

int libsbmlcs.SBMLNamespaces.addNamespaces ( XMLNamespaces  xmlns)

Add the given XML namespaces list to the set of namespaces within this SBMLNamespaces object.

The following code gives an example of how one could add the XHTML namespace to the list of namespaces recorded by the top-level <sbml> element of a model. It gives the new namespace a prefix of html.

SBMLDocument sd = null;
try
{
sd = new SBMLDocument(3, 1);
}
catch (SBMLConstructorException e)
{
// Here, have code to handle a truly exceptional situation.
// Candidate causes include invalid combinations of SBML
// Level and Version (impossible if hardwired as given here),
// running out of memory, and unknown system exceptions.
}
XMLNamespaces sn = sd.getNamespaces();
if (sn != null)
{
sn.add('http://www.w3.org/1999/xhtml', 'html');
}
else
{
// Handle another truly exceptional situation.
}
Parameters
xmlnsthe XML namespaces to be added.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:

§ addPackageNamespace() [1/2]

int libsbmlcs.SBMLNamespaces.addPackageNamespace ( string  pkgName,
long  pkgVersion,
string  prefix 
)

Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object.

The SBML Level and SBML Version of this object is used.

Parameters
pkgNamethe string of package name (e.g. 'layout', 'multi')
pkgVersionthe package version
prefixthe prefix of the package namespace to be added. The package's name will be used if the given string is empty (default).
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
An XML namespace of a non-registered package extension can't be added by this function (LIBSBML_INVALID_ATTRIBUTE_VALUE will be returned).
See also
addNamespace()

§ addPackageNamespace() [2/2]

int libsbmlcs.SBMLNamespaces.addPackageNamespace ( string  pkgName,
long  pkgVersion 
)

Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object.

The SBML Level and SBML Version of this object is used.

Parameters
pkgNamethe string of package name (e.g. 'layout', 'multi')
pkgVersionthe package version
prefixthe prefix of the package namespace to be added. The package's name will be used if the given string is empty (default).
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
An XML namespace of a non-registered package extension can't be added by this function (LIBSBML_INVALID_ATTRIBUTE_VALUE will be returned).
See also
addNamespace()

§ addPackageNamespaces()

int libsbmlcs.SBMLNamespaces.addPackageNamespaces ( XMLNamespaces  xmlns)

Add the XML namespaces of package extensions in the given XMLNamespace object to the set of namespaces within this SBMLNamespaces object (Non-package XML namespaces are not added by this function).

Parameters
xmlnsthe XML namespaces to be added.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
XML namespaces of a non-registered package extensions are not added (just ignored) by this function. LIBSBML_INVALID_ATTRIBUTE_VALUE will be returned if the given xmlns is null.

§ addPkgNamespace() [1/2]

int libsbmlcs.SBMLNamespaces.addPkgNamespace ( string  pkgName,
long  pkgVersion,
string  prefix 
)

§ addPkgNamespace() [2/2]

int libsbmlcs.SBMLNamespaces.addPkgNamespace ( string  pkgName,
long  pkgVersion 
)

§ addPkgNamespaces()

int libsbmlcs.SBMLNamespaces.addPkgNamespaces ( XMLNamespaces  xmlns)

§ clone()

new SBMLNamespaces libsbmlcs.SBMLNamespaces.clone ( )

Creates and returns a deep copy of this SBMLNamespaces object.

Returns
the (deep) copy of this SBMLNamespaces object.

§ Dispose()

virtual void libsbmlcs.SBMLNamespaces.Dispose ( )
virtual

§ Equals()

override bool libsbmlcs.SBMLNamespaces.Equals ( Object  sb)

§ freeSBMLNamespaces()

static void libsbmlcs.SBMLNamespaces.freeSBMLNamespaces ( SWIGTYPE_p_List  supportedNS)
static

Frees the list of supported namespaces as generated by getSupportedNamespaces().

Parameters
supportedNSthe list to be freed.

§ GetHashCode()

override int libsbmlcs.SBMLNamespaces.GetHashCode ( )

§ getLevel()

long libsbmlcs.SBMLNamespaces.getLevel ( )

Get the SBML Level of this SBMLNamespaces object.

Returns
the SBML Level of this SBMLNamespaces object.

§ getNamespaces()

XMLNamespaces libsbmlcs.SBMLNamespaces.getNamespaces ( )

Get the XML namespaces list for this SBMLNamespaces object.

SBMLNamespaces objects are used in libSBML to communicate SBML Level and Version data between constructors and other methods. The SBMLNamespaces object class holds triples consisting of SBML Level, Version, and the corresponding SBML XML namespace. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

The plural name (SBMLNamespaces) is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model and therefore may have multiple namespaces associated with them. In SBML Levels below Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.

Returns
the XML namespaces of this SBMLNamespaces object.

§ getPackageName()

new string libsbmlcs.SBMLNamespaces.getPackageName ( )

Returns the name of the main package for this namespace.

Returns
the name of the main package for this namespace. 'core' will be returned if this namespace is defined in the SBML core.

§ getSBMLNamespaceURI()

static string libsbmlcs.SBMLNamespaces.getSBMLNamespaceURI ( long  level,
long  version 
)
static

Returns a string representing the SBML XML namespace for the given level and version of SBML.

Parameters
levelthe SBML level
versionthe SBML version
Returns
a string representing the SBML namespace that reflects the SBML Level and Version specified.

§ getSupportedNamespaces()

static SBMLNamespacesList libsbmlcs.SBMLNamespaces.getSupportedNamespaces ( )
static

Returns a list of all supported SBMLNamespaces in this version of libsbml.

Returns
a list with supported SBML namespaces.

§ getURI()

new string libsbmlcs.SBMLNamespaces.getURI ( )

Returns a string representing the SBML XML namespace of this object.

Returns
a string representing the SBML namespace that reflects the SBML Level and Version of this object.

§ getVersion()

long libsbmlcs.SBMLNamespaces.getVersion ( )

Get the SBML Version of this SBMLNamespaces object.

Returns
the SBML Version of this SBMLNamespaces object.

§ isSBMLNamespace()

static bool libsbmlcs.SBMLNamespaces.isSBMLNamespace ( string  uri)
static

Predicate returning true if the given URL is one of SBML XML namespaces.

Parameters
urithe URI of namespace
Returns
true if the 'uri' is one of SBML namespaces, false otherwise.

§ isValidCombination()

bool libsbmlcs.SBMLNamespaces.isValidCombination ( )

Predicate returning true if the given set of namespaces represent a valid set.

Returns
true if the set of namespaces is valid, false otherwise.

§ operator!=()

static bool libsbmlcs.SBMLNamespaces.operator!= ( SBMLNamespaces  lhs,
SBMLNamespaces  rhs 
)
static

§ operator==()

static bool libsbmlcs.SBMLNamespaces.operator== ( SBMLNamespaces  lhs,
SBMLNamespaces  rhs 
)
static

§ removeNamespace()

int libsbmlcs.SBMLNamespaces.removeNamespace ( string  uri)

Removes an XML namespace from the set of namespaces within this SBMLNamespaces object.

Parameters
urithe XML namespace to be added.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:

§ removePackageNamespace()

int libsbmlcs.SBMLNamespaces.removePackageNamespace ( long  level,
long  version,
string  pkgName,
long  pkgVersion 
)

Removes an XML namespace of a package extension from the set of namespaces within this SBMLNamespaces object.

Parameters
levelthe SBML level
versionthe SBML version
pkgNamethe string of package name (e.g. 'layout', 'multi')
pkgVersionthe package version
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:

§ removePkgNamespace()

int libsbmlcs.SBMLNamespaces.removePkgNamespace ( long  level,
long  version,
string  pkgName,
long  pkgVersion 
)

Member Data Documentation

§ swigCMemOwn

bool libsbmlcs.SBMLNamespaces.swigCMemOwn
protected