001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.12 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 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—species, reactions, events—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 3 package (as happens, for 098 * example, in the SBML Level 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 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 * “groups” 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 * <p> 205 * @note Attempting to add an object to an {@link SBMLDocument} having a different 206 * combination of SBML Level, Version and XML namespaces than the object 207 * itself will result in an error at the time a caller attempts to make the 208 * addition. A parent object must have compatible Level, Version and XML 209 * namespaces. (Strictly speaking, a parent may also have more XML 210 * namespaces than a child, but the reverse is not permitted.) The 211 * restriction is necessary to ensure that an SBML model has a consistent 212 * overall structure. This requires callers to manage their objects 213 * carefully, but the benefit is increased flexibility in how models can be 214 * created by permitting callers to create objects bottom-up if desired. In 215 * situations where objects are not yet attached to parents (e.g., 216 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 217 * libSBML determine such things as whether it is valid to assign a 218 * particular value to an attribute. For packages, this means that the 219 * parent object to which this package element is being added must have 220 * been created with the package namespace, or that the package namespace 221 * was added to it, even if that parent is not a package object itself. 222 */ public 223 Group(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 224 this(libsbmlJNI.new_Group__SWIG_0(level, version, pkgVersion), true); 225 } 226 227 228/** 229 * Creates a new {@link Group} using the given SBML Level, Version and 230 * “groups” package version. 231 <p> 232 * @param level a long integer, the SBML Level to assign to this {@link Group}. 233 <p> 234 * @param version a long integer, the SBML Version to assign to this {@link Group}. 235 <p> 236 * @param pkgVersion a long integer, the SBML Groups Version to assign to 237 * this {@link Group}. 238 <p> 239 * <p> 240 * @note Attempting to add an object to an {@link SBMLDocument} having a different 241 * combination of SBML Level, Version and XML namespaces than the object 242 * itself will result in an error at the time a caller attempts to make the 243 * addition. A parent object must have compatible Level, Version and XML 244 * namespaces. (Strictly speaking, a parent may also have more XML 245 * namespaces than a child, but the reverse is not permitted.) The 246 * restriction is necessary to ensure that an SBML model has a consistent 247 * overall structure. This requires callers to manage their objects 248 * carefully, but the benefit is increased flexibility in how models can be 249 * created by permitting callers to create objects bottom-up if desired. In 250 * situations where objects are not yet attached to parents (e.g., 251 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 252 * libSBML determine such things as whether it is valid to assign a 253 * particular value to an attribute. For packages, this means that the 254 * parent object to which this package element is being added must have 255 * been created with the package namespace, or that the package namespace 256 * was added to it, even if that parent is not a package object itself. 257 */ public 258 Group(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 259 this(libsbmlJNI.new_Group__SWIG_1(level, version), true); 260 } 261 262 263/** 264 * Creates a new {@link Group} using the given SBML Level, Version and 265 * “groups” package version. 266 <p> 267 * @param level a long integer, the SBML Level to assign to this {@link Group}. 268 <p> 269 * @param version a long integer, the SBML Version to assign to this {@link Group}. 270 <p> 271 * @param pkgVersion a long integer, the SBML Groups Version to assign to 272 * this {@link Group}. 273 <p> 274 * <p> 275 * @note Attempting to add an object to an {@link SBMLDocument} having a different 276 * combination of SBML Level, Version and XML namespaces than the object 277 * itself will result in an error at the time a caller attempts to make the 278 * addition. A parent object must have compatible Level, Version and XML 279 * namespaces. (Strictly speaking, a parent may also have more XML 280 * namespaces than a child, but the reverse is not permitted.) The 281 * restriction is necessary to ensure that an SBML model has a consistent 282 * overall structure. This requires callers to manage their objects 283 * carefully, but the benefit is increased flexibility in how models can be 284 * created by permitting callers to create objects bottom-up if desired. In 285 * situations where objects are not yet attached to parents (e.g., 286 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 287 * libSBML determine such things as whether it is valid to assign a 288 * particular value to an attribute. For packages, this means that the 289 * parent object to which this package element is being added must have 290 * been created with the package namespace, or that the package namespace 291 * was added to it, even if that parent is not a package object itself. 292 */ public 293 Group(long level) throws org.sbml.libsbml.SBMLConstructorException { 294 this(libsbmlJNI.new_Group__SWIG_2(level), true); 295 } 296 297 298/** 299 * Creates a new {@link Group} using the given SBML Level, Version and 300 * “groups” package version. 301 <p> 302 * @param level a long integer, the SBML Level to assign to this {@link Group}. 303 <p> 304 * @param version a long integer, the SBML Version to assign to this {@link Group}. 305 <p> 306 * @param pkgVersion a long integer, the SBML Groups Version to assign to 307 * this {@link Group}. 308 <p> 309 * <p> 310 * @note Attempting to add an object to an {@link SBMLDocument} having a different 311 * combination of SBML Level, Version and XML namespaces than the object 312 * itself will result in an error at the time a caller attempts to make the 313 * addition. A parent object must have compatible Level, Version and XML 314 * namespaces. (Strictly speaking, a parent may also have more XML 315 * namespaces than a child, but the reverse is not permitted.) The 316 * restriction is necessary to ensure that an SBML model has a consistent 317 * overall structure. This requires callers to manage their objects 318 * carefully, but the benefit is increased flexibility in how models can be 319 * created by permitting callers to create objects bottom-up if desired. In 320 * situations where objects are not yet attached to parents (e.g., 321 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 322 * libSBML determine such things as whether it is valid to assign a 323 * particular value to an attribute. For packages, this means that the 324 * parent object to which this package element is being added must have 325 * been created with the package namespace, or that the package namespace 326 * was added to it, even if that parent is not a package object itself. 327 */ public 328 Group() throws org.sbml.libsbml.SBMLConstructorException { 329 this(libsbmlJNI.new_Group__SWIG_3(), true); 330 } 331 332 333/** 334 * Creates a new {@link Group} using the given {@link GroupsPkgNamespaces} object. 335 <p> 336 * <p> 337 * The package namespaces object used in this constructor is derived from a 338 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces 339 * information. It is used to communicate the SBML Level, Version, and 340 * package version and name information used in addition to SBML Level 3 Core. A 341 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 342 * package namespace object somewhere in a program once, then hand that object 343 * as needed to object constructors of that package that accept it as and 344 * argument, such as this one. 345 <p> 346 * @param groupsns the {@link GroupsPkgNamespaces} object. 347 <p> 348 * <p> 349 * @note Attempting to add an object to an {@link SBMLDocument} having a different 350 * combination of SBML Level, Version and XML namespaces than the object 351 * itself will result in an error at the time a caller attempts to make the 352 * addition. A parent object must have compatible Level, Version and XML 353 * namespaces. (Strictly speaking, a parent may also have more XML 354 * namespaces than a child, but the reverse is not permitted.) The 355 * restriction is necessary to ensure that an SBML model has a consistent 356 * overall structure. This requires callers to manage their objects 357 * carefully, but the benefit is increased flexibility in how models can be 358 * created by permitting callers to create objects bottom-up if desired. In 359 * situations where objects are not yet attached to parents (e.g., 360 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 361 * libSBML determine such things as whether it is valid to assign a 362 * particular value to an attribute. For packages, this means that the 363 * parent object to which this package element is being added must have 364 * been created with the package namespace, or that the package namespace 365 * was added to it, even if that parent is not a package object itself. 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 3 Version 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} as a {@link GroupKind_t}. 433 <p> 434 * . 435 * The possible values returned by this method are: 436 * <ul> 437 * <li> {@link libsbmlConstants#GROUP_KIND_CLASSIFICATION GROUP_KIND_CLASSIFICATION} 438 * <li> {@link libsbmlConstants#GROUP_KIND_PARTONOMY GROUP_KIND_PARTONOMY} 439 * <li> {@link libsbmlConstants#GROUP_KIND_COLLECTION GROUP_KIND_COLLECTION} 440 * <li> {@link libsbmlConstants#GROUP_KIND_UNKNOWN GROUP_KIND_UNKNOWN} 441 * </ul> 442 */ public 443 int getKind() { 444 return libsbmlJNI.Group_getKind(swigCPtr, this); 445 } 446 447 448/** 449 * Returns the value of the 'kind' attribute of this {@link Group}. 450 <p> 451 * <p> 452 * The attribute 'kind' on a {@link Group} object is used to indicate the nature of 453 * the group defined by a particular {@link Group} instance. In the SBML 454 * Level 3 Version 1 {@link Group} specification, there are only three 455 * allowable values for 'kind': 456 * <ul> 457 * <li> <code>'classification'</code>, to indicate that the group represents a class, 458 * and its members have an <em>is-a</em> relationship to the group. 459 <p> 460 * <li> <code>'partonomy'</code>, to indicate that the group represents a collection of 461 * parts, and its members have a <em>part-of</em> relationship to the group. 462 <p> 463 * <li> <code>'collection'</code>, to indicate that the grouping is merely a collection 464 * for convenience, without an implied relationship between the members. 465 * </ul> 466 <p> 467 * @return the value of the 'kind' attribute of this {@link Group} as a string. 468 * The possible values returned by this method are: 469 * <ul> 470 * <li> <code>'classification'</code> 471 * <li> <code>'partonomy'</code> 472 * <li> <code>'collection'</code> 473 * <li> <code>'unknown'</code> 474 * </ul> 475 */ public 476 String getKindAsString() { 477 return libsbmlJNI.Group_getKindAsString(swigCPtr, this); 478 } 479 480 481/** 482 * Predicate returning <code>true</code> if this {@link Group}'s 'id' attribute is set. 483 <p> 484 * @return <code>true</code> if this {@link Group}'s 'id' attribute has been set, otherwise 485 * <code>false</code> is returned. 486 */ public 487 boolean isSetId() { 488 return libsbmlJNI.Group_isSetId(swigCPtr, this); 489 } 490 491 492/** 493 * Predicate returning <code>true</code> if this {@link Group}'s 'name' attribute is set. 494 <p> 495 * @return <code>true</code> if this {@link Group}'s 'name' attribute has been set, otherwise 496 * <code>false</code> is returned. 497 */ public 498 boolean isSetName() { 499 return libsbmlJNI.Group_isSetName(swigCPtr, this); 500 } 501 502 503/** 504 * Predicate returning <code>true</code> if this {@link Group}'s 'kind' attribute is set. 505 <p> 506 * @return <code>true</code> if this {@link Group}'s 'kind' attribute has been set, otherwise 507 * <code>false</code> is returned. 508 <p> 509 * <p> 510 * The attribute 'kind' on a {@link Group} object is used to indicate the nature of 511 * the group defined by a particular {@link Group} instance. In the SBML 512 * Level 3 Version 1 {@link Group} specification, there are only three 513 * allowable values for 'kind': 514 * <ul> 515 * <li> <code>'classification'</code>, to indicate that the group represents a class, 516 * and its members have an <em>is-a</em> relationship to the group. 517 <p> 518 * <li> <code>'partonomy'</code>, to indicate that the group represents a collection of 519 * parts, and its members have a <em>part-of</em> relationship to the group. 520 <p> 521 * <li> <code>'collection'</code>, to indicate that the grouping is merely a collection 522 * for convenience, without an implied relationship between the members. 523 * </ul> 524 */ public 525 boolean isSetKind() { 526 return libsbmlJNI.Group_isSetKind(swigCPtr, this); 527 } 528 529 530/** 531 * Sets the value of the 'id' attribute of this {@link Group}. 532 <p> 533 * @param id String& value of the 'id' attribute to be set. 534 <p> 535 * <p> 536 * @return integer value indicating success/failure of the 537 * function. The possible values 538 * returned by this function are: 539 * <ul> 540 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 541 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 542 * 543 * </ul> <p> 544 * Calling this function with <code>id</code> = <code>null</code> or an empty string is 545 * equivalent to calling unsetId(). 546 */ public 547 int setId(String id) { 548 return libsbmlJNI.Group_setId(swigCPtr, this, id); 549 } 550 551 552/** 553 * Sets the value of the 'name' attribute of this {@link Group}. 554 <p> 555 * @param name String& value of the 'name' attribute to be set. 556 <p> 557 * <p> 558 * @return integer value indicating success/failure of the 559 * function. This particular 560 * function only does one thing irrespective of user input or 561 * object state, and thus will only return a single value: 562 * <ul> 563 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 564 * 565 * </ul> <p> 566 * Calling this function with <code>name</code> = <code>null</code> or an empty string is 567 * equivalent to calling unsetName(). 568 */ public 569 int setName(String name) { 570 return libsbmlJNI.Group_setName(swigCPtr, this, name); 571 } 572 573 574/** 575 * Sets the value of the 'kind' attribute of this {@link Group}. 576 <p> 577 * @param kind int value of the 578 * 'kind' attribute to be set. 579 * The value must be one of the predefined constants that represent 580 * valid SBML Level 3 Version 1 {@link Group} 'kind' names, which 581 * means it must be one of the following values: 582 * <ul> 583 * <li> {@link libsbmlConstants#GROUP_KIND_CLASSIFICATION GROUP_KIND_CLASSIFICATION} 584 * <li> {@link libsbmlConstants#GROUP_KIND_PARTONOMY GROUP_KIND_PARTONOMY} 585 * <li> {@link libsbmlConstants#GROUP_KIND_COLLECTION GROUP_KIND_COLLECTION}. 586 * 587 * </ul> <p> 588 * <p> 589 * @return integer value indicating success/failure of the 590 * function. The possible values 591 * returned by this function are: 592 * <ul> 593 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 594 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 595 * 596 * </ul> <p> 597 * <p> 598 * The attribute 'kind' on a {@link Group} object is used to indicate the nature of 599 * the group defined by a particular {@link Group} instance. In the SBML 600 * Level 3 Version 1 {@link Group} specification, there are only three 601 * allowable values for 'kind': 602 * <ul> 603 * <li> <code>'classification'</code>, to indicate that the group represents a class, 604 * and its members have an <em>is-a</em> relationship to the group. 605 <p> 606 * <li> <code>'partonomy'</code>, to indicate that the group represents a collection of 607 * parts, and its members have a <em>part-of</em> relationship to the group. 608 <p> 609 * <li> <code>'collection'</code>, to indicate that the grouping is merely a collection 610 * for convenience, without an implied relationship between the members. 611 * </ul> 612 */ public 613 int setKind(int kind) { 614 return libsbmlJNI.Group_setKind__SWIG_0(swigCPtr, this, kind); 615 } 616 617 618/** 619 * Sets the value of the 'kind' attribute of this {@link Group}. 620 <p> 621 * @param kind String& of the 'kind' attribute to be set. The value 622 * must be one of the following possible strings: 623 * <ul> 624 * <li> 'classification' 625 * <li> 'partonomy' 626 * <li> 'collection' 627 * 628 * </ul> <p> 629 * <p> 630 * @return integer value indicating success/failure of the 631 * function. The possible values 632 * returned by this function are: 633 * <ul> 634 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 635 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 636 * 637 * </ul> <p> 638 * <p> 639 * The attribute 'kind' on a {@link Group} object is used to indicate the nature of 640 * the group defined by a particular {@link Group} instance. In the SBML 641 * Level 3 Version 1 {@link Group} specification, there are only three 642 * allowable values for 'kind': 643 * <ul> 644 * <li> <code>'classification'</code>, to indicate that the group represents a class, 645 * and its members have an <em>is-a</em> relationship to the group. 646 <p> 647 * <li> <code>'partonomy'</code>, to indicate that the group represents a collection of 648 * parts, and its members have a <em>part-of</em> relationship to the group. 649 <p> 650 * <li> <code>'collection'</code>, to indicate that the grouping is merely a collection 651 * for convenience, without an implied relationship between the members. 652 * </ul> 653 */ public 654 int setKind(String kind) { 655 return libsbmlJNI.Group_setKind__SWIG_1(swigCPtr, this, kind); 656 } 657 658 659/** 660 * Unsets the value of the 'id' attribute of this {@link Group}. 661 <p> 662 * <p> 663 * @return integer value indicating success/failure of the 664 * function. The possible values 665 * returned by this function are: 666 * <ul> 667 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 668 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 669 * </ul> 670 */ public 671 int unsetId() { 672 return libsbmlJNI.Group_unsetId(swigCPtr, this); 673 } 674 675 676/** 677 * Unsets the value of the 'name' attribute of this {@link Group}. 678 <p> 679 * <p> 680 * @return integer value indicating success/failure of the 681 * function. The possible values 682 * returned by this function are: 683 * <ul> 684 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 685 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 686 * </ul> 687 */ public 688 int unsetName() { 689 return libsbmlJNI.Group_unsetName(swigCPtr, this); 690 } 691 692 693/** 694 * Unsets the value of the 'kind' attribute of this {@link Group}. 695 <p> 696 * <p> 697 * @return integer value indicating success/failure of the 698 * function. This particular 699 * function only does one thing irrespective of user input or 700 * object state, and thus will only return a single value: 701 * <ul> 702 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 703 * 704 * </ul> <p> 705 * <p> 706 * The attribute 'kind' on a {@link Group} object is used to indicate the nature of 707 * the group defined by a particular {@link Group} instance. In the SBML 708 * Level 3 Version 1 {@link Group} specification, there are only three 709 * allowable values for 'kind': 710 * <ul> 711 * <li> <code>'classification'</code>, to indicate that the group represents a class, 712 * and its members have an <em>is-a</em> relationship to the group. 713 <p> 714 * <li> <code>'partonomy'</code>, to indicate that the group represents a collection of 715 * parts, and its members have a <em>part-of</em> relationship to the group. 716 <p> 717 * <li> <code>'collection'</code>, to indicate that the grouping is merely a collection 718 * for convenience, without an implied relationship between the members. 719 * </ul> 720 */ public 721 int unsetKind() { 722 return libsbmlJNI.Group_unsetKind(swigCPtr, this); 723 } 724 725 726/** 727 * Returns the {@link ListOfMembers} from this {@link Group}. 728 <p> 729 * Using the SBML Level 3 Groups package, the membership of a group 730 * is determined by the contents of the list of members stored in {@link Member} 731 * objects within the {@link ListOfMembers} child of a {@link Group} object. 732 <p> 733 * @return the {@link ListOfMembers} from this {@link Group}. 734 <p> 735 * <p> 736 * The pointer that is returned by this function is not owned by the caller, 737 * but may be queried and modified. Any changes made will be reflected in any 738 * resulting SBML document containing the pointer's parent. 739 <p> 740 * @see #addMember(Member object) 741 * @see #createMember() 742 * @see #getMember(String sid) 743 * @see #getMember(long n) 744 * @see #getNumMembers() 745 * @see #removeMember(String sid) 746 * @see #removeMember(long n) 747 */ public 748 ListOfMembers getListOfMembers() { 749 long cPtr = libsbmlJNI.Group_getListOfMembers__SWIG_0(swigCPtr, this); 750 return (cPtr == 0) ? null : new ListOfMembers(cPtr, false); 751 } 752 753 754/** 755 * Get a {@link Member} from the {@link Group}. 756 <p> 757 * @param n a long integer representing the index of the {@link Member} to retrieve. 758 <p> 759 * @return the nth {@link Member} in the {@link ListOfMembers} within this {@link Group}. 760 <p> 761 * <p> 762 * The pointer that is returned by this function is not owned by the caller, 763 * but may be queried and modified. Any changes made will be reflected in any 764 * resulting SBML document containing the pointer's parent. 765 <p> 766 * @see #addMember(Member object) 767 * @see #createMember() 768 * @see #getMember(String sid) 769 * @see #getNumMembers() 770 * @see #removeMember(String sid) 771 * @see #removeMember(long n) 772 */ public 773 Member getMember(long n) { 774 long cPtr = libsbmlJNI.Group_getMember__SWIG_0(swigCPtr, this, n); 775 return (cPtr == 0) ? null : new Member(cPtr, false); 776 } 777 778 779/** 780 * Get a {@link Member} from the {@link Group} based on its identifier. 781 <p> 782 * @param sid a string representing the identifier of the {@link Member} to retrieve. 783 <p> 784 * @return the {@link Member} in the {@link ListOfMembers} within this {@link Group} with the given 785 * <code>sid</code> or <code>null</code> if no such {@link Member} exists. 786 <p> 787 * <p> 788 * The pointer that is returned by this function is not owned by the caller, 789 * but may be queried and modified. Any changes made will be reflected in any 790 * resulting SBML document containing the pointer's parent. 791 <p> 792 * @see #addMember(Member object) 793 * @see #createMember() 794 * @see #getMember(long n) 795 * @see #getNumMembers() 796 * @see #removeMember(String sid) 797 * @see #removeMember(long n) 798 */ public 799 Member getMember(String sid) { 800 long cPtr = libsbmlJNI.Group_getMember__SWIG_2(swigCPtr, this, sid); 801 return (cPtr == 0) ? null : new Member(cPtr, false); 802 } 803 804 805/** 806 * Get a {@link Member} from the {@link Group} based on the element to which it refers. 807 <p> 808 * @param sid a string representing the 'idRef' attribute of the {@link Member} 809 * object to retrieve. 810 <p> 811 * @return the first {@link Member} in this {@link Group} based on the given idRef attribute 812 * or null if no such {@link Member} exists. 813 <p> 814 * <p> 815 * The pointer that is returned by this function is not owned by the caller, 816 * but may be queried and modified. Any changes made will be reflected in any 817 * resulting SBML document containing the pointer's parent. 818 */ public 819 Member getMemberByIdRef(String sid) { 820 long cPtr = libsbmlJNI.Group_getMemberByIdRef__SWIG_0(swigCPtr, this, sid); 821 return (cPtr == 0) ? null : new Member(cPtr, false); 822 } 823 824 825/** 826 * Adds a copy of the given {@link Member} to this {@link Group}. 827 <p> 828 * @param m the {@link Member} object to add. 829 <p> 830 * <p> 831 * @return integer value indicating success/failure of the 832 * function. The possible values 833 * returned by this function are: 834 * <ul> 835 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 836 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 837 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 838 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 839 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 840 * <li> {@link libsbmlConstants#LIBSBML_PKG_VERSION_MISMATCH LIBSBML_PKG_VERSION_MISMATCH} 841 * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID} 842 * 843 * </ul> <p> 844 * <p> 845 * @note This method should be used with some caution. The fact that this 846 * method <em>copies</em> the object passed to it means that the caller will be 847 * left holding a physically different object instance than the one contained 848 * inside this object. Changes made to the original object instance (such as 849 * resetting attribute values) will <em>not affect the instance in this 850 * object</em>. In addition, the caller should make sure to free the 851 * original object if it is no longer being used, or else a memory leak will 852 * result. Please see other methods on this class (particularly a 853 * corresponding method whose name begins with the word <code>create</code>) 854 * for alternatives that do not lead to these issues. 855 <p> 856 * @see #createMember() 857 * @see #getMember(String sid) 858 * @see #getMember(long n) 859 * @see #getNumMembers() 860 * @see #removeMember(String sid) 861 * @see #removeMember(long n) 862 */ public 863 int addMember(Member m) { 864 return libsbmlJNI.Group_addMember(swigCPtr, this, Member.getCPtr(m), m); 865 } 866 867 868/** 869 * Get the number of {@link Member} objects in this {@link Group}. 870 <p> 871 * @return the number of {@link Member} objects in this {@link Group}. 872 <p> 873 * @see #addMember(Member object) 874 * @see #createMember() 875 * @see #getMember(String sid) 876 * @see #getMember(long n) 877 * @see #removeMember(String sid) 878 * @see #removeMember(long n) 879 */ public 880 long getNumMembers() { 881 return libsbmlJNI.Group_getNumMembers(swigCPtr, this); 882 } 883 884 885/** 886 * Creates a new {@link Member} object, adds it to this {@link Group} object and returns the 887 * {@link Member} object created. 888 <p> 889 * @return a new {@link Member} object instance. 890 <p> 891 * <p> 892 * The pointer that is returned by this function is not owned by the caller, 893 * but may be queried and modified. Any changes made will be reflected in any 894 * resulting SBML document containing the pointer's parent. 895 <p> 896 * @see #addMember(Member object) 897 * @see #getMember(String sid) 898 * @see #getMember(long n) 899 * @see #getNumMembers() 900 * @see #removeMember(String sid) 901 * @see #removeMember(long n) 902 */ public 903 Member createMember() { 904 long cPtr = libsbmlJNI.Group_createMember(swigCPtr, this); 905 return (cPtr == 0) ? null : new Member(cPtr, false); 906 } 907 908 909/** 910 * Removes the nth {@link Member} from this {@link Group} and returns a pointer to it. 911 <p> 912 * @param n a long integer representing the index of the {@link Member} to remove. 913 <p> 914 * @return a pointer to the nth {@link Member} in this {@link Group}. 915 <p> 916 * <p> 917 * The pointer that is returned by this function is owned by the caller, 918 * who is responsible for deleting it. Any changes made to the element 919 * will not be reflected in any resulting SBML document unless the element 920 * is added to an SBML Document. Even in this case, the element's deletion is 921 * still the responsibility of the caller with two exceptions: if it is used 922 * as the 'disownedItem' in the * {@link ListOf#appendAndOwn()} or {@link ListOf#insertAndOwn()} 923 * functions. All other functions in libsbml add a copy of the element, 924 * and do not transfer ownership of the pointer. 925 <p> 926 * @see #addMember(Member object) 927 * @see #createMember() 928 * @see #getMember(String sid) 929 * @see #getMember(long n) 930 * @see #getNumMembers() 931 * @see #removeMember(String sid) 932 */ public 933 Member removeMember(long n) { 934 long cPtr = libsbmlJNI.Group_removeMember__SWIG_0(swigCPtr, this, n); 935 return (cPtr == 0) ? null : new Member(cPtr, true); 936 } 937 938 939/** 940 * Removes the {@link Member} from this {@link Group} based on its identifier and returns a 941 * pointer to it. 942 <p> 943 * @param sid a string representing the identifier of the {@link Member} to remove. 944 <p> 945 * @return the {@link Member} in this {@link Group} based on the identifier or null if no 946 * such {@link Member} exists. 947 <p> 948 * <p> 949 * The pointer that is returned by this function is owned by the caller, 950 * who is responsible for deleting it. Any changes made to the element 951 * will not be reflected in any resulting SBML document unless the element 952 * is added to an SBML Document. Even in this case, the element's deletion is 953 * still the responsibility of the caller with two exceptions: if it is used 954 * as the 'disownedItem' in the * {@link ListOf#appendAndOwn()} or {@link ListOf#insertAndOwn()} 955 * functions. All other functions in libsbml add a copy of the element, 956 * and do not transfer ownership of the pointer. 957 <p> 958 * @see #addMember(Member object) 959 * @see #createMember() 960 * @see #getMember(String sid) 961 * @see #getMember(long n) 962 * @see #getNumMembers() 963 * @see #removeMember(long n) 964 */ public 965 Member removeMember(String sid) { 966 long cPtr = libsbmlJNI.Group_removeMember__SWIG_1(swigCPtr, this, sid); 967 return (cPtr == 0) ? null : new Member(cPtr, true); 968 } 969 970 971/** 972 * Returns the XML element name of this {@link Group} object. 973 <p> 974 * For {@link Group}, the XML element name is always <code>'group'.</code> 975 <p> 976 * @return the name of this element, i.e. <code>'group'.</code> 977 */ public 978 String getElementName() { 979 return libsbmlJNI.Group_getElementName(swigCPtr, this); 980 } 981 982 983/** 984 * Returns the libSBML type code for this {@link Group} object. 985 <p> 986 * <p> 987 * LibSBML attaches an identifying code to every kind of SBML object. These 988 * are integer constants known as <em>SBML type codes</em>. The names of all 989 * the codes begin with the characters <code>SBML_</code>. 990 * In the Java language interface for libSBML, the 991 * type codes are defined as static integer constants in the interface class 992 * {@link libsbmlConstants}. Note that different Level 3 993 * package plug-ins may use overlapping type codes; to identify the package 994 * to which a given object belongs, call the 995 * <code>{@link SBase#getPackageName()} 996 * </code> 997 * method on the object. 998 <p> 999 * @return the SBML type code for this object: 1000 * {@link libsbmlConstants#SBML_GROUPS_GROUP SBML_GROUPS_GROUP} 1001 <p> 1002 * <p> 1003 * @warning <span class='warning'>The specific integer values of the possible 1004 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 1005 * packages, To fully identify the correct code, <strong>it is necessary to 1006 * invoke both getTypeCode() and getPackageName()</strong>.</span> 1007 <p> 1008 * @see #getElementName() 1009 * @see #getPackageName() 1010 */ public 1011 int getTypeCode() { 1012 return libsbmlJNI.Group_getTypeCode(swigCPtr, this); 1013 } 1014 1015 1016/** 1017 * Predicate returning <code>true</code> if all the required attributes for this {@link Group} 1018 * object have been set. 1019 <p> 1020 * @return <code>true</code> to indicate that all the required attributes of this {@link Group} 1021 * have been set, otherwise <code>false</code> is returned. 1022 <p> 1023 * @note The required attributes for the {@link Group} object are: 1024 * <ul> 1025 * <li> 'kind' 1026 * </ul> 1027 */ public 1028 boolean hasRequiredAttributes() { 1029 return libsbmlJNI.Group_hasRequiredAttributes(swigCPtr, this); 1030 } 1031 1032 1033/** * @internal */ public 1034 void connectToChild() { 1035 libsbmlJNI.Group_connectToChild(swigCPtr, this); 1036 } 1037 1038 1039/** * @internal */ public 1040 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 1041 libsbmlJNI.Group_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 1042 } 1043 1044 1045/** 1046 * Returns the first child element that has the given <code>id</code> in the model-wide 1047 * SId namespace, or <code>null</code> if no such object is found. 1048 <p> 1049 * @param id a string representing the id attribute of the object to 1050 * retrieve. 1051 <p> 1052 * @return a pointer to the {@link SBase} element with the given <code>id</code>. If no such 1053 * object is found, this method returns <code>null.</code> 1054 */ public 1055 SBase getElementBySId(String id) { 1056 return libsbml.DowncastSBase(libsbmlJNI.Group_getElementBySId(swigCPtr, this, id), false); 1057} 1058 1059 1060/** 1061 * Returns the first child element that has the given <code>metaid</code>, or <code>null</code> 1062 * if no such object is found. 1063 <p> 1064 * @param metaid a string representing the metaid attribute of the object to 1065 * retrieve. 1066 <p> 1067 * @return a pointer to the {@link SBase} element with the given <code>metaid</code>. If no 1068 * such object is found this method returns <code>null.</code> 1069 */ public 1070 SBase getElementByMetaId(String metaid) { 1071 return libsbml.DowncastSBase(libsbmlJNI.Group_getElementByMetaId(swigCPtr, this, metaid), false); 1072} 1073 1074}