public class ListOfMembers extends ListOf
Member objects.
In the SBML Level 3 Groups package, the membership of a group is
defined by placing Member objects within a ListOfMembers object contained
within a Group object. A ListOfMembers object is optional, but, if
present, it must contain at least one Member object. In common with other
ListOf___ classes in SBML, ListOfMembers is derived from SBase. However,
an uncommon feature of ListOfMembers is that it has optional 'id' and
'name' attributes that can be used in a manner discussed below.
A ListOfMembers must have one or more Member children. Since ListOfMembers
is derived from SBase, it inherits the 'sboTerm' and 'metaid' attributes,
as well as the optional children Notes and Annotation. Unlike most lists
of objects in SBML, however, the 'sboTerm' attribute and the Notes and
Annotation children are taken here to apply directly to every SBML element
referenced by each child Member of this ListOfMembers, if that referenced
element has no such definition. Thus, if a referenced element has no
defined 'sboTerm' attribute or child Notes or Annotation objects, that
element should be considered to now have the 'sboTerm', child Notes, or
child Annotation of the ListOfMembers.
If multiple ListOfMembers have child Member elements that reference
the same SBML element, and more than one ListOfMembers or Member has
a value for an sboTerm attribute, Notes, or Annotation element, those
Member elements should be consistent with each other: the 'sboTerm'
attributes should either be identical, or one should inherit from
the other Notes should say the same or similar things and Annotation
elements should not conflict. Interpreters may choose to resolve any
such conflicts arbitrarily.
An uncommon feature about ListOfMembers is that, if it is referenced by a
Member of a different Group, the children of the referenced
ListOfMembers are also considered to be members of the referencing group.
In this way, groups may be nested semantically to create larger groups out
of subgroups.
If a Member object within a Group object's ListOfMembers references
another Group object, it is the referenced Group itself that is
considered to be a member of the parent Group, not the corresponding
referenced model component(s). This is true regardless of whether those
components themselves happen to point to other components using some
mechanism defined by another SBML Level 3 package (as happens, for
example, in the SBML Level 3 Hierarchical Model Composition package
and its use of SBaseRef). However, if instead a Member object references
a ListOfMembers object (using the 'id' attribute permitted on
ListOfMembers objects), it is the components of that ListOfMembers that
are considered to be part of the parent Group. In other words: if in some
Group G, a Member M references another Group, that Group is the
member of G if M references a ListOfMembers, it is the entities
referenced by the Member objects within the ListOfMembers that are
the members of G and not the ListOfMembers object itself.
The implication of this is that any rule that applies to members of a
group (such the meaning of the 'kind' attribute, or the restrictions on
the application of 'sboTerm' attributes on a ListOfMembers) applies to the
child group when referenced by the Group 'id', and to the members of the
child group when referenced by the ListOfMembers 'id'. In an example
situation where a parent group includes two Species plus a Group which
itself contains three other Species, if the parent group's ListOfMembers
is given an 'sboTerm' attribute value, that SBO term applies to the two
species and the group, not to the three child species members of the
second group. (Note also that in such a case, the parent group's 'kind'
attribute value would almost certainly be 'collection' or
'partonomy', and not 'classification', as two species and a group are
very unlikely to be classified as the same thing.) In contrast, in the
situation where a parent group includes two Species plus a ListOfMembers
which contains three other Species, the parent group's ListOfMembers
'sboTerm' would apply to the five Species, and could be more reasonably
marked as a 'classification'.
In a future version of this SBML Level 3 Groups specification, it may be possible to perform set operations on groups, but for now, this type of union is the only set operation that is possible.
Groups are not permitted to be circular: no Member may reference itself,
its parent ListOfMembers, nor its parent Group. If a Member references a
Group, the same restrictions apply to that subgroup's children: they may
not reference the Member, its parent ListOfMembers, nor its parent Group,
and if any of those children reference a Group, the same restrictions apply
to them, etc.
If a Member has a 'idRef' or 'metaIdRef' attribute which references an
object from a namespace that is not understood by the interpreter of the
SBML model, that Member must be ignored. The referenced object will not be
understood by the interpreter, and therefore has no need to become a
member of the group. If an interpreter cannot tell whether a referenced
object does not exist or if exists in an unparsed namespace, it may choose
to produce a warning.
Group,
Member,
ListOfGroups| Constructor and Description |
|---|
ListOfMembers()
Creates a new
ListOfMembers using the given SBML Level, Version and
&ldquogroups&rdquo package version. |
ListOfMembers(GroupsPkgNamespaces groupsns)
Creates a new
ListOfMembers using the given GroupsPkgNamespaces object. |
ListOfMembers(ListOfMembers orig)
Copy constructor for
ListOfMembers. |
ListOfMembers(long level)
Creates a new
ListOfMembers using the given SBML Level, Version and
&ldquogroups&rdquo package version. |
ListOfMembers(long level,
long version)
Creates a new
ListOfMembers using the given SBML Level, Version and
&ldquogroups&rdquo package version. |
ListOfMembers(long level,
long version,
long pkgVersion)
Creates a new
ListOfMembers using the given SBML Level, Version and
&ldquogroups&rdquo package version. |
| Modifier and Type | Method and Description |
|---|---|
int |
addMember(Member m)
Adds a copy of the given
Member to this ListOfMembers. |
ListOfMembers |
cloneObject()
Creates and returns a deep copy of this
ListOfMembers object. |
Member |
createMember()
Creates a new
Member object, adds it to this ListOfMembers object and
returns the Member object created. |
void |
delete()
Explicitly deletes the underlying native object.
|
Member |
get(long n)
Get a
Member from the ListOfMembers. |
Member |
get(java.lang.String sid)
Get a
Member from the ListOfMembers based on its identifier. |
Member |
getByIdRef(java.lang.String sid)
Get a
Member from the ListOfMembers based on the element to which it
refers. |
java.lang.String |
getElementName()
Returns the XML element name of this
ListOfMembers object. |
java.lang.String |
getId()
Returns the value of the 'id' attribute of this
ListOfMembers. |
int |
getItemTypeCode()
Returns the libSBML type code for the SBML objects contained in this
ListOfMembers object. |
java.lang.String |
getName()
Returns the value of the 'name' attribute of this
ListOfMembers. |
long |
getNumMembers()
Get the number of
Member objects in this ListOfMembers. |
int |
getTypeCode()
Returns the libSBML type code for this
ListOfMembers object. |
boolean |
hasRequiredAttributes()
Predicate returning
true if all the required attributes for this
ListOfMembers object have been set. |
boolean |
isSetId()
Predicate returning
true if this ListOfMembers's 'id' attribute is set. |
boolean |
isSetName()
Predicate returning
true if this ListOfMembers's 'name' attribute is
set. |
Member |
remove(long n)
Removes the nth
Member from this ListOfMembers and returns a pointer to
it. |
Member |
remove(java.lang.String sid)
Removes the
Member from this ListOfMembers based on its identifier and
returns a pointer to it. |
int |
setId(java.lang.String id)
Sets the value of the 'id' attribute of this
ListOfMembers. |
int |
setName(java.lang.String name)
Sets the value of the 'name' attribute of this
ListOfMembers. |
int |
unsetId()
Unsets the value of the 'id' attribute of this
ListOfMembers. |
int |
unsetName()
Unsets the value of the 'name' attribute of this
ListOfMembers. |
append, appendAndOwn, appendFrom, clear, clear, connectToChild, getElementByMetaId, getElementBySId, insert, insertAndOwn, removeFromParentAndDelete, sizeaddCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getIdAttribute, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getPackageCoreVersion, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setIdAttribute, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm, unsetUserDatapublic ListOfMembers(long level, long version, long pkgVersion) throws SBMLConstructorException
ListOfMembers using the given SBML Level, Version and
&ldquogroups&rdquo package version.
level - a long integer, the SBML Level to assign to this
ListOfMembers.
version - a long integer, the SBML Version to assign to this
ListOfMembers.
pkgVersion - a long integer, the SBML Groups Version to assign to
this ListOfMembers.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public ListOfMembers(long level, long version) throws SBMLConstructorException
ListOfMembers using the given SBML Level, Version and
&ldquogroups&rdquo package version.
level - a long integer, the SBML Level to assign to this
ListOfMembers.
version - a long integer, the SBML Version to assign to this
ListOfMembers.
pkgVersion - a long integer, the SBML Groups Version to assign to
this ListOfMembers.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public ListOfMembers(long level) throws SBMLConstructorException
ListOfMembers using the given SBML Level, Version and
&ldquogroups&rdquo package version.
level - a long integer, the SBML Level to assign to this
ListOfMembers.
version - a long integer, the SBML Version to assign to this
ListOfMembers.
pkgVersion - a long integer, the SBML Groups Version to assign to
this ListOfMembers.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public ListOfMembers() throws SBMLConstructorException
ListOfMembers using the given SBML Level, Version and
&ldquogroups&rdquo package version.
level - a long integer, the SBML Level to assign to this
ListOfMembers.
version - a long integer, the SBML Version to assign to this
ListOfMembers.
pkgVersion - a long integer, the SBML Groups Version to assign to
this ListOfMembers.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public ListOfMembers(GroupsPkgNamespaces groupsns) throws SBMLConstructorException
ListOfMembers using the given GroupsPkgNamespaces object.
The package namespaces object used in this constructor is derived from a
SBMLNamespaces object, which encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
package version and name information used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces facilities is to create an
package namespace object somewhere in a program once, then hand that object
as needed to object constructors of that package that accept it as and
argument, such as this one.
groupsns - the GroupsPkgNamespaces object.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public ListOfMembers(ListOfMembers orig) throws SBMLConstructorException
ListOfMembers.
orig - the ListOfMembers instance to copy.SBMLConstructorExceptionpublic 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 ListOfMembers.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 ListOfMembers.delete() themselves.
public ListOfMembers cloneObject()
ListOfMembers object.
cloneObject in class ListOfListOfMembers object.public java.lang.String getId()
ListOfMembers.
getId in class SBaseListOfMembers as a string.SBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.isSetIdAttribute(),
SBase.unsetIdAttribute()public java.lang.String getName()
ListOfMembers.
getName in class SBaseListOfMembers as a
string.SBase.getIdAttribute(),
SBase.isSetName(),
SBase.setName(String sid),
SBase.unsetName()public boolean isSetId()
true if this ListOfMembers's 'id' attribute is set.
isSetId in class SBasetrue if this ListOfMembers's 'id' attribute has been set,
otherwise false is returned.SBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.unsetIdAttribute(),
SBase.isSetIdAttribute()public boolean isSetName()
true if this ListOfMembers's 'name' attribute is
set.
isSetName in class SBasetrue if this ListOfMembers's 'name' attribute has been set,
otherwise false is returned.SBase.getName(),
SBase.setName(String sid),
SBase.unsetName()public int setId(java.lang.String id)
ListOfMembers.
setId in class SBaseid - String& value of the 'id' attribute to be set.
Calling this function with id = null or an empty string is
equivalent to calling unsetId().
SBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.isSetIdAttribute(),
SBase.unsetIdAttribute()public int setName(java.lang.String name)
ListOfMembers.
setName in class SBasename - String& value of the 'name' attribute to be set.
Calling this function with name = null or an empty string is
equivalent to calling unsetName().
public int unsetId()
ListOfMembers.
unsetId in class SBaseSBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.isSetIdAttribute(),
SBase.unsetIdAttribute()public int unsetName()
ListOfMembers.
unsetName in class SBaseSBase.getName(),
SBase.setName(String sid),
SBase.isSetName()public Member get(long n)
Member from the ListOfMembers.
get in class ListOfn - a long integer representing the index of the Member to retrieve.
Member in this ListOfMembers.
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.
ListOfMembers.addMember(Member object),
ListOfMembers.createMember(),
ListOfMembers.get(String sid),
ListOfMembers.getNumMembers(),
ListOfMembers.remove(String sid),
ListOfMembers.remove(long n)public Member get(java.lang.String sid)
Member from the ListOfMembers based on its identifier.
sid - a string representing the identifier of the Member to retrieve.
Member in this ListOfMembers with the given sid or null
if no such Member 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.
ListOfMembers.addMember(Member object),
ListOfMembers.createMember(),
ListOfMembers.get(long n),
ListOfMembers.getNumMembers(),
ListOfMembers.remove(String sid),
ListOfMembers.remove(long n)public Member remove(long n)
Member from this ListOfMembers and returns a pointer to
it.
remove in class ListOfn - a long integer representing the index of the Member to remove.
Member in this ListOfMembers.
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.
ListOfMembers.addMember(Member object),
ListOfMembers.createMember(),
ListOfMembers.get(String sid),
ListOfMembers.get(long n),
ListOfMembers.getNumMembers(),
ListOfMembers.remove(String sid)public Member remove(java.lang.String sid)
Member from this ListOfMembers based on its identifier and
returns a pointer to it.
sid - a string representing the identifier of the Member to remove.
Member in this ListOfMembers based on the identifier or null
if no such Member 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.
ListOfMembers.addMember(Member object),
ListOfMembers.createMember(),
ListOfMembers.get(String sid),
ListOfMembers.get(long n),
ListOfMembers.getNumMembers(),
ListOfMembers.remove(long n)public int addMember(Member m)
Member to this ListOfMembers.
m - the Member 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
ListOfMembers.createMember(),
ListOfMembers.get(String sid),
ListOfMembers.get(long n),
ListOfMembers.getNumMembers(),
ListOfMembers.remove(String sid),
ListOfMembers.remove(long n)create)
for alternatives that do not lead to these issues.
public long getNumMembers()
Member objects in this ListOfMembers.
Member objects in this ListOfMembers.
ListOfMembers.addMember(Member object),
ListOfMembers.createMember(),
ListOfMembers.get(String sid),
ListOfMembers.get(long n),
ListOfMembers.remove(String sid),
ListOfMembers.remove(long n)public Member createMember()
Member object, adds it to this ListOfMembers object and
returns the Member object created.
Member 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.
ListOfMembers.addMember(Member object),
ListOfMembers.get(String sid),
ListOfMembers.get(long n),
ListOfMembers.getNumMembers(),
ListOfMembers.remove(String sid),
ListOfMembers.remove(long n)public Member getByIdRef(java.lang.String sid)
Member from the ListOfMembers based on the element to which it
refers.
sid - a string representing the 'idRef' attribute of the Member
object to retrieve.
Member in this ListOfMembers based on the given idRef
attribute or null if no such Member 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.
public java.lang.String getElementName()
ListOfMembers object.
For ListOfMembers, the XML element name is always 'listOfMembers'.
getElementName in class ListOf'listOfMembers'.public int getTypeCode()
ListOfMembers object.
LibSBML attaches an identifying code to every kind of SBML object. These
are integer constants known as SBML type codes. The names of all
the codes begin with the characters SBML_.
In the Java language interface for libSBML, the
type codes are defined as static integer constants in the interface class
libsbmlConstants. Note that different Level 3
package plug-ins may use overlapping type codes to identify the package
to which a given object belongs, call the
method on the object.
SBase.getPackageName()
getTypeCode in class ListOfSBML_LIST_OF
ListOf.getItemTypeCode(),
ListOf.getElementName(),
SBase.getPackageName()public int getItemTypeCode()
ListOfMembers object.
LibSBML attaches an identifying code to every kind of SBML object. These
are integer constants known as SBML type codes. The names of all
the codes begin with the characters SBML_.
In the Java language interface for libSBML, the
type codes are defined as static integer constants in the interface class
libsbmlConstants. Note that different Level 3
package plug-ins may use overlapping type codes to identify the package
to which a given object belongs, call the
method on the object.
SBase.getPackageName()
getItemTypeCode in class ListOfSBML_GROUPS_MEMBER
ListOfMembers.getElementName(),
SBase.getPackageName()public boolean hasRequiredAttributes()
true if all the required attributes for this
ListOfMembers object have been set.
hasRequiredAttributes in class SBasetrue to indicate that all the required attributes of this
ListOfMembers have been set, otherwise false is returned.