libSBML Python API
5.8.0
|
Class for managing lists of SBMLNamespaces objects.
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 class is necessary because of programming language differences between Python and the underlying C++ core of libSBML's implementation. It would of course be preferable to have a common list type for all lists returned by libSBML (e.g., lists of SBMLNamespaces objects, lists of SBMLNamespaces objects, etc.). However, this is currently impossible to achieve given the way the underlying C++ lists are implemented.
As a result of this incompatibility, libSBML must implement the Python versions of the lists in another way. The approach taken is to define specialized list types for each kind of object that needs a list; that is, SBMLNamespacesList for SBMLNamespaces objects, SBMLNamespacesList for SBMLNamespaces objects, and a few others. These list objects provide the same kind of functionality that the underlying C++ generic lists provide (such as get()
, add()
, remove()
, etc.).
Public Member Functions | |
def | __init__ |
def | add |
def | get |
def | getSize |
def | prepend |
def | remove |
def libsbml.SBMLNamespacesList.__init__ | ( | self | ) |
Class for managing lists of SBMLNamespaces objects.
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 class is necessary because of programming language differences between Python and the underlying C++ core of libSBML's implementation. It would of course be preferable to have a common list type for all lists returned by libSBML (e.g., lists of SBMLNamespaces objects, lists of SBMLNamespaces objects, etc.). However, this is currently impossible to achieve given the way the underlying C++ lists are implemented.
As a result of this incompatibility, libSBML must implement the Python versions of the lists in another way. The approach taken is to define specialized list types for each kind of object that needs a list; that is, SBMLNamespacesList for SBMLNamespaces objects, SBMLNamespacesList for SBMLNamespaces objects, and a few others. These list objects provide the same kind of functionality that the underlying C++ generic lists provide (such as get()
, add()
, remove()
, etc.).
__init__()string
Explicit constructor for this list.
In most circumstances, callers will obtain an SBMLNamespacesList object from a call to a libSBML method that returns the list. However, the constructor is provided in case callers need to construct the lists themselves.
def libsbml.SBMLNamespacesList.add | ( | self, | |
args | |||
) |
Python method signature(s):
add(SBMLNamespaces item)
Adds the given SBMLNamespaces object item
to this list.
item | the SBMLNamespaces object to add to add |
def libsbml.SBMLNamespacesList.get | ( | self, | |
args | |||
) |
Python method signature(s):
get()SBMLNamespaces
Returns the nth SBMLNamespaces object from this list.
If the index number n
is greater than the size of the list (as indicated by getSize()), then this method returns None
.
n | the index number of the item to get, with indexing beginning at number 0 . |
def libsbml.SBMLNamespacesList.getSize | ( | self | ) |
Python method signature(s):
getSize()long
Returns the number of items in this list.
def libsbml.SBMLNamespacesList.prepend | ( | self, | |
args | |||
) |
Python method signature(s):
prepend(SBMLNamespaces item)
Adds the SBMLNamespaces object item
to the beginning of this list.
item | a pointer to the item to be prepended. |
def libsbml.SBMLNamespacesList.remove | ( | self, | |
args | |||
) |
Python method signature(s):
remove(long n)SBMLNamespaces
Removes the nth SBMLNamespaces object from this list and returns it.
Callers can use getSize() to find out the length of the list. If n >
getSize(), this method returns None
and does not delete anything.
n | the index number of the item to remove |
n