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 TODO:Definition of the {@link Member} class. 014 */ 015 016public class Member extends SBase { 017 private long swigCPtr; 018 019 protected Member(long cPtr, boolean cMemoryOwn) 020 { 021 super(libsbmlJNI.Member_SWIGUpcast(cPtr), cMemoryOwn); 022 swigCPtr = cPtr; 023 } 024 025 protected static long getCPtr(Member obj) 026 { 027 return (obj == null) ? 0 : obj.swigCPtr; 028 } 029 030 protected static long getCPtrAndDisown (Member obj) 031 { 032 long ptr = 0; 033 034 if (obj != null) 035 { 036 ptr = obj.swigCPtr; 037 obj.swigCMemOwn = false; 038 } 039 040 return ptr; 041 } 042 043 protected void finalize() { 044 delete(); 045 } 046 047 public synchronized void delete() { 048 if (swigCPtr != 0) { 049 if (swigCMemOwn) { 050 swigCMemOwn = false; 051 libsbmlJNI.delete_Member(swigCPtr); 052 } 053 swigCPtr = 0; 054 } 055 super.delete(); 056 } 057 058 059/** 060 * Creates a new {@link Member} using the given SBML Level, Version and 061 * “groups” package version. 062 <p> 063 * @param level a long integer, the SBML Level to assign to this {@link Member}. 064 <p> 065 * @param version a long integer, the SBML Version to assign to this {@link Member}. 066 <p> 067 * @param pkgVersion a long integer, the SBML Groups Version to assign to 068 * this {@link Member}. 069 <p> 070 * <p> 071 * @note Attempting to add an object to an {@link SBMLDocument} having a different 072 * combination of SBML Level, Version and XML namespaces than the object 073 * itself will result in an error at the time a caller attempts to make the 074 * addition. A parent object must have compatible Level, Version and XML 075 * namespaces. (Strictly speaking, a parent may also have more XML 076 * namespaces than a child, but the reverse is not permitted.) The 077 * restriction is necessary to ensure that an SBML model has a consistent 078 * overall structure. This requires callers to manage their objects 079 * carefully, but the benefit is increased flexibility in how models can be 080 * created by permitting callers to create objects bottom-up if desired. In 081 * situations where objects are not yet attached to parents (e.g., 082 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 083 * libSBML determine such things as whether it is valid to assign a 084 * particular value to an attribute. For packages, this means that the 085 * parent object to which this package element is being added must have 086 * been created with the package namespace, or that the package namespace 087 * was added to it, even if that parent is not a package object itself. 088 */ public 089 Member(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 090 this(libsbmlJNI.new_Member__SWIG_0(level, version, pkgVersion), true); 091 } 092 093 094/** 095 * Creates a new {@link Member} using the given SBML Level, Version and 096 * “groups” package version. 097 <p> 098 * @param level a long integer, the SBML Level to assign to this {@link Member}. 099 <p> 100 * @param version a long integer, the SBML Version to assign to this {@link Member}. 101 <p> 102 * @param pkgVersion a long integer, the SBML Groups Version to assign to 103 * this {@link Member}. 104 <p> 105 * <p> 106 * @note Attempting to add an object to an {@link SBMLDocument} having a different 107 * combination of SBML Level, Version and XML namespaces than the object 108 * itself will result in an error at the time a caller attempts to make the 109 * addition. A parent object must have compatible Level, Version and XML 110 * namespaces. (Strictly speaking, a parent may also have more XML 111 * namespaces than a child, but the reverse is not permitted.) The 112 * restriction is necessary to ensure that an SBML model has a consistent 113 * overall structure. This requires callers to manage their objects 114 * carefully, but the benefit is increased flexibility in how models can be 115 * created by permitting callers to create objects bottom-up if desired. In 116 * situations where objects are not yet attached to parents (e.g., 117 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 118 * libSBML determine such things as whether it is valid to assign a 119 * particular value to an attribute. For packages, this means that the 120 * parent object to which this package element is being added must have 121 * been created with the package namespace, or that the package namespace 122 * was added to it, even if that parent is not a package object itself. 123 */ public 124 Member(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 125 this(libsbmlJNI.new_Member__SWIG_1(level, version), true); 126 } 127 128 129/** 130 * Creates a new {@link Member} using the given SBML Level, Version and 131 * “groups” package version. 132 <p> 133 * @param level a long integer, the SBML Level to assign to this {@link Member}. 134 <p> 135 * @param version a long integer, the SBML Version to assign to this {@link Member}. 136 <p> 137 * @param pkgVersion a long integer, the SBML Groups Version to assign to 138 * this {@link Member}. 139 <p> 140 * <p> 141 * @note Attempting to add an object to an {@link SBMLDocument} having a different 142 * combination of SBML Level, Version and XML namespaces than the object 143 * itself will result in an error at the time a caller attempts to make the 144 * addition. A parent object must have compatible Level, Version and XML 145 * namespaces. (Strictly speaking, a parent may also have more XML 146 * namespaces than a child, but the reverse is not permitted.) The 147 * restriction is necessary to ensure that an SBML model has a consistent 148 * overall structure. This requires callers to manage their objects 149 * carefully, but the benefit is increased flexibility in how models can be 150 * created by permitting callers to create objects bottom-up if desired. In 151 * situations where objects are not yet attached to parents (e.g., 152 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 153 * libSBML determine such things as whether it is valid to assign a 154 * particular value to an attribute. For packages, this means that the 155 * parent object to which this package element is being added must have 156 * been created with the package namespace, or that the package namespace 157 * was added to it, even if that parent is not a package object itself. 158 */ public 159 Member(long level) throws org.sbml.libsbml.SBMLConstructorException { 160 this(libsbmlJNI.new_Member__SWIG_2(level), true); 161 } 162 163 164/** 165 * Creates a new {@link Member} using the given SBML Level, Version and 166 * “groups” package version. 167 <p> 168 * @param level a long integer, the SBML Level to assign to this {@link Member}. 169 <p> 170 * @param version a long integer, the SBML Version to assign to this {@link Member}. 171 <p> 172 * @param pkgVersion a long integer, the SBML Groups Version to assign to 173 * this {@link Member}. 174 <p> 175 * <p> 176 * @note Attempting to add an object to an {@link SBMLDocument} having a different 177 * combination of SBML Level, Version and XML namespaces than the object 178 * itself will result in an error at the time a caller attempts to make the 179 * addition. A parent object must have compatible Level, Version and XML 180 * namespaces. (Strictly speaking, a parent may also have more XML 181 * namespaces than a child, but the reverse is not permitted.) The 182 * restriction is necessary to ensure that an SBML model has a consistent 183 * overall structure. This requires callers to manage their objects 184 * carefully, but the benefit is increased flexibility in how models can be 185 * created by permitting callers to create objects bottom-up if desired. In 186 * situations where objects are not yet attached to parents (e.g., 187 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 188 * libSBML determine such things as whether it is valid to assign a 189 * particular value to an attribute. For packages, this means that the 190 * parent object to which this package element is being added must have 191 * been created with the package namespace, or that the package namespace 192 * was added to it, even if that parent is not a package object itself. 193 */ public 194 Member() throws org.sbml.libsbml.SBMLConstructorException { 195 this(libsbmlJNI.new_Member__SWIG_3(), true); 196 } 197 198 199/** 200 * Creates a new {@link Member} using the given {@link GroupsPkgNamespaces} object. 201 <p> 202 * <p> 203 * The package namespaces object used in this constructor is derived from a 204 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces 205 * information. It is used to communicate the SBML Level, Version, and 206 * package version and name information used in addition to SBML Level 3 Core. A 207 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 208 * package namespace object somewhere in a program once, then hand that object 209 * as needed to object constructors of that package that accept it as and 210 * argument, such as this one. 211 <p> 212 * @param groupsns the {@link GroupsPkgNamespaces} object. 213 <p> 214 * <p> 215 * @note Attempting to add an object to an {@link SBMLDocument} having a different 216 * combination of SBML Level, Version and XML namespaces than the object 217 * itself will result in an error at the time a caller attempts to make the 218 * addition. A parent object must have compatible Level, Version and XML 219 * namespaces. (Strictly speaking, a parent may also have more XML 220 * namespaces than a child, but the reverse is not permitted.) The 221 * restriction is necessary to ensure that an SBML model has a consistent 222 * overall structure. This requires callers to manage their objects 223 * carefully, but the benefit is increased flexibility in how models can be 224 * created by permitting callers to create objects bottom-up if desired. In 225 * situations where objects are not yet attached to parents (e.g., 226 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 227 * libSBML determine such things as whether it is valid to assign a 228 * particular value to an attribute. For packages, this means that the 229 * parent object to which this package element is being added must have 230 * been created with the package namespace, or that the package namespace 231 * was added to it, even if that parent is not a package object itself. 232 */ public 233 Member(GroupsPkgNamespaces groupsns) throws org.sbml.libsbml.SBMLConstructorException { 234 this(libsbmlJNI.new_Member__SWIG_4(GroupsPkgNamespaces.getCPtr(groupsns), groupsns), true); 235 } 236 237 238/** 239 * Copy constructor for {@link Member}. 240 <p> 241 * @param orig the {@link Member} instance to copy. 242 */ public 243 Member(Member orig) throws org.sbml.libsbml.SBMLConstructorException { 244 this(libsbmlJNI.new_Member__SWIG_5(Member.getCPtr(orig), orig), true); 245 } 246 247 248/** 249 * Creates and returns a deep copy of this {@link Member} object. 250 <p> 251 * @return a (deep) copy of this {@link Member} object. 252 */ public 253 Member cloneObject() { 254 long cPtr = libsbmlJNI.Member_cloneObject(swigCPtr, this); 255 return (cPtr == 0) ? null : new Member(cPtr, true); 256 } 257 258 259/** 260 * Returns the value of the 'id' attribute of this {@link Member}. 261 <p> 262 * @return the value of the 'id' attribute of this {@link Member} as a string. 263 */ public 264 String getId() { 265 return libsbmlJNI.Member_getId(swigCPtr, this); 266 } 267 268 269/** 270 * Returns the value of the 'name' attribute of this {@link Member}. 271 <p> 272 * @return the value of the 'name' attribute of this {@link Member} as a string. 273 */ public 274 String getName() { 275 return libsbmlJNI.Member_getName(swigCPtr, this); 276 } 277 278 279/** 280 * Returns the value of the 'idRef' attribute of this {@link Member}. 281 <p> 282 * @return the value of the 'idRef' attribute of this {@link Member} as a string. 283 */ public 284 String getIdRef() { 285 return libsbmlJNI.Member_getIdRef(swigCPtr, this); 286 } 287 288 289/** 290 * Returns the value of the 'metaIdRef' attribute of this {@link Member}. 291 <p> 292 * @return the value of the 'metaIdRef' attribute of this {@link Member} as a string. 293 */ public 294 String getMetaIdRef() { 295 return libsbmlJNI.Member_getMetaIdRef(swigCPtr, this); 296 } 297 298 299/** 300 * Predicate returning <code>true</code> if this {@link Member}'s 'id' attribute is set. 301 <p> 302 * @return <code>true</code> if this {@link Member}'s 'id' attribute has been set, otherwise 303 * <code>false</code> is returned. 304 */ public 305 boolean isSetId() { 306 return libsbmlJNI.Member_isSetId(swigCPtr, this); 307 } 308 309 310/** 311 * Predicate returning <code>true</code> if this {@link Member}'s 'name' attribute is set. 312 <p> 313 * @return <code>true</code> if this {@link Member}'s 'name' attribute has been set, otherwise 314 * <code>false</code> is returned. 315 */ public 316 boolean isSetName() { 317 return libsbmlJNI.Member_isSetName(swigCPtr, this); 318 } 319 320 321/** 322 * Predicate returning <code>true</code> if this {@link Member}'s 'idRef' attribute is set. 323 <p> 324 * @return <code>true</code> if this {@link Member}'s 'idRef' attribute has been set, otherwise 325 * <code>false</code> is returned. 326 */ public 327 boolean isSetIdRef() { 328 return libsbmlJNI.Member_isSetIdRef(swigCPtr, this); 329 } 330 331 332/** 333 * Predicate returning <code>true</code> if this {@link Member}'s 'metaIdRef' attribute is set. 334 <p> 335 * @return <code>true</code> if this {@link Member}'s 'metaIdRef' attribute has been set, 336 * otherwise <code>false</code> is returned. 337 */ public 338 boolean isSetMetaIdRef() { 339 return libsbmlJNI.Member_isSetMetaIdRef(swigCPtr, this); 340 } 341 342 343/** 344 * Sets the value of the 'id' attribute of this {@link Member}. 345 <p> 346 * @param id String& value of the 'id' attribute to be set. 347 <p> 348 * <p> 349 * @return integer value indicating success/failure of the 350 * function. The possible values 351 * returned by this function are: 352 * <ul> 353 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 354 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 355 * 356 * </ul> <p> 357 * Calling this function with <code>id</code> = <code>null</code> or an empty string is 358 * equivalent to calling unsetId(). 359 */ public 360 int setId(String id) { 361 return libsbmlJNI.Member_setId(swigCPtr, this, id); 362 } 363 364 365/** 366 * Sets the value of the 'name' attribute of this {@link Member}. 367 <p> 368 * @param name String& value of the 'name' attribute to be set. 369 <p> 370 * <p> 371 * @return integer value indicating success/failure of the 372 * function. This particular 373 * function only does one thing irrespective of user input or 374 * object state, and thus will only return a single value: 375 * <ul> 376 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 377 * 378 * </ul> <p> 379 * Calling this function with <code>name</code> = <code>null</code> or an empty string is 380 * equivalent to calling unsetName(). 381 */ public 382 int setName(String name) { 383 return libsbmlJNI.Member_setName(swigCPtr, this, name); 384 } 385 386 387/** 388 * Sets the value of the 'idRef' attribute of this {@link Member}. 389 <p> 390 * @param idRef String& value of the 'idRef' attribute to be set. 391 <p> 392 * <p> 393 * @return integer value indicating success/failure of the 394 * function. The possible values 395 * returned by this function are: 396 * <ul> 397 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 398 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 399 * </ul> 400 */ public 401 int setIdRef(String idRef) { 402 return libsbmlJNI.Member_setIdRef(swigCPtr, this, idRef); 403 } 404 405 406/** 407 * Sets the value of the 'metaIdRef' attribute of this {@link Member}. 408 <p> 409 * @param metaIdRef String& value of the 'metaIdRef' attribute to be 410 * set. 411 <p> 412 * <p> 413 * @return integer value indicating success/failure of the 414 * function. This particular 415 * function only does one thing irrespective of user input or 416 * object state, and thus will only return a single value: 417 * <ul> 418 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 419 * </ul> 420 */ public 421 int setMetaIdRef(String metaIdRef) { 422 return libsbmlJNI.Member_setMetaIdRef(swigCPtr, this, metaIdRef); 423 } 424 425 426/** 427 * Unsets the value of the 'id' attribute of this {@link Member}. 428 <p> 429 * <p> 430 * @return integer value indicating success/failure of the 431 * function. The possible values 432 * returned by this function are: 433 * <ul> 434 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 435 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 436 * </ul> 437 */ public 438 int unsetId() { 439 return libsbmlJNI.Member_unsetId(swigCPtr, this); 440 } 441 442 443/** 444 * Unsets the value of the 'name' attribute of this {@link Member}. 445 <p> 446 * <p> 447 * @return integer value indicating success/failure of the 448 * function. The possible values 449 * returned by this function are: 450 * <ul> 451 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 452 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 453 * </ul> 454 */ public 455 int unsetName() { 456 return libsbmlJNI.Member_unsetName(swigCPtr, this); 457 } 458 459 460/** 461 * Unsets the value of the 'idRef' attribute of this {@link Member}. 462 <p> 463 * <p> 464 * @return integer value indicating success/failure of the 465 * function. The possible values 466 * returned by this function are: 467 * <ul> 468 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 469 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 470 * </ul> 471 */ public 472 int unsetIdRef() { 473 return libsbmlJNI.Member_unsetIdRef(swigCPtr, this); 474 } 475 476 477/** 478 * Unsets the value of the 'metaIdRef' attribute of this {@link Member}. 479 <p> 480 * <p> 481 * @return integer value indicating success/failure of the 482 * function. The possible values 483 * returned by this function are: 484 * <ul> 485 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 486 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 487 * </ul> 488 */ public 489 int unsetMetaIdRef() { 490 return libsbmlJNI.Member_unsetMetaIdRef(swigCPtr, this); 491 } 492 493 494/** 495 * <p> 496 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 497 * value. 498 <p> 499 * <p> 500 * In SBML, object identifiers are of a data type called <code>SId</code>. 501 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 502 * introduced for attribute values that refer to <code>SId</code> values; in 503 * previous Levels of SBML, this data type did not exist and attributes were 504 * simply described to as 'referring to an identifier', but the effective 505 * data type was the same as <code>SIdRef</code> in Level 3. These and 506 * other methods of libSBML refer to the type <code>SIdRef</code> for all 507 * Levels of SBML, even if the corresponding SBML specification did not 508 * explicitly name the data type. 509 <p> 510 * This method works by looking at all attributes and (if appropriate) 511 * mathematical formulas in MathML content, comparing the referenced 512 * identifiers to the value of <code>oldid</code>. If any matches are found, the 513 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 514 * descend into child elements. 515 <p> 516 * @param oldid the old identifier. 517 * @param newid the new identifier. 518 */ public 519 void renameSIdRefs(String oldid, String newid) { 520 libsbmlJNI.Member_renameSIdRefs(swigCPtr, this, oldid, newid); 521 } 522 523 524/** 525 * Returns the XML element name of this {@link Member} object. 526 <p> 527 * For {@link Member}, the XML element name is always <code>'member'.</code> 528 <p> 529 * @return the name of this element, i.e. <code>'member'.</code> 530 */ public 531 String getElementName() { 532 return libsbmlJNI.Member_getElementName(swigCPtr, this); 533 } 534 535 536/** 537 * Returns the libSBML type code for this {@link Member} object. 538 <p> 539 * <p> 540 * LibSBML attaches an identifying code to every kind of SBML object. These 541 * are integer constants known as <em>SBML type codes</em>. The names of all 542 * the codes begin with the characters <code>SBML_</code>. 543 * In the Java language interface for libSBML, the 544 * type codes are defined as static integer constants in the interface class 545 * {@link libsbmlConstants}. Note that different Level 3 546 * package plug-ins may use overlapping type codes; to identify the package 547 * to which a given object belongs, call the 548 * <code>{@link SBase#getPackageName()} 549 * </code> 550 * method on the object. 551 <p> 552 * @return the SBML type code for this object: 553 * {@link libsbmlConstants#SBML_GROUPS_MEMBER SBML_GROUPS_MEMBER}. 554 <p> 555 * <p> 556 * @warning <span class='warning'>The specific integer values of the possible 557 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 558 * packages, To fully identify the correct code, <strong>it is necessary to 559 * invoke both getTypeCode() and getPackageName()</strong>.</span> 560 <p> 561 * @see #getElementName() 562 * @see #getPackageName() 563 */ public 564 int getTypeCode() { 565 return libsbmlJNI.Member_getTypeCode(swigCPtr, this); 566 } 567 568 569/** 570 * Predicate returning <code>true</code> if all the required attributes for this {@link Member} 571 * object have been set. 572 <p> 573 * @return <code>true</code> to indicate that all the required attributes of this 574 * {@link Member} have been set, otherwise <code>false</code> is returned. 575 */ public 576 boolean hasRequiredAttributes() { 577 return libsbmlJNI.Member_hasRequiredAttributes(swigCPtr, this); 578 } 579 580 581/** * @internal */ public 582 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 583 libsbmlJNI.Member_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 584 } 585 586 587/** * @internal */ public 588 SBase getReferencedElement() { 589 return libsbml.DowncastSBase(libsbmlJNI.Member_getReferencedElement(swigCPtr, this), false); 590} 591 592}