public class GroupsModelPlugin extends SBasePlugin
Model
.
The GroupsModelPlugin
class inherits from the SBMLSBasePlugin class, and
codifies the extensions to the Model
class defined in the SBML
Level 3 Groups (&ldquogroups&rdquo) package. This extension
allows a Model
to contain an optional ListOfGroups
object inside a new
element called <listOfGroups>
. This list holds the
definition of optional groups defined in the model.
A 'group' in SBML Level 3 provides a mechanism for
indicating that components of an SBML model are related in some way.
Groups may contain either the same or different types of SBML objects, and
groups may be nested if desired. There are no predefined behavioral
semantics associated with groups. All groups in a given model have to be
defined as Group
objects and included in the ListOfGroups
object attached
to the Model
object containing them.
Constructor and Description |
---|
GroupsModelPlugin(GroupsModelPlugin orig)
Copy constructor for
GroupsModelPlugin . |
GroupsModelPlugin(java.lang.String uri,
java.lang.String prefix,
GroupsPkgNamespaces groupsns)
Creates a new
GroupsModelPlugin using the given URI, prefix and package
namespace. |
Modifier and Type | Method and Description |
---|---|
int |
addGroup(Group g)
Adds a copy of the given
Group to this GroupsModelPlugin . |
SBasePlugin |
cloneObject()
Creates and returns a deep copy of this
GroupsModelPlugin object. |
void |
copyInformationToNestedLists()
For nested groups (Member objects that reference a
ListOfMembers
object), SBO terms, Notes, and Annotation from the
parent ListOfMembers applies to the child. |
Group |
createGroup()
Creates a new
Group object |
void |
delete()
Explicitly deletes the underlying native object.
|
SBase |
getElementByMetaId(java.lang.String metaid)
Returns the first child element that has the given
metaid . |
SBase |
getElementBySId(java.lang.String id)
Returns the first child element that has the given
id |
Group |
getGroup(long n)
Returns the nth
Group . |
Group |
getGroup(java.lang.String sid)
Get a
Group from the GroupsModelPlugin based on its identifier. |
ListOfGroups |
getListOfGroups()
Returns the
ListOfGroups from this GroupsModelPlugin . |
long |
getNumGroups()
Get the number of
Group objects in this GroupsModelPlugin . |
Group |
removeGroup(long n)
Removes the nth
Group . |
Group |
removeGroup(java.lang.String sid)
Removes the
Group from this GroupsModelPlugin based on its identifier. |
getElementNamespace, getLevel, getListOfAllElements, getListOfAllElements, getPackageName, getPackageVersion, getParentSBMLObject, getPrefix, getSBMLDocument, getURI, getVersion, isValidTypeForList, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, setElementNamespace
public GroupsModelPlugin(java.lang.String uri, java.lang.String prefix, GroupsPkgNamespaces groupsns)
GroupsModelPlugin
using the given URI, prefix and package
namespace.
In the XML representation of an SBML document, XML namespaces are used to
identify the origin of each XML construct used. XML namespaces are
identified by their unique resource identifiers (URIs). The core SBML
specifications stipulate the namespaces that must be used for core SBML
constructs for example, all XML elements that belong to SBML Level 3
Version 1 Core must be placed in the XML namespace identified by the URI
'http://www.sbml.org/sbml/level3/version1/core'
. Individual
SBML Level 3 packages define their own XML namespaces for example,
all elements belonging to the SBML Level 3 Layout Version 1
package must be placed in the XML namespace
'http://www.sbml.org/sbml/level3/version1/layout/version1/'
.
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.
uri
- the URI of the SBML Level 3 package implemented by
this libSBML package extension.
prefix
- the XML namespace prefix being used for the package.
groupsns
- the namespaces object for the package.public GroupsModelPlugin(GroupsModelPlugin orig)
GroupsModelPlugin
.
orig
- the GroupsModelPlugin
instance to copy.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 GroupsModelPlugin.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 GroupsModelPlugin.delete()
themselves.
delete
 in class SBasePlugin
public SBasePlugin cloneObject()
GroupsModelPlugin
object.
cloneObject
 in class SBasePlugin
GroupsModelPlugin
object.public ListOfGroups getListOfGroups()
ListOfGroups
from this GroupsModelPlugin
.
ListOfGroups
from this GroupsModelPlugin
.
GroupsModelPlugin.addGroup(Group g)
,
GroupsModelPlugin.createGroup()
,
GroupsModelPlugin.getGroup(String sid)
,
GroupsModelPlugin.getGroup(long n)
,
GroupsModelPlugin.getNumGroups()
,
GroupsModelPlugin.removeGroup(long n)
,
GroupsModelPlugin.removeGroup(String sid)
public Group getGroup(long n)
Group
.
n
- a long integer representing the index of the Group
to retrieve.
Group
in the ListOfGroups
within this GroupsModelPlugin
.
GroupsModelPlugin.addGroup(Group g)
,
GroupsModelPlugin.createGroup()
,
GroupsModelPlugin.getGroup(String sid)
,
GroupsModelPlugin.getGroup(long n)
,
GroupsModelPlugin.getNumGroups()
,
GroupsModelPlugin.removeGroup(long n)
,
GroupsModelPlugin.removeGroup(String sid)
public Group getGroup(java.lang.String sid)
Group
from the GroupsModelPlugin
based on its identifier.
sid
- a string representing the identifier of the Group
to retrieve.
Group
in the ListOfGroups
within this GroupsModelPlugin
with
the given identifier sid
, or null
if no such Group
exists.
GroupsModelPlugin.addGroup(Group g)
,
GroupsModelPlugin.createGroup()
,
GroupsModelPlugin.getGroup(String sid)
,
GroupsModelPlugin.getGroup(long n)
,
GroupsModelPlugin.getNumGroups()
,
GroupsModelPlugin.removeGroup(long n)
,
GroupsModelPlugin.removeGroup(String sid)
public int addGroup(Group g)
Group
to this GroupsModelPlugin
.
g
- the Group
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_OPERATION_FAILED
LIBSBML_INVALID_OBJECT
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_PKG_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
GroupsModelPlugin.createGroup()
,
GroupsModelPlugin.getGroup(String sid)
,
GroupsModelPlugin.getGroup(long n)
,
GroupsModelPlugin.getNumGroups()
,
GroupsModelPlugin.removeGroup(long n)
,
GroupsModelPlugin.removeGroup(String sid)
create
)
for alternatives that do not lead to these issues.
public long getNumGroups()
Group
objects in this GroupsModelPlugin
.
Group
objects in this GroupsModelPlugin
.
GroupsModelPlugin.createGroup()
,
GroupsModelPlugin.getGroup(String sid)
,
GroupsModelPlugin.getGroup(long n)
,
GroupsModelPlugin.removeGroup(long n)
,
GroupsModelPlugin.removeGroup(String sid)
public Group createGroup()
Group
object
This method creates a new Group
object, adds it to this
GroupsModelPlugin
object, and returns the Group
object created.
Group
object instance.
GroupsModelPlugin.addGroup(Group g)
,
GroupsModelPlugin.getGroup(String sid)
,
GroupsModelPlugin.getGroup(long n)
,
GroupsModelPlugin.removeGroup(long n)
,
GroupsModelPlugin.removeGroup(String sid)
public Group removeGroup(long n)
Group
.
This removes the nth Group
from this GroupsModelPlugin
object and
returns a pointer to it.
n
- a long integer representing the index of the Group
to remove.
Group
in this GroupsModelPlugin
.
GroupsModelPlugin.addGroup(Group g)
,
GroupsModelPlugin.createGroup()
,
GroupsModelPlugin.getGroup(String sid)
,
GroupsModelPlugin.getGroup(long n)
,
GroupsModelPlugin.getNumGroups()
,
GroupsModelPlugin.removeGroup(String sid)
public Group removeGroup(java.lang.String sid)
Group
from this GroupsModelPlugin
based on its identifier.
This method removes the Group
from this GroupsModelPlugin
based on its
identifier, and returns a pointer to it.
sid
- a string representing the identifier of the Group
to remove.
Group
in this GroupsModelPlugin
based on the identifier, or
@c
null if no such Group
exists.
GroupsModelPlugin.addGroup(Group g)
,
GroupsModelPlugin.createGroup()
,
GroupsModelPlugin.getGroup(String sid)
,
GroupsModelPlugin.getGroup(long n)
,
GroupsModelPlugin.getNumGroups()
public SBase getElementBySId(java.lang.String id)
id
This method searches the model-wide SId namespace for the id
.
getElementBySId
 in class SBasePlugin
id
- a string representing the id attribute of the object to
retrieve.
SBase
element with the given id
. If no such
object is found, this method returns null.
public SBase getElementByMetaId(java.lang.String metaid)
metaid
.
getElementByMetaId
 in class SBasePlugin
metaid
- a string representing the metaid attribute of the object to
retrieve.
SBase
element with the given metaid
. If
no such object is found, this method returns null.
public void copyInformationToNestedLists()
ListOfMembers
object), SBO
terms, Notes, and Annotation from the
parent ListOfMembers
applies to the child. This function
copies any information from any of those three things to all
child ListOfMembers
, and if that information is not already
set. After calling
this function, it is sufficient to check any ListOfMembers
to see if its SBO
term, Notes, or Annotation is set, without
further checking to see if that element was nested in another
Group
.