libSBML C# API  5.18.0
libsbmlcs.GroupsExtension Class Reference
Inheritance diagram for libsbmlcs.GroupsExtension:
[legend]

Detailed Description

groups Base extension class for the package.

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.

This is the Groups package extension of the SBMLExtension class that is used to facilitate libSBML plug-ins in the implementation of an SBMLLevel 3 package.

Public Member Functions

new void addL2Namespaces (XMLNamespaces xmlns)
 Adds the package's Level 2 namespace(s). More...
 
new GroupsExtension clone ()
 Creates and returns a deep copy of this GroupsExtension object. More...
 
override void Dispose ()
 
override SBase DowncastSBase (IntPtr cPtr, bool owner)
 
override SBasePlugin DowncastSBasePlugin (IntPtr cPtr, bool owner)
 
new void enableL2NamespaceForDocument (SBMLDocument doc)
 Called to enable the package on the SBMLDocument object. More...
 
long getCategory (long index)
 
new long getLevel (string uri)
 Returns the SBML Level for the given URI of this package. More...
 
string getMessage (long index, long pkgVersion, string details)
 
new string getName ()
 Returns the name of this SBML Level 3 package ('groups'). More...
 
int getNumOfSBasePlugins ()
 Returns the number of SBasePluginCreatorBase objects stored in this object. More...
 
long getNumOfSupportedPackageURI ()
 Returns the number of supported package namespace URIs. More...
 
new long getPackageVersion (string uri)
 Returns the SBML Level 3 package version for the given URI of this package. More...
 
new SBMLNamespaces getSBMLExtensionNamespaces (string uri)
 Returns a GroupsPkgNamespaces object. More...
 
long getSeverity (long index, long pkgVersion)
 
string getShortMessage (long index)
 
new string getStringFromTypeCode (int typeCode)
 Takes a type code of the “groups” package and returns a string describing the code. More...
 
string getSupportedPackageURI (long n)
 Returns the nth XML namespace URI. More...
 
new string getURI (long sbmlLevel, long sbmlVersion, long pkgVersion)
 Returns a string representing the SBML XML namespace of this SBML Level 3 package. More...
 
new long getVersion (string uri)
 Returns the Version within the SBML Level for the given URI of this package. More...
 
 GroupsExtension ()
 Creates a new GroupsExtension instance. More...
 
 GroupsExtension (GroupsExtension orig)
 Copy constructor for GroupsExtension. More...
 
bool isEnabled ()
 Returns true if this package is enabled. More...
 
new bool isInUse (SBMLDocument doc)
 Indicates whether this extension is being used by the given SBMLDocument. More...
 
bool isSupported (string uri)
 Returns true if the given XML namespace URI is supported by this package extension. More...
 
new void removeL2Namespaces (XMLNamespaces xmlns)
 Removes the package's Level 2 namespace(s). More...
 
bool setEnabled (bool isEnabled)
 Enable or disable this package. More...
 

Static Public Member Functions

static long getDefaultLevel ()
 Returns the default SBML Level implemented by this libSBML extension. More...
 
static long getDefaultPackageVersion ()
 Returns the default version of the SBML Level 3 package implemented by this libSBML extension. More...
 
static long getDefaultVersion ()
 Returns the default SBML Version implemented by this libSBML extension. More...
 
static string getPackageName ()
 Returns the nickname of the SBML Level 3 package implemented by this libSBML extension. More...
 
static string getXmlnsL3V1V1 ()
 Returns the XML namespace URI of the SBML Level 3 package implemented by this libSBML extension. More...
 
static void init ()
 

Protected Attributes

bool swigCMemOwn
 

Constructor & Destructor Documentation

libsbmlcs.GroupsExtension.GroupsExtension ( )

Creates a new GroupsExtension instance.

libsbmlcs.GroupsExtension.GroupsExtension ( GroupsExtension  orig)

Copy constructor for GroupsExtension.

Parameters
origthe GroupsExtension instance to copy.

Member Function Documentation

new void libsbmlcs.SBMLExtension.addL2Namespaces ( XMLNamespaces  xmlns)
inherited

Adds the package's Level 2 namespace(s).

This method is related to special facilities designed to support legacy behaviors surrounding SBML Level 2 models. Due to the historical background of the SBML Layout package, libSBML implements special behavior for that package: it always creates a Layout plugin object for any SBML Level 2 document it reads in, regardless of whether that document actually uses Layout constructs. Since Level 2 does not use namespaces on the top level of the SBML document object, libSBML simply keys off the fact that the model is a Level 2 model. To allow the extensions for the Layout and Render (and possibly other) packages to support this behavior, the SBMLExtension class contains special methods to allow packages to hook themselves into the Level 2 parsing apparatus when necessary.

Parameters
xmlnsan XMLNamespaces object that will be used for the annotation. Implementation should override this method with something that adds the package's namespace(s) to the set of namespaces in xmlns. For instance, here is the code from the Layout package extension:
if (!xmlns->containsUri( LayoutExtension::getXmlnsL2()))
xmlns->add(LayoutExtension::getXmlnsL2(), 'layout');
new GroupsExtension libsbmlcs.GroupsExtension.clone ( )

Creates and returns a deep copy of this GroupsExtension object.

Returns
a (deep) copy of this GroupsExtension object.
override void libsbmlcs.GroupsExtension.Dispose ( )
virtual

Reimplemented from libsbmlcs.SBMLExtension.

override SBase libsbmlcs.GroupsExtension.DowncastSBase ( IntPtr  cPtr,
bool  owner 
)
virtual

Reimplemented from libsbmlcs.SBMLExtension.

override SBasePlugin libsbmlcs.GroupsExtension.DowncastSBasePlugin ( IntPtr  cPtr,
bool  owner 
)
virtual

Reimplemented from libsbmlcs.SBMLExtension.

new void libsbmlcs.SBMLExtension.enableL2NamespaceForDocument ( SBMLDocument  doc)
inherited

Called to enable the package on the SBMLDocument object.

This method is related to special facilities designed to support legacy behaviors surrounding SBML Level 2 models. Due to the historical background of the SBML Layout package, libSBML implements special behavior for that package: it always creates a Layout plugin object for any SBML Level 2 document it reads in, regardless of whether that document actually uses Layout constructs. Since Level 2 does not use namespaces on the top level of the SBML document object, libSBML simply keys off the fact that the model is a Level 2 model. To allow the extensions for the Layout and Render (and possibly other) packages to support this behavior, the SBMLExtension class contains special methods to allow packages to hook themselves into the Level 2 parsing apparatus when necessary.

Parameters
docthe SBMLDocument object for the model. Implementations should override this method with something that enables the package based on the package's namespace(s). For example, here is the code from the Layout package extension:
if (doc->getLevel() == 2)
doc->enablePackage(LayoutExtension::getXmlnsL2(), 'layout', true);
long libsbmlcs.SBMLExtension.getCategory ( long  index)
inherited
static long libsbmlcs.GroupsExtension.getDefaultLevel ( )
static

Returns the default SBML Level implemented by this libSBML extension.

Returns
the SBML Level, as a long integereger.
static long libsbmlcs.GroupsExtension.getDefaultPackageVersion ( )
static

Returns the default version of the SBML Level 3 package implemented by this libSBML extension.

Returns
the default version number of the SBML Level 3 package definition, as a long integereger.
static long libsbmlcs.GroupsExtension.getDefaultVersion ( )
static

Returns the default SBML Version implemented by this libSBML extension.

Returns
the Version within the default SBML Level, as a long integereger.
new long libsbmlcs.GroupsExtension.getLevel ( string  uri)

Returns the SBML Level for the given URI of this package.

Parameters
urithe string of the URI that represents one of the versions of the 'groups' package.
Returns
the SBML Level for the given URI of this package, or 0 if the given URI is invalid, or for a different package.
string libsbmlcs.SBMLExtension.getMessage ( long  index,
long  pkgVersion,
string  details 
)
inherited
new string libsbmlcs.GroupsExtension.getName ( )

Returns the name of this SBML Level 3 package ('groups').

Returns
a string representing the name of this package ('groups').
int libsbmlcs.SBMLExtension.getNumOfSBasePlugins ( )
inherited

Returns the number of SBasePluginCreatorBase objects stored in this object.

Returns
the total number of SBasePluginCreatorBase objects stored in this SBMLExtension-derived object.
long libsbmlcs.SBMLExtension.getNumOfSupportedPackageURI ( )
inherited

Returns the number of supported package namespace URIs.

Returns
the number of supported package XML namespace URIs of this package extension.
static string libsbmlcs.GroupsExtension.getPackageName ( )
static

Returns the nickname of the SBML Level 3 package implemented by this libSBML extension.

Returns
the package nickname, as a string.
new long libsbmlcs.GroupsExtension.getPackageVersion ( string  uri)

Returns the SBML Level 3 package version for the given URI of this package.

Parameters
urithe string of the URI that represents one of the versions of the 'groups' package.
Returns
the version of the SBML Level 3 package for the given URI of this package, or 0 if the given URI is invalid, or for a different package.
new SBMLNamespaces libsbmlcs.GroupsExtension.getSBMLExtensionNamespaces ( string  uri)

Returns a GroupsPkgNamespaces object.

Parameters
urithe string of the URI that represents one of the versions of the 'groups' package.
Returns
GroupsPkgNamespaces object corresponding to the given URI of this package, or null if the given URI is not defined in the 'groups' package.
long libsbmlcs.SBMLExtension.getSeverity ( long  index,
long  pkgVersion 
)
inherited
string libsbmlcs.SBMLExtension.getShortMessage ( long  index)
inherited
new string libsbmlcs.GroupsExtension.getStringFromTypeCode ( int  typeCode)

Takes a type code of the “groups” package and returns a string describing the code.

Parameters
typeCodea libSBML type code defined by the libSBML extension implementing support for the SBML Level 3 “groups” package.
Returns
a text string representing the type code given by typeCode. If the type code is unrecognized for this implementation of the libSBML “groups” package, the string returned will be '(Unknown SBML Groups Type)'.
string libsbmlcs.SBMLExtension.getSupportedPackageURI ( long  n)
inherited

Returns the nth XML namespace URI.

Parameters
nthe index number of the namespace URI being sought.
Returns
a string representing the XML namespace URI understood to be supported by this package. An empty string will be returned if there is no nth URI.
new string libsbmlcs.GroupsExtension.getURI ( long  sbmlLevel,
long  sbmlVersion,
long  pkgVersion 
)

Returns a string representing the SBML XML namespace of this SBML Level 3 package.

Parameters
sbmlLevelthe level of SBML.
sbmlVersionthe version of SBML.
pkgVersionthe version of this package.
Returns
a string representing the name of this package ('groups').

The namespace URI constructed by this method corresponds to the combination of the Level and Version of SBML, and the Version of the SBML Level 3 package. (At the time of this writing, the only SBML Level that supports packages is Level 3, so the value of sbmlLevel is necessarily always 3.)

new long libsbmlcs.GroupsExtension.getVersion ( string  uri)

Returns the Version within the SBML Level for the given URI of this package.

Parameters
urithe string of the URI that represents one of the versions of the 'groups' package.
Returns
the SBML Version within the SBML Level for the given URI of this package, or 0 if the given URI is invalid, or for a different package.
static string libsbmlcs.GroupsExtension.getXmlnsL3V1V1 ( )
static

Returns the XML namespace URI of the SBML Level 3 package implemented by this libSBML extension.

Returns
the XML namespace, as a string.
static void libsbmlcs.GroupsExtension.init ( )
static
bool libsbmlcs.SBMLExtension.isEnabled ( )
inherited

Returns true if this package is enabled.

Returns
true if this package is enabled, false otherwise.
new bool libsbmlcs.SBMLExtension.isInUse ( SBMLDocument  doc)
inherited

Indicates whether this extension is being used by the given SBMLDocument.

The default implementation returns true. This means that when a document had this extension enabled, it will not be possible to convert it to SBML Level 2 as we cannot make sure that the extension can be converted.

Parameters
docthe SBML document to test.
Returns
a boolean indicating whether the extension is actually being used by the document.
bool libsbmlcs.SBMLExtension.isSupported ( string  uri)
inherited

Returns true if the given XML namespace URI is supported by this package extension.

Returns
true if the given XML namespace URI (equivalent to a package version) is supported by this package extension, false otherwise.
new void libsbmlcs.SBMLExtension.removeL2Namespaces ( XMLNamespaces  xmlns)
inherited

Removes the package's Level 2 namespace(s).

This method is related to special facilities designed to support legacy behaviors surrounding SBML Level 2 models. Due to the historical background of the SBML Layout package, libSBML implements special behavior for that package: it always creates a Layout plugin object for any SBML Level 2 document it reads in, regardless of whether that document actually uses Layout constructs. Since Level 2 does not use namespaces on the top level of the SBML document object, libSBML simply keys off the fact that the model is a Level 2 model. To allow the extensions for the Layout and Render (and possibly other) packages to support this behavior, the SBMLExtension class contains special methods to allow packages to hook themselves into the Level 2 parsing apparatus when necessary.

Parameters
xmlnsan XMLNamespaces object that will be used for the annotation. Implementations should override this method with something that removes the package's namespace(s) from the set of namespaces in xmlns. For instance, here is the code from the Layout package extension:
for (int n = 0; n < xmlns->getNumNamespaces(); n++)
{
if (xmlns->getURI(n) == LayoutExtension::getXmlnsL2())
xmlns->remove(n);
}
bool libsbmlcs.SBMLExtension.setEnabled ( bool  isEnabled)
inherited

Enable or disable this package.

Parameters
isEnabledflag indicating whether to enable (if true) or disable (false) this package extension.
Returns
true if this call succeeded; false otherwise.

Member Data Documentation

bool libsbmlcs.SBMLExtension.swigCMemOwn
protectedinherited