001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.10
004 *
005 * Do not make changes to this file unless you know what you are doing--modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.sbml.libsbml;
010
011/** 
012 * <span class="pkg-marker pkg-color-groups"><a href="group__groups.html">groups</a></span>
013 Representation of a group of SBML components.
014 <p>
015 * The {@link Group} class is the first and most central class in the SBML
016 * Level&nbsp;3 Groups package.  This class represents a <em>group of
017 * entities</em>: a simple mechanism for indicating that particular
018 * components of an SBML model are related in some way.  The nature of the
019 * relationship is left up to the modeler, and can be clarified by means of
020 * annotations on model components.  Groups may contain either the same or
021 * different types of SBML objects, and groups may be nested if desired.
022 * There are no predefined modeling or mathematical semantics associated with
023 * groups.
024 <p>
025 * The Groups class has one required attribute, 'kind'; two optional
026 * attributes, 'id' and 'name'; and a single child element, {@link ListOfMembers}.
027 * The membership of a group is determined by the contents of the list of
028 * members stored in {@link Member} objects within the {@link ListOfMembers} child of a {@link Group}
029 * object.  Since the {@link Group} class of objects is derived from {@link SBase}, and {@link SBase}
030 * provides the ability to attach {@link SBO} terms as well as MIRIAM annotations,
031 * the semantics of a given group in a model can be made more precise using
032 * references to external controlled vocabularies and ontologies.
033 <p>
034 * <h2>Group kinds</h2>
035 <p>
036 * The attribute 'kind' on {@link Group} is used to indicate the nature of the group
037 * defined by a {@link Group} instance.  The 'kind' attribute must always have
038 * one of the following three possible values:
039 <p>
040 * <ul>
041 * <li> <code>'classification':</code> The group represents a class, and its members
042 * have an <em>is-a</em> relationship to the group.  For example, the group
043 * could represent a type of molecule such as ATP, and the members could be
044 * species located in different compartments, thereby establishing that the
045 * species are pools of the same molecule in different locations.
046 <p>
047 * <li> <code>'partonomy':</code> The group represents a collection of parts, and its
048 * members have a <em>part-of</em> relationship to the group.  For example, the
049 * group could represent a cellular structure, and individual compartments
050 * could be made members of the group to indicate they represent subparts of
051 * that cellular structure.
052 <p>
053 * <li> <code>'collection':</code> The grouping is merely a collection for convenience,
054 * without an implied relationship between the members.  For example, the
055 * group could be used to collect together multiple disparate components of a
056 * model&mdash;species, reactions, events&mdash;involved in a particular
057 * phenotype, and apply a common annotation rather than having to copy the
058 * same annotation to each component individually.
059 *
060 * </ul> <p>
061 * In the libSBML API for Groups, these possible values for the 'kind'
062 * attribute are programmatically represented as constants so that callers
063 * will not normally need to deal with text string values.  The following
064 * are the constants defined for the three values of 'kind' (plus an
065 * additional constant to represent unrecognized values):
066 <p>
067 * <ul>
068 * <li> {@link libsbmlConstants#GROUP_KIND_CLASSIFICATION GROUP_KIND_CLASSIFICATION}
069 * <li> {@link libsbmlConstants#GROUP_KIND_PARTONOMY GROUP_KIND_PARTONOMY}
070 * <li> {@link libsbmlConstants#GROUP_KIND_COLLECTION GROUP_KIND_COLLECTION}
071 * <li> {@link libsbmlConstants#GROUP_KIND_UNKNOWN GROUP_KIND_UNKNOWN}
072 *
073 * </ul> <p>
074 * <h2>Groups and their members</h2>
075 <p>
076 * If an SBML element is referenced by a {@link Group}'s child {@link Member} (directly or
077 * indirectly), it is considered to be a member of that {@link Group}.  If the same
078 * element is referenced by multiple {@link Member} objects, this is equivalent to
079 * including it just once.  (It is considered best practice to avoid this,
080 * but does not make for an invalid SBML document.)
081 <p>
082 * Children of referenced elements are not considered to be members of the
083 * Group: a {@link KineticLaw} of a referenced {@link Reaction} is not itself a {@link Group}
084 * member. Even the membership of so-called SBML container classes (e.g.,
085 * {@link ListOfSpecies}, {@link ListOfCompartments}, etc.) does not imply inclusion of
086 * children as members of the {@link Group}. The sole exception to this rule is the
087 * handling of {@link ListOfMembers} class, described below.
088 <p>
089 * <h2>Semantics of group memberships</h2>
090 <p>
091 * <p>
092 * If a {@link Member} object within a {@link Group} object's {@link ListOfMembers} references
093 * another {@link Group} object, it is the <em>referenced {@link Group} itself</em> that is
094 * considered to be a member of the parent {@link Group}, <em>not</em> the corresponding
095 * referenced model component(s).  This is true regardless of whether those
096 * components themselves happen to point to other components using some
097 * mechanism defined by another SBML Level&nbsp;3 package (as happens, for
098 * example, in the SBML Level&nbsp;3 Hierarchical Model Composition package
099 * and its use of {@link SBaseRef}).  However, if instead a {@link Member} object references
100 * a {@link ListOfMembers} object (using the 'id' attribute permitted on
101 * {@link ListOfMembers} objects), it is the components of that {@link ListOfMembers} that
102 * are considered to be part of the parent {@link Group}.  In other words: if in some
103 * {@link Group} <em>G</em>, a {@link Member} <em>M</em> references another {@link Group}, that {@link Group} is the
104 * member of <em>G</em>; if <em>M</em> references a {@link ListOfMembers}, it is the entities
105 * referenced by the {@link Member} objects within the {@link ListOfMembers} that are
106 * the members of <em>G</em> and not the {@link ListOfMembers} object itself.
107 <p>
108 * The implication of this is that any rule that applies to members of a
109 * group (such the meaning of the 'kind' attribute, or the restrictions on
110 * the application of 'sboTerm' attributes on a {@link ListOfMembers}) applies to the
111 * child group when referenced by the {@link Group} 'id', and to the members of the
112 * child group when referenced by the {@link ListOfMembers} 'id'. In an example
113 * situation where a parent group includes two {@link Species} plus a {@link Group} which
114 * itself contains three other {@link Species}, if the parent group's {@link ListOfMembers}
115 * is given an 'sboTerm' attribute value, that {@link SBO} term applies to the two
116 * species and the group, not to the three child species members of the
117 * second group.  (Note also that in such a case, the parent group's 'kind'
118 * attribute value would almost certainly be <code>'collection'</code> or 
119 * <code>'partonomy'</code>, and not <code>'classification'</code>, as two species and a group are
120 * very unlikely to be classified as the same thing.)  In contrast, in the
121 * situation where a parent group includes two {@link Species} plus a {@link ListOfMembers}
122 * which contains three other {@link Species}, the parent group's {@link ListOfMembers}
123 * 'sboTerm' would apply to the five {@link Species}, and could be more reasonably
124 * marked as a <code>'classification'.</code>
125 <p>
126 * In a future version of this SBML Level&nbsp;3 Groups specification, it may
127 * be possible to perform set operations on groups, but for now, this type of
128 * union is the only set operation that is possible.
129 <p>
130 * Groups are not permitted to be circular: no {@link Member} may reference itself,
131 * its parent {@link ListOfMembers}, nor its parent {@link Group}. If a {@link Member} references a
132 * {@link Group}, the same restrictions apply to that subgroup's children: they may
133 * not reference the {@link Member}, its parent {@link ListOfMembers}, nor its parent {@link Group},
134 * and if any of those children reference a {@link Group}, the same restrictions apply
135 * to them, etc.
136 <p>
137 * If a {@link Member} has a 'idRef' or 'metaIdRef' attribute which references an
138 * object from a namespace that is not understood by the interpreter of the
139 * SBML model, that {@link Member} must be ignored. The referenced object will not be
140 * understood by the interpreter, and therefore has no need to become a
141 * member of the group. If an interpreter cannot tell whether a referenced
142 * object does not exist or if exists in an unparsed namespace, it may choose
143 * to produce a warning.
144 <p>
145 * @see Member
146 * @see ListOfMembers
147 * @see ListOfGroups
148 */
149
150public class Group extends SBase {
151   private long swigCPtr;
152
153   protected Group(long cPtr, boolean cMemoryOwn)
154   {
155     super(libsbmlJNI.Group_SWIGUpcast(cPtr), cMemoryOwn);
156     swigCPtr = cPtr;
157   }
158
159   protected static long getCPtr(Group obj)
160   {
161     return (obj == null) ? 0 : obj.swigCPtr;
162   }
163
164   protected static long getCPtrAndDisown (Group obj)
165   {
166     long ptr = 0;
167
168     if (obj != null)
169     {
170       ptr             = obj.swigCPtr;
171       obj.swigCMemOwn = false;
172     }
173
174     return ptr;
175   }
176
177  protected void finalize() {
178    delete();
179  }
180
181  public synchronized void delete() {
182    if (swigCPtr != 0) {
183      if (swigCMemOwn) {
184        swigCMemOwn = false;
185        libsbmlJNI.delete_Group(swigCPtr);
186      }
187      swigCPtr = 0;
188    }
189    super.delete();
190  }
191
192  
193/**
194   * Creates a new {@link Group} using the given SBML Level, Version and
195   * &ldquo;groups&rdquo; package version.
196   <p>
197   * @param level a long integer, the SBML Level to assign to this {@link Group}.
198   <p>
199   * @param version a long integer, the SBML Version to assign to this {@link Group}.
200   <p>
201   * @param pkgVersion a long integer, the SBML Groups Version to assign to
202   * this {@link Group}.
203   <p>
204   * @throws SBMLConstructorException
205   * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind of
206   * SBML object, are either invalid or mismatched with respect to the parent
207   * {@link SBMLDocument} object.
208   <p>
209   * <p>
210 * @note Attempting to add an object to an {@link SBMLDocument} having a different
211 * combination of SBML Level, Version and XML namespaces than the object
212 * itself will result in an error at the time a caller attempts to make the
213 * addition.  A parent object must have compatible Level, Version and XML
214 * namespaces.  (Strictly speaking, a parent may also have more XML
215 * namespaces than a child, but the reverse is not permitted.)  The
216 * restriction is necessary to ensure that an SBML model has a consistent
217 * overall structure.  This requires callers to manage their objects
218 * carefully, but the benefit is increased flexibility in how models can be
219 * created by permitting callers to create objects bottom-up if desired.  In
220 * situations where objects are not yet attached to parents (e.g.,
221 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
222 * libSBML determine such things as whether it is valid to assign a
223 * particular value to an attribute.
224   */ public
225 Group(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
226    this(libsbmlJNI.new_Group__SWIG_0(level, version, pkgVersion), true);
227  }
228
229  
230/**
231   * Creates a new {@link Group} using the given SBML Level, Version and
232   * &ldquo;groups&rdquo; package version.
233   <p>
234   * @param level a long integer, the SBML Level to assign to this {@link Group}.
235   <p>
236   * @param version a long integer, the SBML Version to assign to this {@link Group}.
237   <p>
238   * @param pkgVersion a long integer, the SBML Groups Version to assign to
239   * this {@link Group}.
240   <p>
241   * @throws SBMLConstructorException
242   * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind of
243   * SBML object, are either invalid or mismatched with respect to the parent
244   * {@link SBMLDocument} object.
245   <p>
246   * <p>
247 * @note Attempting to add an object to an {@link SBMLDocument} having a different
248 * combination of SBML Level, Version and XML namespaces than the object
249 * itself will result in an error at the time a caller attempts to make the
250 * addition.  A parent object must have compatible Level, Version and XML
251 * namespaces.  (Strictly speaking, a parent may also have more XML
252 * namespaces than a child, but the reverse is not permitted.)  The
253 * restriction is necessary to ensure that an SBML model has a consistent
254 * overall structure.  This requires callers to manage their objects
255 * carefully, but the benefit is increased flexibility in how models can be
256 * created by permitting callers to create objects bottom-up if desired.  In
257 * situations where objects are not yet attached to parents (e.g.,
258 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
259 * libSBML determine such things as whether it is valid to assign a
260 * particular value to an attribute.
261   */ public
262 Group(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
263    this(libsbmlJNI.new_Group__SWIG_1(level, version), true);
264  }
265
266  
267/**
268   * Creates a new {@link Group} using the given SBML Level, Version and
269   * &ldquo;groups&rdquo; package version.
270   <p>
271   * @param level a long integer, the SBML Level to assign to this {@link Group}.
272   <p>
273   * @param version a long integer, the SBML Version to assign to this {@link Group}.
274   <p>
275   * @param pkgVersion a long integer, the SBML Groups Version to assign to
276   * this {@link Group}.
277   <p>
278   * @throws SBMLConstructorException
279   * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind of
280   * SBML object, are either invalid or mismatched with respect to the parent
281   * {@link SBMLDocument} object.
282   <p>
283   * <p>
284 * @note Attempting to add an object to an {@link SBMLDocument} having a different
285 * combination of SBML Level, Version and XML namespaces than the object
286 * itself will result in an error at the time a caller attempts to make the
287 * addition.  A parent object must have compatible Level, Version and XML
288 * namespaces.  (Strictly speaking, a parent may also have more XML
289 * namespaces than a child, but the reverse is not permitted.)  The
290 * restriction is necessary to ensure that an SBML model has a consistent
291 * overall structure.  This requires callers to manage their objects
292 * carefully, but the benefit is increased flexibility in how models can be
293 * created by permitting callers to create objects bottom-up if desired.  In
294 * situations where objects are not yet attached to parents (e.g.,
295 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
296 * libSBML determine such things as whether it is valid to assign a
297 * particular value to an attribute.
298   */ public
299 Group(long level) throws org.sbml.libsbml.SBMLConstructorException {
300    this(libsbmlJNI.new_Group__SWIG_2(level), true);
301  }
302
303  
304/**
305   * Creates a new {@link Group} using the given SBML Level, Version and
306   * &ldquo;groups&rdquo; package version.
307   <p>
308   * @param level a long integer, the SBML Level to assign to this {@link Group}.
309   <p>
310   * @param version a long integer, the SBML Version to assign to this {@link Group}.
311   <p>
312   * @param pkgVersion a long integer, the SBML Groups Version to assign to
313   * this {@link Group}.
314   <p>
315   * @throws SBMLConstructorException
316   * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind of
317   * SBML object, are either invalid or mismatched with respect to the parent
318   * {@link SBMLDocument} object.
319   <p>
320   * <p>
321 * @note Attempting to add an object to an {@link SBMLDocument} having a different
322 * combination of SBML Level, Version and XML namespaces than the object
323 * itself will result in an error at the time a caller attempts to make the
324 * addition.  A parent object must have compatible Level, Version and XML
325 * namespaces.  (Strictly speaking, a parent may also have more XML
326 * namespaces than a child, but the reverse is not permitted.)  The
327 * restriction is necessary to ensure that an SBML model has a consistent
328 * overall structure.  This requires callers to manage their objects
329 * carefully, but the benefit is increased flexibility in how models can be
330 * created by permitting callers to create objects bottom-up if desired.  In
331 * situations where objects are not yet attached to parents (e.g.,
332 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
333 * libSBML determine such things as whether it is valid to assign a
334 * particular value to an attribute.
335   */ public
336 Group() throws org.sbml.libsbml.SBMLConstructorException {
337    this(libsbmlJNI.new_Group__SWIG_3(), true);
338  }
339
340  
341/**
342   * Creates a new {@link Group} using the given {@link GroupsPkgNamespaces} object.
343   <p>
344   * @param groupsns the {@link GroupsPkgNamespaces} object.
345   <p>
346   * @throws SBMLConstructorException
347   * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind of
348   * SBML object, are either invalid or mismatched with respect to the parent
349   * {@link SBMLDocument} object.
350   <p>
351   * <p>
352 * @note Attempting to add an object to an {@link SBMLDocument} having a different
353 * combination of SBML Level, Version and XML namespaces than the object
354 * itself will result in an error at the time a caller attempts to make the
355 * addition.  A parent object must have compatible Level, Version and XML
356 * namespaces.  (Strictly speaking, a parent may also have more XML
357 * namespaces than a child, but the reverse is not permitted.)  The
358 * restriction is necessary to ensure that an SBML model has a consistent
359 * overall structure.  This requires callers to manage their objects
360 * carefully, but the benefit is increased flexibility in how models can be
361 * created by permitting callers to create objects bottom-up if desired.  In
362 * situations where objects are not yet attached to parents (e.g.,
363 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
364 * libSBML determine such things as whether it is valid to assign a
365 * particular value to an attribute.
366   */ public
367 Group(GroupsPkgNamespaces groupsns) throws org.sbml.libsbml.SBMLConstructorException {
368    this(libsbmlJNI.new_Group__SWIG_4(GroupsPkgNamespaces.getCPtr(groupsns), groupsns), true);
369  }
370
371  
372/**
373   * Copy constructor for {@link Group}.
374   <p>
375   * @param orig the {@link Group} instance to copy.
376   */ public
377 Group(Group orig) throws org.sbml.libsbml.SBMLConstructorException {
378    this(libsbmlJNI.new_Group__SWIG_5(Group.getCPtr(orig), orig), true);
379  }
380
381  
382/**
383   * Creates and returns a deep copy of this {@link Group} object.
384   <p>
385   * @return a (deep) copy of this {@link Group} object.
386   */ public
387 Group cloneObject() {
388    long cPtr = libsbmlJNI.Group_cloneObject(swigCPtr, this);
389    return (cPtr == 0) ? null : new Group(cPtr, true);
390  }
391
392  
393/**
394   * Returns the value of the 'id' attribute of this {@link Group}.
395   <p>
396   * @return the value of the 'id' attribute of this {@link Group} as a string.
397   */ public
398 String getId() {
399    return libsbmlJNI.Group_getId(swigCPtr, this);
400  }
401
402  
403/**
404   * Returns the value of the 'name' attribute of this {@link Group}.
405   <p>
406   * @return the value of the 'name' attribute of this {@link Group} as a string.
407   */ public
408 String getName() {
409    return libsbmlJNI.Group_getName(swigCPtr, this);
410  }
411
412  
413/**
414   * Returns the value of the 'kind' attribute of this {@link Group}.
415   <p>
416   * <p>
417 * The attribute 'kind' on a {@link Group} object is used to indicate the nature of
418 * the group defined by a particular {@link Group} instance.  In the SBML
419 * Level&nbsp;3 Version&nbsp;1 {@link Group} specification, there are only three
420 * allowable values for 'kind':
421 * <ul>
422 * <li> <code>'classification'</code>, to indicate that the group represents a class,
423 * and its members have an <em>is-a</em> relationship to the group.
424 <p>
425 * <li> <code>'partonomy'</code>, to indicate that the group represents a collection of
426 * parts, and its members have a <em>part-of</em> relationship to the group.
427 <p>
428 * <li> <code>'collection'</code>, to indicate that the grouping is merely a collection
429 * for convenience, without an implied relationship between the members.
430 * </ul>
431   <p>
432   * @return the value of the 'kind' attribute of this {@link Group}.
433   * .
434   * The possible values returned by this method are:
435   * <ul>
436   * <li> {@link libsbmlConstants#GROUP_KIND_CLASSIFICATION GROUP_KIND_CLASSIFICATION}
437   * <li> {@link libsbmlConstants#GROUP_KIND_PARTONOMY GROUP_KIND_PARTONOMY}
438   * <li> {@link libsbmlConstants#GROUP_KIND_COLLECTION GROUP_KIND_COLLECTION}
439   * <li> {@link libsbmlConstants#GROUP_KIND_UNKNOWN GROUP_KIND_UNKNOWN}
440   * </ul>
441   */ public
442 int getKind() {
443    return libsbmlJNI.Group_getKind(swigCPtr, this);
444  }
445
446  
447/**
448   * Returns the value of the 'kind' attribute of this {@link Group}.
449   <p>
450   * <p>
451 * The attribute 'kind' on a {@link Group} object is used to indicate the nature of
452 * the group defined by a particular {@link Group} instance.  In the SBML
453 * Level&nbsp;3 Version&nbsp;1 {@link Group} specification, there are only three
454 * allowable values for 'kind':
455 * <ul>
456 * <li> <code>'classification'</code>, to indicate that the group represents a class,
457 * and its members have an <em>is-a</em> relationship to the group.
458 <p>
459 * <li> <code>'partonomy'</code>, to indicate that the group represents a collection of
460 * parts, and its members have a <em>part-of</em> relationship to the group.
461 <p>
462 * <li> <code>'collection'</code>, to indicate that the grouping is merely a collection
463 * for convenience, without an implied relationship between the members.
464 * </ul>
465   <p>
466   * @return the value of the 'kind' attribute of this {@link Group} as a string.
467   * The possible values returned by this method are:
468   * <ul>
469   * <li> <code>'classification'</code>
470   * <li> <code>'partonomy'</code>
471   * <li> <code>'collection'</code>
472   * <li> <code>'unknown'</code>
473   * </ul>
474   */ public
475 String getKindAsString() {
476    return libsbmlJNI.Group_getKindAsString(swigCPtr, this);
477  }
478
479  
480/**
481   * Predicate returning <code>true</code> if this {@link Group}'s 'id' attribute is set.
482   <p>
483   * @return <code>true</code> if this {@link Group}'s 'id' attribute has been set, otherwise @c
484   * false is returned.
485   */ public
486 boolean isSetId() {
487    return libsbmlJNI.Group_isSetId(swigCPtr, this);
488  }
489
490  
491/**
492   * Predicate returning <code>true</code> if this {@link Group}'s 'name' attribute is set.
493   <p>
494   * @return <code>true</code> if this {@link Group}'s 'name' attribute has been set, otherwise
495   * <code>false</code> is returned.
496   */ public
497 boolean isSetName() {
498    return libsbmlJNI.Group_isSetName(swigCPtr, this);
499  }
500
501  
502/**
503   * Predicate returning <code>true</code> if this {@link Group}'s 'kind' attribute is set.
504   <p>
505   * <p>
506 * The attribute 'kind' on a {@link Group} object is used to indicate the nature of
507 * the group defined by a particular {@link Group} instance.  In the SBML
508 * Level&nbsp;3 Version&nbsp;1 {@link Group} specification, there are only three
509 * allowable values for 'kind':
510 * <ul>
511 * <li> <code>'classification'</code>, to indicate that the group represents a class,
512 * and its members have an <em>is-a</em> relationship to the group.
513 <p>
514 * <li> <code>'partonomy'</code>, to indicate that the group represents a collection of
515 * parts, and its members have a <em>part-of</em> relationship to the group.
516 <p>
517 * <li> <code>'collection'</code>, to indicate that the grouping is merely a collection
518 * for convenience, without an implied relationship between the members.
519 * </ul>
520   <p>
521   * @return <code>true</code> if this {@link Group}'s 'kind' attribute has been set, otherwise
522   * <code>false</code> is returned.
523   */ public
524 boolean isSetKind() {
525    return libsbmlJNI.Group_isSetKind(swigCPtr, this);
526  }
527
528  
529/**
530   * Sets the value of the 'id' attribute of this {@link Group}.
531   <p>
532   * @param id String& value of the 'id' attribute to be set.
533   <p>
534   * <p>
535 * @return integer value indicating success/failure of the
536 * function.   The possible values
537 * returned by this function are:
538   * <ul>
539   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
540   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
541   * </ul>
542   */ public
543 int setId(String id) {
544    return libsbmlJNI.Group_setId(swigCPtr, this, id);
545  }
546
547  
548/**
549   * Sets the value of the 'name' attribute of this {@link Group}.
550   <p>
551   * @param name String& value of the 'name' attribute to be set.
552   <p>
553   * <p>
554 * @return integer value indicating success/failure of the
555 * function.   The possible values
556 * returned by this function are:
557   * <ul>
558   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
559   * </ul>
560   */ public
561 int setName(String name) {
562    return libsbmlJNI.Group_setName(swigCPtr, this, name);
563  }
564
565  
566/**
567   * Sets the value of the 'kind' attribute of this {@link Group}.
568   <p>
569   * <p>
570 * The attribute 'kind' on a {@link Group} object is used to indicate the nature of
571 * the group defined by a particular {@link Group} instance.  In the SBML
572 * Level&nbsp;3 Version&nbsp;1 {@link Group} specification, there are only three
573 * allowable values for 'kind':
574 * <ul>
575 * <li> <code>'classification'</code>, to indicate that the group represents a class,
576 * and its members have an <em>is-a</em> relationship to the group.
577 <p>
578 * <li> <code>'partonomy'</code>, to indicate that the group represents a collection of
579 * parts, and its members have a <em>part-of</em> relationship to the group.
580 <p>
581 * <li> <code>'collection'</code>, to indicate that the grouping is merely a collection
582 * for convenience, without an implied relationship between the members.
583 * </ul>
584   <p>
585   * @param kind int value of the 
586   * 'kind' attribute to be set.
587   * The value must be one of the predefined constants that represent
588   * valid SBML Level&nbsp;3 Version&nbsp;1 {@link Group} 'kind' names, which
589   * means it must be one of the following values:
590   * <ul>
591   * <li> {@link libsbmlConstants#GROUP_KIND_CLASSIFICATION GROUP_KIND_CLASSIFICATION}
592   * <li> {@link libsbmlConstants#GROUP_KIND_PARTONOMY GROUP_KIND_PARTONOMY}
593   * <li> {@link libsbmlConstants#GROUP_KIND_COLLECTION GROUP_KIND_COLLECTION}
594   *
595   * </ul> <p>
596   * <p>
597 * @return integer value indicating success/failure of the
598 * function.   The possible values
599 * returned by this function are:
600   * <ul>
601   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
602   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
603   * </ul>
604   */ public
605 int setKind(int kind) {
606    return libsbmlJNI.Group_setKind__SWIG_0(swigCPtr, this, kind);
607  }
608
609  
610/**
611   * Sets the value of the 'kind' attribute of this {@link Group}.
612   <p>
613   * <p>
614 * The attribute 'kind' on a {@link Group} object is used to indicate the nature of
615 * the group defined by a particular {@link Group} instance.  In the SBML
616 * Level&nbsp;3 Version&nbsp;1 {@link Group} specification, there are only three
617 * allowable values for 'kind':
618 * <ul>
619 * <li> <code>'classification'</code>, to indicate that the group represents a class,
620 * and its members have an <em>is-a</em> relationship to the group.
621 <p>
622 * <li> <code>'partonomy'</code>, to indicate that the group represents a collection of
623 * parts, and its members have a <em>part-of</em> relationship to the group.
624 <p>
625 * <li> <code>'collection'</code>, to indicate that the grouping is merely a collection
626 * for convenience, without an implied relationship between the members.
627 * </ul>
628   <p>
629   * @param kind String& of the 'kind' attribute to be set.  The value
630   * must be one of the following possible strings:
631   * <ul>
632   * <li> 'classification'
633   * <li> 'partonomy'
634   * <li> 'collection'
635   *
636   * </ul> <p>
637   * <p>
638 * @return integer value indicating success/failure of the
639 * function.   The possible values
640 * returned by this function are:
641   * <ul>
642   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
643   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
644   * </ul>
645   */ public
646 int setKind(String kind) {
647    return libsbmlJNI.Group_setKind__SWIG_1(swigCPtr, this, kind);
648  }
649
650  
651/**
652   * Unsets the value of the 'id' attribute of this {@link Group}.
653   <p>
654   * <p>
655 * @return integer value indicating success/failure of the
656 * function.   The possible values
657 * returned by this function are:
658   * <ul>
659   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
660   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
661   * </ul>
662   */ public
663 int unsetId() {
664    return libsbmlJNI.Group_unsetId(swigCPtr, this);
665  }
666
667  
668/**
669   * Unsets the value of the 'name' attribute of this {@link Group}.
670   <p>
671   * <p>
672 * @return integer value indicating success/failure of the
673 * function.   The possible values
674 * returned by this function are:
675   * <ul>
676   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
677   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
678   * </ul>
679   */ public
680 int unsetName() {
681    return libsbmlJNI.Group_unsetName(swigCPtr, this);
682  }
683
684  
685/**
686   * Unsets the value of the 'kind' attribute of this {@link Group}.
687   <p>
688   * <p>
689 * @return integer value indicating success/failure of the
690 * function.   The possible values
691 * returned by this function are:
692   * <ul>
693   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
694   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
695   * </ul>
696   */ public
697 int unsetKind() {
698    return libsbmlJNI.Group_unsetKind(swigCPtr, this);
699  }
700
701  
702/**
703   * Returns the {@link ListOfMembers} from this {@link Group}.
704   <p>
705   * Using the SBML Level&nbsp;3 Groups package, the membership of a group
706   * is determined by the contents of the list of members stored in {@link Member}
707   * objects within the {@link ListOfMembers} child of a {@link Group} object.
708   <p>
709   * @return the {@link ListOfMembers} from this {@link Group}.
710   */ public
711 ListOfMembers getListOfMembers() {
712    long cPtr = libsbmlJNI.Group_getListOfMembers__SWIG_0(swigCPtr, this);
713    return (cPtr == 0) ? null : new ListOfMembers(cPtr, false);
714  }
715
716  
717/**
718   * Get a {@link Member} from the {@link Group}.
719   <p>
720   * @param n a long integer representing the index of the {@link Member} to
721   * retrieve.
722   <p>
723   * @return the nth {@link Member} in the {@link ListOfMembers} within this {@link Group}.
724   <p>
725   * @see #addMember(Member m)
726   * @see #createMember()
727   * @see #getMember(String sid)
728   * @see #getNumMembers()
729   * @see #removeMember(String sid)
730   * @see #removeMember(long n)
731   */ public
732 Member getMember(long n) {
733    long cPtr = libsbmlJNI.Group_getMember__SWIG_0(swigCPtr, this, n);
734    return (cPtr == 0) ? null : new Member(cPtr, false);
735  }
736
737  
738/**
739   * Get a {@link Member} from the {@link Group} based on its identifier.
740   <p>
741   * @param sid a string representing the identifier of the {@link Member} to retrieve.
742   <p>
743   * @return the {@link Member} in the {@link ListOfMembers} within this {@link Group} with the given
744   * id or null if no such {@link Member} exists.
745   <p>
746   * @see #addMember(Member m)
747   * @see #createMember()
748   * @see #getMember(long n)
749   * @see #getNumMembers()
750   * @see #removeMember(String sid)
751   * @see #removeMember(long n)
752   */ public
753 Member getMember(String sid) {
754    long cPtr = libsbmlJNI.Group_getMember__SWIG_2(swigCPtr, this, sid);
755    return (cPtr == 0) ? null : new Member(cPtr, false);
756  }
757
758  
759/**
760   * Get a {@link Member} from the {@link Group} based on the IdRef to which it refers.
761   <p>
762   * @param sid a string representing the idRef attribute of the {@link Member} object
763   * to retrieve.
764   <p>
765   * @return the first {@link Member} in this {@link Group} based on the given idRef attribute
766   * or null if no such {@link Member} exists.
767   */ public
768 Member getMemberByIdRef(String sid) {
769    long cPtr = libsbmlJNI.Group_getMemberByIdRef__SWIG_0(swigCPtr, this, sid);
770    return (cPtr == 0) ? null : new Member(cPtr, false);
771  }
772
773  
774/**
775   * Adds a copy of the given {@link Member} to this {@link Group}.
776   <p>
777   * @param m the {@link Member} object to add.
778   <p>
779   * <p>
780 * @return integer value indicating success/failure of the
781 * function.   The possible values
782 * returned by this function are:
783   * <ul>
784   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
785   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
786   * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT}
787   * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH}
788   * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH}
789   * <li> {@link libsbmlConstants#LIBSBML_NAMESPACES_MISMATCH LIBSBML_NAMESPACES_MISMATCH}
790   * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID}
791   *
792   * </ul> <p>
793   * <p>
794 * @note This method should be used with some caution.  The fact that this
795 * method <em>copies</em> the object passed to it means that the caller will be
796 * left holding a physically different object instance than the one contained
797 * inside this object.  Changes made to the original object instance (such as
798 * resetting attribute values) will <em>not affect the instance in this
799 * object</em>.  In addition, the caller should make sure to free the
800 * original object if it is no longer being used, or else a memory leak will
801 * result.  Please see other methods on this class (particularly a
802 * corresponding method whose name begins with the word <code>create</code>)
803 * for alternatives that do not lead to these issues.
804   <p>
805   * @see #createMember()
806   * @see #getMember(String sid)
807   * @see #getMember(long n)
808   * @see #getNumMembers()
809   * @see #removeMember(String sid)
810   * @see #removeMember(long n)
811   */ public
812 int addMember(Member m) {
813    return libsbmlJNI.Group_addMember(swigCPtr, this, Member.getCPtr(m), m);
814  }
815
816  
817/**
818   * Get the number of {@link Member} objects in this {@link Group}.
819   <p>
820   * @return the number of {@link Member} objects in this {@link Group}.
821   <p>
822   * @see #addMember(Member m)
823   * @see #createMember()
824   * @see #getMember(String sid)
825   * @see #getMember(long n)
826   * @see #removeMember(String sid)
827   * @see #removeMember(long n)
828   */ public
829 long getNumMembers() {
830    return libsbmlJNI.Group_getNumMembers(swigCPtr, this);
831  }
832
833  
834/**
835   * Creates a new {@link Member} object, adds it to this {@link Group} object and returns the
836   * {@link Member} object created.
837   <p>
838   * @return a new {@link Member} object instance.
839   <p>
840   * @see #addMember(Member m)
841   * @see #getMember(String sid)
842   * @see #getMember(long n)
843   * @see #getNumMembers()
844   * @see #removeMember(String sid)
845   * @see #removeMember(long n)
846   */ public
847 Member createMember() {
848    long cPtr = libsbmlJNI.Group_createMember(swigCPtr, this);
849    return (cPtr == 0) ? null : new Member(cPtr, false);
850  }
851
852  
853/**
854   * Removes the nth {@link Member} from this {@link Group} and returns a pointer to it.
855   <p>
856   * @param n a long integer representing the index of the {@link Member} to remove.
857   <p>
858   * @return a pointer to the nth {@link Member} in this {@link Group}.
859   <p>
860   * @note the caller owns the returned object and is responsible for deleting
861   * it.
862   <p>
863   * @see #addMember(Member m)
864   * @see #createMember()
865   * @see #getMember(String sid)
866   * @see #getMember(long n)
867   * @see #getNumMembers()
868   * @see #removeMember(String sid)
869   */ public
870 Member removeMember(long n) {
871    long cPtr = libsbmlJNI.Group_removeMember__SWIG_0(swigCPtr, this, n);
872    return (cPtr == 0) ? null : new Member(cPtr, true);
873  }
874
875  
876/**
877   * Removes the {@link Member} from this {@link Group} based on its identifier and returns a
878   * pointer to it.
879   <p>
880   * @param sid a string representing the identifier of the {@link Member} to remove.
881   <p>
882   * @return the {@link Member} in this {@link Group} based on the identifier or null if no
883   * such {@link Member} exists.
884   <p>
885   * @note the caller owns the returned object and is responsible for deleting
886   * it.
887   <p>
888   * @see #addMember(Member m)
889   * @see #createMember()
890   * @see #getMember(String sid)
891   * @see #getMember(long n)
892   * @see #getNumMembers()
893   * @see #removeMember(long n)
894   */ public
895 Member removeMember(String sid) {
896    long cPtr = libsbmlJNI.Group_removeMember__SWIG_1(swigCPtr, this, sid);
897    return (cPtr == 0) ? null : new Member(cPtr, true);
898  }
899
900  
901/**
902   * Returns the XML element name of this {@link Group} object.
903   <p>
904   * For {@link Group}, the XML element name is always <code>'group'.</code>
905   <p>
906   * @return the name of this element, i.e. <code>'group'.</code>
907   */ public
908 String getElementName() {
909    return libsbmlJNI.Group_getElementName(swigCPtr, this);
910  }
911
912  
913/**
914   * Returns the libSBML type code for this {@link Group} object.
915   <p>
916   * <p>
917 * LibSBML attaches an identifying code to every kind of SBML object.  These
918 * are integer constants known as <em>SBML type codes</em>.  The names of all
919 * the codes begin with the characters <code>SBML_</code>.
920 * In the Java language interface for libSBML, the
921 * type codes are defined as static integer constants in the interface class
922 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
923 * package plug-ins may use overlapping type codes; to identify the package
924 * to which a given object belongs, call the <code>getPackageName()</code>
925 * method on the object.
926   <p>
927   * @return the SBML type code for this object:
928   * {@link libsbmlConstants#SBML_GROUPS_GROUP SBML_GROUPS_GROUP}
929   <p>
930   * <p>
931 * @warning <span class='warning'>The specific integer values of the possible
932 * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
933 * packages,  To fully identify the correct code, <strong>it is necessary to
934 * invoke both getTypeCode() and getPackageName()</strong>.</span>
935   <p>
936   * @see #getElementName()
937   * @see #getPackageName()
938   */ public
939 int getTypeCode() {
940    return libsbmlJNI.Group_getTypeCode(swigCPtr, this);
941  }
942
943  
944/**
945   * Predicate returning <code>true</code> if all the required attributes for this {@link Group}
946   * object have been set.
947   <p>
948   * @return <code>true</code> to indicate that all the required attributes of this {@link Group}
949   * have been set, otherwise <code>false</code> is returned.
950   <p>
951   * @note The required attributes for the {@link Group} object are:
952   * <ul>
953   * <li> 'kind'
954   * </ul>
955   */ public
956 boolean hasRequiredAttributes() {
957    return libsbmlJNI.Group_hasRequiredAttributes(swigCPtr, this);
958  }
959
960  
961/** * @internal */ public
962 void connectToChild() {
963    libsbmlJNI.Group_connectToChild(swigCPtr, this);
964  }
965
966  
967/** * @internal */ public
968 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
969    libsbmlJNI.Group_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
970  }
971
972  
973/**
974   * Returns the first child element that has the given <code>id</code> in the model-wide
975   * SId namespace, or <code>null</code> if no such object is found.
976   <p>
977   * @param id a string representing the id attribute of the object to
978   * retrieve.
979   <p>
980   * @return a pointer to the {@link SBase} element with the given <code>id</code>.
981   */ public
982 SBase getElementBySId(String id) {
983  return libsbml.DowncastSBase(libsbmlJNI.Group_getElementBySId(swigCPtr, this, id), false);
984}
985
986  
987/**
988   * Returns the first child element that has the given <code>metaid</code>, or <code>null</code>
989   * if no such object is found.
990   <p>
991   * @param metaid a string representing the metaid attribute of the object to
992   * retrieve.
993   <p>
994   * @return a pointer to the {@link SBase} element with the given <code>metaid</code>.
995   */ public
996 SBase getElementByMetaId(String metaid) {
997  return libsbml.DowncastSBase(libsbmlJNI.Group_getElementByMetaId(swigCPtr, this, metaid), false);
998}
999
1000}