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 A list of {@link Member} objects. 014 <p> 015 * In the SBML Level 3 Groups package, the membership of a group is 016 * defined by placing {@link Member} objects within a {@link ListOfMembers} object contained 017 * within a {@link Group} object. A {@link ListOfMembers} object is optional, but, if 018 * present, it must contain at least one {@link Member} object. In common with other 019 * ListOf___ classes in SBML, {@link ListOfMembers} is derived from {@link SBase}. However, 020 * an uncommon feature of {@link ListOfMembers} is that it has optional 'id' and 021 * 'name' attributes that can be used in a manner discussed below. 022 <p> 023 * A {@link ListOfMembers} must have one or more {@link Member} children. Since {@link ListOfMembers} 024 * is derived from {@link SBase}, it inherits the 'sboTerm' and 'metaid' attributes, 025 * as well as the optional children Notes and Annotation. Unlike most lists 026 * of objects in SBML, however, the 'sboTerm' attribute and the Notes and 027 * Annotation children are taken here to apply directly to every SBML element 028 * referenced by each child {@link Member} of this {@link ListOfMembers}, if that referenced 029 * element has no such definition. Thus, if a referenced element has no 030 * defined 'sboTerm' attribute or child Notes or Annotation objects, that 031 * element should be considered to now have the 'sboTerm', child Notes, or 032 * child Annotation of the {@link ListOfMembers}. 033 <p> 034 * If multiple {@link ListOfMembers} have child {@link Member} elements that reference 035 * the same SBML element, and more than one {@link ListOfMembers} or {@link Member} has 036 * a value for an sboTerm attribute, Notes, or Annotation element, those 037 * {@link Member} elements should be consistent with each other: the 'sboTerm' 038 * attributes should either be identical, or one should inherit from 039 * the other; Notes should say the same or similar things; and Annotation 040 * elements should not conflict. Interpreters may choose to resolve any 041 * such conflicts arbitrarily. 042 <p> 043 * An uncommon feature about {@link ListOfMembers} is that, if it is referenced by a 044 * {@link Member} of a different {@link Group}, the <em>children</em> of the referenced 045 * {@link ListOfMembers} are also considered to be members of the referencing group. 046 * In this way, groups may be nested semantically to create larger groups out 047 * of subgroups. 048 <p> 049 * <h2>Semantics of group memberships</h2> 050 <p> 051 * <p> 052 * If a {@link Member} object within a {@link Group} object's {@link ListOfMembers} references 053 * another {@link Group} object, it is the <em>referenced {@link Group} itself</em> that is 054 * considered to be a member of the parent {@link Group}, <em>not</em> the corresponding 055 * referenced model component(s). This is true regardless of whether those 056 * components themselves happen to point to other components using some 057 * mechanism defined by another SBML Level 3 package (as happens, for 058 * example, in the SBML Level 3 Hierarchical Model Composition package 059 * and its use of {@link SBaseRef}). However, if instead a {@link Member} object references 060 * a {@link ListOfMembers} object (using the 'id' attribute permitted on 061 * {@link ListOfMembers} objects), it is the components of that {@link ListOfMembers} that 062 * are considered to be part of the parent {@link Group}. In other words: if in some 063 * {@link Group} <em>G</em>, a {@link Member} <em>M</em> references another {@link Group}, that {@link Group} is the 064 * member of <em>G</em>; if <em>M</em> references a {@link ListOfMembers}, it is the entities 065 * referenced by the {@link Member} objects within the {@link ListOfMembers} that are 066 * the members of <em>G</em> and not the {@link ListOfMembers} object itself. 067 <p> 068 * The implication of this is that any rule that applies to members of a 069 * group (such the meaning of the 'kind' attribute, or the restrictions on 070 * the application of 'sboTerm' attributes on a {@link ListOfMembers}) applies to the 071 * child group when referenced by the {@link Group} 'id', and to the members of the 072 * child group when referenced by the {@link ListOfMembers} 'id'. In an example 073 * situation where a parent group includes two {@link Species} plus a {@link Group} which 074 * itself contains three other {@link Species}, if the parent group's {@link ListOfMembers} 075 * is given an 'sboTerm' attribute value, that {@link SBO} term applies to the two 076 * species and the group, not to the three child species members of the 077 * second group. (Note also that in such a case, the parent group's 'kind' 078 * attribute value would almost certainly be <code>'collection'</code> or 079 * <code>'partonomy'</code>, and not <code>'classification'</code>, as two species and a group are 080 * very unlikely to be classified as the same thing.) In contrast, in the 081 * situation where a parent group includes two {@link Species} plus a {@link ListOfMembers} 082 * which contains three other {@link Species}, the parent group's {@link ListOfMembers} 083 * 'sboTerm' would apply to the five {@link Species}, and could be more reasonably 084 * marked as a <code>'classification'.</code> 085 <p> 086 * In a future version of this SBML Level 3 Groups specification, it may 087 * be possible to perform set operations on groups, but for now, this type of 088 * union is the only set operation that is possible. 089 <p> 090 * Groups are not permitted to be circular: no {@link Member} may reference itself, 091 * its parent {@link ListOfMembers}, nor its parent {@link Group}. If a {@link Member} references a 092 * {@link Group}, the same restrictions apply to that subgroup's children: they may 093 * not reference the {@link Member}, its parent {@link ListOfMembers}, nor its parent {@link Group}, 094 * and if any of those children reference a {@link Group}, the same restrictions apply 095 * to them, etc. 096 <p> 097 * If a {@link Member} has a 'idRef' or 'metaIdRef' attribute which references an 098 * object from a namespace that is not understood by the interpreter of the 099 * SBML model, that {@link Member} must be ignored. The referenced object will not be 100 * understood by the interpreter, and therefore has no need to become a 101 * member of the group. If an interpreter cannot tell whether a referenced 102 * object does not exist or if exists in an unparsed namespace, it may choose 103 * to produce a warning. 104 <p> 105 * @see Group 106 * @see Member 107 * @see ListOfGroups 108 */ 109 110public class ListOfMembers extends ListOf { 111 private long swigCPtr; 112 113 protected ListOfMembers(long cPtr, boolean cMemoryOwn) 114 { 115 super(libsbmlJNI.ListOfMembers_SWIGUpcast(cPtr), cMemoryOwn); 116 swigCPtr = cPtr; 117 } 118 119 protected static long getCPtr(ListOfMembers obj) 120 { 121 return (obj == null) ? 0 : obj.swigCPtr; 122 } 123 124 protected static long getCPtrAndDisown (ListOfMembers obj) 125 { 126 long ptr = 0; 127 128 if (obj != null) 129 { 130 ptr = obj.swigCPtr; 131 obj.swigCMemOwn = false; 132 } 133 134 return ptr; 135 } 136 137 protected void finalize() { 138 delete(); 139 } 140 141 public synchronized void delete() { 142 if (swigCPtr != 0) { 143 if (swigCMemOwn) { 144 swigCMemOwn = false; 145 libsbmlJNI.delete_ListOfMembers(swigCPtr); 146 } 147 swigCPtr = 0; 148 } 149 super.delete(); 150 } 151 152 153/** 154 * Creates a new {@link ListOfMembers} using the given SBML Level, Version and 155 * “groups” package version. 156 <p> 157 * @param level a long integer, the SBML Level to assign to this 158 * {@link ListOfMembers}. 159 <p> 160 * @param version a long integer, the SBML Version to assign to this 161 * {@link ListOfMembers}. 162 <p> 163 * @param pkgVersion a long integer, the SBML Groups Version to assign to 164 * this {@link ListOfMembers}. 165 <p> 166 * @throws SBMLConstructorException 167 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind of 168 * SBML object, are either invalid or mismatched with respect to the parent 169 * {@link SBMLDocument} object. 170 * <p> 171 * @note Attempting to add an object to an {@link SBMLDocument} having a different 172 * combination of SBML Level, Version and XML namespaces than the object 173 * itself will result in an error at the time a caller attempts to make the 174 * addition. A parent object must have compatible Level, Version and XML 175 * namespaces. (Strictly speaking, a parent may also have more XML 176 * namespaces than a child, but the reverse is not permitted.) The 177 * restriction is necessary to ensure that an SBML model has a consistent 178 * overall structure. This requires callers to manage their objects 179 * carefully, but the benefit is increased flexibility in how models can be 180 * created by permitting callers to create objects bottom-up if desired. In 181 * situations where objects are not yet attached to parents (e.g., 182 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 183 * libSBML determine such things as whether it is valid to assign a 184 * particular value to an attribute. 185 */ public 186 ListOfMembers(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 187 this(libsbmlJNI.new_ListOfMembers__SWIG_0(level, version, pkgVersion), true); 188 } 189 190 191/** 192 * Creates a new {@link ListOfMembers} using the given SBML Level, Version and 193 * “groups” package version. 194 <p> 195 * @param level a long integer, the SBML Level to assign to this 196 * {@link ListOfMembers}. 197 <p> 198 * @param version a long integer, the SBML Version to assign to this 199 * {@link ListOfMembers}. 200 <p> 201 * @param pkgVersion a long integer, the SBML Groups Version to assign to 202 * this {@link ListOfMembers}. 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 * @note Attempting to add an object to an {@link SBMLDocument} having a different 210 * combination of SBML Level, Version and XML namespaces than the object 211 * itself will result in an error at the time a caller attempts to make the 212 * addition. A parent object must have compatible Level, Version and XML 213 * namespaces. (Strictly speaking, a parent may also have more XML 214 * namespaces than a child, but the reverse is not permitted.) The 215 * restriction is necessary to ensure that an SBML model has a consistent 216 * overall structure. This requires callers to manage their objects 217 * carefully, but the benefit is increased flexibility in how models can be 218 * created by permitting callers to create objects bottom-up if desired. In 219 * situations where objects are not yet attached to parents (e.g., 220 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 221 * libSBML determine such things as whether it is valid to assign a 222 * particular value to an attribute. 223 */ public 224 ListOfMembers(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 225 this(libsbmlJNI.new_ListOfMembers__SWIG_1(level, version), true); 226 } 227 228 229/** 230 * Creates a new {@link ListOfMembers} using the given SBML Level, Version and 231 * “groups” package version. 232 <p> 233 * @param level a long integer, the SBML Level to assign to this 234 * {@link ListOfMembers}. 235 <p> 236 * @param version a long integer, the SBML Version to assign to this 237 * {@link ListOfMembers}. 238 <p> 239 * @param pkgVersion a long integer, the SBML Groups Version to assign to 240 * this {@link ListOfMembers}. 241 <p> 242 * @throws SBMLConstructorException 243 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind of 244 * SBML object, are either invalid or mismatched with respect to the parent 245 * {@link SBMLDocument} object. 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 ListOfMembers(long level) throws org.sbml.libsbml.SBMLConstructorException { 263 this(libsbmlJNI.new_ListOfMembers__SWIG_2(level), true); 264 } 265 266 267/** 268 * Creates a new {@link ListOfMembers} using the given SBML Level, Version and 269 * “groups” package version. 270 <p> 271 * @param level a long integer, the SBML Level to assign to this 272 * {@link ListOfMembers}. 273 <p> 274 * @param version a long integer, the SBML Version to assign to this 275 * {@link ListOfMembers}. 276 <p> 277 * @param pkgVersion a long integer, the SBML Groups Version to assign to 278 * this {@link ListOfMembers}. 279 <p> 280 * @throws SBMLConstructorException 281 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind of 282 * SBML object, are either invalid or mismatched with respect to the parent 283 * {@link SBMLDocument} object. 284 * <p> 285 * @note Attempting to add an object to an {@link SBMLDocument} having a different 286 * combination of SBML Level, Version and XML namespaces than the object 287 * itself will result in an error at the time a caller attempts to make the 288 * addition. A parent object must have compatible Level, Version and XML 289 * namespaces. (Strictly speaking, a parent may also have more XML 290 * namespaces than a child, but the reverse is not permitted.) The 291 * restriction is necessary to ensure that an SBML model has a consistent 292 * overall structure. This requires callers to manage their objects 293 * carefully, but the benefit is increased flexibility in how models can be 294 * created by permitting callers to create objects bottom-up if desired. In 295 * situations where objects are not yet attached to parents (e.g., 296 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 297 * libSBML determine such things as whether it is valid to assign a 298 * particular value to an attribute. 299 */ public 300 ListOfMembers() throws org.sbml.libsbml.SBMLConstructorException { 301 this(libsbmlJNI.new_ListOfMembers__SWIG_3(), true); 302 } 303 304 305/** 306 * Creates a new {@link ListOfMembers} using the given {@link GroupsPkgNamespaces} object. 307 <p> 308 * @param groupsns the {@link GroupsPkgNamespaces} object. 309 <p> 310 * @throws SBMLConstructorException 311 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind of 312 * SBML object, are either invalid or mismatched with respect to the parent 313 * {@link SBMLDocument} object. 314 * <p> 315 * @note Attempting to add an object to an {@link SBMLDocument} having a different 316 * combination of SBML Level, Version and XML namespaces than the object 317 * itself will result in an error at the time a caller attempts to make the 318 * addition. A parent object must have compatible Level, Version and XML 319 * namespaces. (Strictly speaking, a parent may also have more XML 320 * namespaces than a child, but the reverse is not permitted.) The 321 * restriction is necessary to ensure that an SBML model has a consistent 322 * overall structure. This requires callers to manage their objects 323 * carefully, but the benefit is increased flexibility in how models can be 324 * created by permitting callers to create objects bottom-up if desired. In 325 * situations where objects are not yet attached to parents (e.g., 326 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 327 * libSBML determine such things as whether it is valid to assign a 328 * particular value to an attribute. 329 */ public 330 ListOfMembers(GroupsPkgNamespaces groupsns) throws org.sbml.libsbml.SBMLConstructorException { 331 this(libsbmlJNI.new_ListOfMembers__SWIG_4(GroupsPkgNamespaces.getCPtr(groupsns), groupsns), true); 332 } 333 334 335/** 336 * Copy constructor for {@link ListOfMembers}. 337 <p> 338 * @param orig the {@link ListOfMembers} instance to copy. 339 */ public 340 ListOfMembers(ListOfMembers orig) throws org.sbml.libsbml.SBMLConstructorException { 341 this(libsbmlJNI.new_ListOfMembers__SWIG_5(ListOfMembers.getCPtr(orig), orig), true); 342 } 343 344 345/** 346 * Creates and returns a deep copy of this {@link ListOfMembers} object. 347 <p> 348 * @return a (deep) copy of this {@link ListOfMembers} object. 349 */ public 350 ListOfMembers cloneObject() { 351 long cPtr = libsbmlJNI.ListOfMembers_cloneObject(swigCPtr, this); 352 return (cPtr == 0) ? null : new ListOfMembers(cPtr, true); 353 } 354 355 356/** 357 * Returns the value of the 'id' attribute of this {@link ListOfMembers}. 358 <p> 359 * @return the value of the 'id' attribute of this {@link ListOfMembers} as a string. 360 */ public 361 String getId() { 362 return libsbmlJNI.ListOfMembers_getId(swigCPtr, this); 363 } 364 365 366/** 367 * Returns the value of the 'name' attribute of this {@link ListOfMembers}. 368 <p> 369 * @return the value of the 'name' attribute of this {@link ListOfMembers} as a 370 * string. 371 */ public 372 String getName() { 373 return libsbmlJNI.ListOfMembers_getName(swigCPtr, this); 374 } 375 376 377/** 378 * Predicate returning <code>true</code> if this {@link ListOfMembers}'s 'id' attribute is set. 379 <p> 380 * @return <code>true</code> if this {@link ListOfMembers}'s 'id' attribute has been set, 381 * otherwise <code>false</code> is returned. 382 */ public 383 boolean isSetId() { 384 return libsbmlJNI.ListOfMembers_isSetId(swigCPtr, this); 385 } 386 387 388/** 389 * Predicate returning <code>true</code> if this {@link ListOfMembers}'s 'name' attribute is 390 * set. 391 <p> 392 * @return <code>true</code> if this {@link ListOfMembers}'s 'name' attribute has been set, 393 * otherwise <code>false</code> is returned. 394 */ public 395 boolean isSetName() { 396 return libsbmlJNI.ListOfMembers_isSetName(swigCPtr, this); 397 } 398 399 400/** 401 * Sets the value of the 'id' attribute of this {@link ListOfMembers}. 402 <p> 403 * @param id String& value of the 'id' attribute to be set. 404 <p> 405 * <p> 406 * @return integer value indicating success/failure of the 407 * function. The possible values 408 * returned by this function are: 409 * <ul> 410 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 411 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 412 * </ul> 413 */ public 414 int setId(String id) { 415 return libsbmlJNI.ListOfMembers_setId(swigCPtr, this, id); 416 } 417 418 419/** 420 * Sets the value of the 'name' attribute of this {@link ListOfMembers}. 421 <p> 422 * @param name String& value of the 'name' attribute to be set. 423 <p> 424 * <p> 425 * @return integer value indicating success/failure of the 426 * function. The possible values 427 * returned by this function are: 428 * <ul> 429 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 430 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 431 * </ul> 432 */ public 433 int setName(String name) { 434 return libsbmlJNI.ListOfMembers_setName(swigCPtr, this, name); 435 } 436 437 438/** 439 * Unsets the value of the 'id' attribute of this {@link ListOfMembers}. 440 <p> 441 * <p> 442 * @return integer value indicating success/failure of the 443 * function. The possible values 444 * returned by this function are: 445 * <ul> 446 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 447 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 448 * </ul> 449 */ public 450 int unsetId() { 451 return libsbmlJNI.ListOfMembers_unsetId(swigCPtr, this); 452 } 453 454 455/** 456 * Unsets the value of the 'name' attribute of this {@link ListOfMembers}. 457 <p> 458 * <p> 459 * @return integer value indicating success/failure of the 460 * function. The possible values 461 * returned by this function are: 462 * <ul> 463 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 464 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 465 * </ul> 466 */ public 467 int unsetName() { 468 return libsbmlJNI.ListOfMembers_unsetName(swigCPtr, this); 469 } 470 471 472/** 473 * Get a {@link Member} from the {@link ListOfMembers}. 474 <p> 475 * @param n a long integer representing the index of the {@link Member} to 476 * retrieve. 477 <p> 478 * @return the nth {@link Member} in this {@link ListOfMembers}. 479 <p> 480 * @see #size() 481 */ public 482 Member get(long n) { 483 long cPtr = libsbmlJNI.ListOfMembers_get__SWIG_0(swigCPtr, this, n); 484 return (cPtr == 0) ? null : new Member(cPtr, false); 485 } 486 487 488/** 489 * Get a {@link Member} from the {@link ListOfMembers} based on its identifier. 490 <p> 491 * @param sid a string representing the identifier of the {@link Member} to retrieve. 492 <p> 493 * @return the {@link Member} in this {@link ListOfMembers} with the given id or null if no 494 * such {@link Member} exists. 495 <p> 496 * @see #size() 497 */ public 498 Member get(String sid) { 499 long cPtr = libsbmlJNI.ListOfMembers_get__SWIG_2(swigCPtr, this, sid); 500 return (cPtr == 0) ? null : new Member(cPtr, false); 501 } 502 503 504/** 505 * Removes the nth {@link Member} from this {@link ListOfMembers} and returns a pointer to 506 * it. 507 <p> 508 * @param n a long integer representing the index of the {@link Member} to remove. 509 <p> 510 * @return a pointer to the nth {@link Member} in this {@link ListOfMembers}. 511 <p> 512 * 513 * @note the caller owns the returned object and is responsible for deleting 514 * it. 515 <p> 516 * @see #size() 517 */ public 518 Member remove(long n) { 519 long cPtr = libsbmlJNI.ListOfMembers_remove__SWIG_0(swigCPtr, this, n); 520 return (cPtr == 0) ? null : new Member(cPtr, true); 521 } 522 523 524/** 525 * Removes the {@link Member} from this {@link ListOfMembers} based on its identifier and 526 * returns a pointer to it. 527 <p> 528 * @param sid a string representing the identifier of the {@link Member} to remove. 529 <p> 530 * @return the {@link Member} in this {@link ListOfMembers} based on the identifier or null 531 * if no such {@link Member} exists. 532 <p> 533 * @note the caller owns the returned object and is responsible for deleting 534 * it. 535 */ public 536 Member remove(String sid) { 537 long cPtr = libsbmlJNI.ListOfMembers_remove__SWIG_1(swigCPtr, this, sid); 538 return (cPtr == 0) ? null : new Member(cPtr, true); 539 } 540 541 542/** 543 * Adds a copy of the given {@link Member} to this {@link ListOfMembers}. 544 <p> 545 * @param m the {@link Member} object to add. 546 <p> 547 * <p> 548 * @return integer value indicating success/failure of the 549 * function. The possible values 550 * returned by this function are: 551 * <ul> 552 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 553 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 554 * 555 * </ul> <p> 556 * <p> 557 * @note This method should be used with some caution. The fact that this 558 * method <em>copies</em> the object passed to it means that the caller will be 559 * left holding a physically different object instance than the one contained 560 * inside this object. Changes made to the original object instance (such as 561 * resetting attribute values) will <em>not affect the instance in this 562 * object</em>. In addition, the caller should make sure to free the 563 * original object if it is no longer being used, or else a memory leak will 564 * result. Please see other methods on this class (particularly a 565 * corresponding method whose name begins with the word <code>create</code>) 566 * for alternatives that do not lead to these issues. 567 <p> 568 * @see #createMember() 569 */ public 570 int addMember(Member m) { 571 return libsbmlJNI.ListOfMembers_addMember(swigCPtr, this, Member.getCPtr(m), m); 572 } 573 574 575/** 576 * Get the number of {@link Member} objects in this {@link ListOfMembers}. 577 <p> 578 * @return the number of {@link Member} objects in this {@link ListOfMembers}. 579 */ public 580 long getNumMembers() { 581 return libsbmlJNI.ListOfMembers_getNumMembers(swigCPtr, this); 582 } 583 584 585/** 586 * Creates a new {@link Member} object, adds it to this {@link ListOfMembers} object and 587 * returns the {@link Member} object created. 588 <p> 589 * @return a new {@link Member} object instance. 590 <p> 591 * @see #addMember(Member m) 592 */ public 593 Member createMember() { 594 long cPtr = libsbmlJNI.ListOfMembers_createMember(swigCPtr, this); 595 return (cPtr == 0) ? null : new Member(cPtr, false); 596 } 597 598 599/** 600 * Get a {@link Member} from the {@link ListOfMembers} based on the IdRef to which it refers. 601 <p> 602 * @param sid a string representing the idRef attribute of the {@link Member} object 603 * to retrieve. 604 <p> 605 * @return the first {@link Member} in this {@link ListOfMembers} based on the given idRef 606 * attribute or null if no such {@link Member} exists. 607 */ public 608 Member getByIdRef(String sid) { 609 long cPtr = libsbmlJNI.ListOfMembers_getByIdRef__SWIG_0(swigCPtr, this, sid); 610 return (cPtr == 0) ? null : new Member(cPtr, false); 611 } 612 613 614/** 615 * Returns the XML element name of this {@link ListOfMembers} object. 616 <p> 617 * For {@link ListOfMembers}, the XML element name is always <code>'listOfMembers'.</code> 618 <p> 619 * @return the name of this element, i.e. <code>'listOfMembers'.</code> 620 */ public 621 String getElementName() { 622 return libsbmlJNI.ListOfMembers_getElementName(swigCPtr, this); 623 } 624 625 626/** 627 * Returns the libSBML type code for this {@link ListOfMembers} object. 628 <p> 629 * <p> 630 * LibSBML attaches an identifying code to every kind of SBML object. These 631 * are integer constants known as <em>SBML type codes</em>. The names of all 632 * the codes begin with the characters <code>SBML_</code>. 633 * In the Java language interface for libSBML, the 634 * type codes are defined as static integer constants in the interface class 635 * {@link libsbmlConstants}. Note that different Level 3 636 * package plug-ins may use overlapping type codes; to identify the package 637 * to which a given object belongs, call the <code>getPackageName()</code> 638 * method on the object. 639 <p> 640 * @return the SBML type code for this object: 641 <p> 642 * {@link libsbmlConstants#SBML_LIST_OF SBML_LIST_OF} 643 <p> 644 * <p> 645 * @warning <span class='warning'>The specific integer values of the possible 646 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 647 * packages, To fully identify the correct code, <strong>it is necessary to 648 * invoke both getTypeCode() and getPackageName()</strong>.</span> 649 */ public 650 int getTypeCode() { 651 return libsbmlJNI.ListOfMembers_getTypeCode(swigCPtr, this); 652 } 653 654 655/** 656 * Returns the libSBML type code for the SBML objects contained in this 657 * {@link ListOfMembers} object. 658 <p> 659 * <p> 660 * LibSBML attaches an identifying code to every kind of SBML object. These 661 * are integer constants known as <em>SBML type codes</em>. The names of all 662 * the codes begin with the characters <code>SBML_</code>. 663 * In the Java language interface for libSBML, the 664 * type codes are defined as static integer constants in the interface class 665 * {@link libsbmlConstants}. Note that different Level 3 666 * package plug-ins may use overlapping type codes; to identify the package 667 * to which a given object belongs, call the <code>getPackageName()</code> 668 * method on the object. 669 <p> 670 * @return the SBML typecode for the objects contained in this ListOfMembers: 671 <p> 672 * {@link libsbmlConstants#SBML_GROUPS_MEMBER SBML_GROUPS_MEMBER} 673 <p> 674 * <p> 675 * @warning <span class='warning'>The specific integer values of the possible 676 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 677 * packages, To fully identify the correct code, <strong>it is necessary to 678 * invoke both getTypeCode() and getPackageName()</strong>.</span> 679 <p> 680 * @see #getElementName() 681 * @see #getPackageName() 682 */ public 683 int getItemTypeCode() { 684 return libsbmlJNI.ListOfMembers_getItemTypeCode(swigCPtr, this); 685 } 686 687 688/** 689 * Predicate returning <code>true</code> if all the required attributes for this 690 * {@link ListOfMembers} object have been set. 691 <p> 692 * @return <code>true</code> to indicate that all the required attributes of this 693 * {@link ListOfMembers} have been set, otherwise <code>false</code> is returned. 694 <p> 695 * @note The required attributes for the {@link ListOfMembers} object are: 696 */ public 697 boolean hasRequiredAttributes() { 698 return libsbmlJNI.ListOfMembers_hasRequiredAttributes(swigCPtr, this); 699 } 700 701}