public class GroupsModelPlugin extends SBasePlugin
| 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, adds it to this GroupsModelPlugin object and
returns the Group object created. |
void |
delete()
Explicitly deletes the underlying native object.
|
SBase |
getElementByMetaId(java.lang.String metaid)
Returns the first child element that has the given
metaid, or null
if no such object is found. |
SBase |
getElementBySId(java.lang.String id)
Returns the first child element that has the given
id in the model-wide
SId namespace, or null if no such object is found. |
Group |
getGroup(long n)
Get a
Group from the GroupsModelPlugin. |
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 from this GroupsModelPlugin and returns a pointer to
it. |
Group |
removeGroup(java.lang.String sid)
Removes the
Group from this GroupsModelPlugin based on its identifier and
returns a pointer to it. |
getElementNamespace, getLevel, getListOfAllElements, getListOfAllElements, getPackageName, getPackageVersion, getParentSBMLObject, getPrefix, getSBMLDocument, getURI, getVersion, isValidTypeForList, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, setElementNamespacepublic GroupsModelPlugin(java.lang.String uri, java.lang.String prefix, GroupsPkgNamespaces groupsns)
GroupsModelPlugin using the given URI, prefix and package
namespace.
uri - a string, representing the URI of the SBML Level 3 package
implemented by this libSBML package extension.
prefix - a string, the XML namespace prefix being used for this
package.
groupsns - a pointer to the namesspaces object (GroupsPkgNamespaces)
for this package.
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.
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 SBasePluginpublic SBasePlugin cloneObject()
GroupsModelPlugin object.
cloneObject in class SBasePluginGroupsModelPlugin object.public ListOfGroups getListOfGroups()
ListOfGroups from this GroupsModelPlugin.
ListOfGroups from this GroupsModelPlugin.
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
GroupsModelPlugin.addGroup(Group object),
GroupsModelPlugin.createGroup(),
GroupsModelPlugin.getGroup(String sid),
GroupsModelPlugin.getGroup(long n),
GroupsModelPlugin.getNumGroups(),
GroupsModelPlugin.removeGroup(String sid),
GroupsModelPlugin.removeGroup(long n)public Group getGroup(long n)
Group from the GroupsModelPlugin.
n - a long integer representing the index of the Group to retrieve.
Group in the ListOfGroups within this GroupsModelPlugin.
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
GroupsModelPlugin.addGroup(Group object),
GroupsModelPlugin.createGroup(),
GroupsModelPlugin.getGroup(String sid),
GroupsModelPlugin.getNumGroups(),
GroupsModelPlugin.removeGroup(String sid),
GroupsModelPlugin.removeGroup(long n)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 sid or null if no such Group exists.
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
GroupsModelPlugin.addGroup(Group object),
GroupsModelPlugin.createGroup(),
GroupsModelPlugin.getGroup(long n),
GroupsModelPlugin.getNumGroups(),
GroupsModelPlugin.removeGroup(String sid),
GroupsModelPlugin.removeGroup(long n)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(String sid),
GroupsModelPlugin.removeGroup(long n)create)
for alternatives that do not lead to these issues.
public long getNumGroups()
Group objects in this GroupsModelPlugin.
Group objects in this GroupsModelPlugin.
GroupsModelPlugin.addGroup(Group object),
GroupsModelPlugin.createGroup(),
GroupsModelPlugin.getGroup(String sid),
GroupsModelPlugin.getGroup(long n),
GroupsModelPlugin.removeGroup(String sid),
GroupsModelPlugin.removeGroup(long n)public Group createGroup()
Group object, adds it to this GroupsModelPlugin object and
returns the Group object created.
Group object instance.
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
GroupsModelPlugin.addGroup(Group object),
GroupsModelPlugin.getGroup(String sid),
GroupsModelPlugin.getGroup(long n),
GroupsModelPlugin.getNumGroups(),
GroupsModelPlugin.removeGroup(String sid),
GroupsModelPlugin.removeGroup(long n)public Group removeGroup(long n)
Group from this GroupsModelPlugin and returns a pointer to
it.
n - a long integer representing the index of the Group to remove.
Group in this GroupsModelPlugin.
The pointer that is returned by this function is owned by the caller,
who is responsible for deleting it. Any changes made to the element
will not be reflected in any resulting SBML document unless the element
is added to an SBML Document. Even in this case, the element's deletion is
still the responsibility of the caller with two exceptions: if it is used
as the 'disownedItem' in the * ListOf#appendAndOwn() or ListOf#insertAndOwn()
functions. All other functions in libsbml add a copy of the element,
and do not transfer ownership of the pointer.
GroupsModelPlugin.addGroup(Group object),
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 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
null if no such Group exists.
The pointer that is returned by this function is owned by the caller,
who is responsible for deleting it. Any changes made to the element
will not be reflected in any resulting SBML document unless the element
is added to an SBML Document. Even in this case, the element's deletion is
still the responsibility of the caller with two exceptions: if it is used
as the 'disownedItem' in the * ListOf#appendAndOwn() or ListOf#insertAndOwn()
functions. All other functions in libsbml add a copy of the element,
and do not transfer ownership of the pointer.
GroupsModelPlugin.addGroup(Group object),
GroupsModelPlugin.createGroup(),
GroupsModelPlugin.getGroup(String sid),
GroupsModelPlugin.getGroup(long n),
GroupsModelPlugin.getNumGroups(),
GroupsModelPlugin.removeGroup(long n)public SBase getElementBySId(java.lang.String id)
id in the model-wide
SId namespace, or null if no such object is found.
getElementBySId in class SBasePluginid - 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, or null
if no such object is found.
getElementByMetaId in class SBasePluginmetaid - 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.