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-fbc"><a href="group__fbc.html">fbc</a></span> 013 Annotation helper class for “fbc” Version 1. 014 <p> 015 * <p style='color: #777; font-style: italic'> 016This class of objects is defined by libSBML only and has no direct 017equivalent in terms of SBML components. This class is not prescribed by 018the SBML specifications, although it is used to implement features 019defined in SBML. 020</p> 021 022 <p> 023 * The {@link Association} class is a helper class for creating annotations to store 024 * gene association information in Version 1 of the SBML Level 3 025 * <a href='../../../extensions-summary.html#fbc'>Flux Balance Constraints</a> (“fbc”) package. In “fbc” 026 * Version 2, the equivalent capability is handled by the {@link FbcAssociation} 027 * class and this class (Association) is not used. 028 <p> 029 * @see FbcAssociation 030 * @see ListOfFbcAssociations 031 */ 032 033public class Association extends SBase { 034 private long swigCPtr; 035 036 protected Association(long cPtr, boolean cMemoryOwn) 037 { 038 super(libsbmlJNI.Association_SWIGUpcast(cPtr), cMemoryOwn); 039 swigCPtr = cPtr; 040 } 041 042 protected static long getCPtr(Association obj) 043 { 044 return (obj == null) ? 0 : obj.swigCPtr; 045 } 046 047 protected static long getCPtrAndDisown (Association obj) 048 { 049 long ptr = 0; 050 051 if (obj != null) 052 { 053 ptr = obj.swigCPtr; 054 obj.swigCMemOwn = false; 055 } 056 057 return ptr; 058 } 059 060 protected void finalize() { 061 delete(); 062 } 063 064 public synchronized void delete() { 065 if (swigCPtr != 0) { 066 if (swigCMemOwn) { 067 swigCMemOwn = false; 068 libsbmlJNI.delete_Association(swigCPtr); 069 } 070 swigCPtr = 0; 071 } 072 super.delete(); 073 } 074 075 076/** 077 * Creates a new {@link Association} objet with the given SBML Level, Version, and 078 * “fbc” package version. 079 <p> 080 * @param level the SBML Level. 081 * @param version the Version within the SBML Level. 082 * @param pkgVersion the version of the package. 083 <p> 084 * <p> 085 * @note Attempting to add an object to an {@link SBMLDocument} having a different 086 * combination of SBML Level, Version and XML namespaces than the object 087 * itself will result in an error at the time a caller attempts to make the 088 * addition. A parent object must have compatible Level, Version and XML 089 * namespaces. (Strictly speaking, a parent may also have more XML 090 * namespaces than a child, but the reverse is not permitted.) The 091 * restriction is necessary to ensure that an SBML model has a consistent 092 * overall structure. This requires callers to manage their objects 093 * carefully, but the benefit is increased flexibility in how models can be 094 * created by permitting callers to create objects bottom-up if desired. In 095 * situations where objects are not yet attached to parents (e.g., 096 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 097 * libSBML determine such things as whether it is valid to assign a 098 * particular value to an attribute. For packages, this means that the 099 * parent object to which this package element is being added must have 100 * been created with the package namespace, or that the package namespace 101 * was added to it, even if that parent is not a package object itself. 102 */ public 103 Association(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 104 this(libsbmlJNI.new_Association__SWIG_0(level, version, pkgVersion), true); 105 } 106 107 108/** 109 * Creates a new {@link Association} objet with the given SBML Level, Version, and 110 * “fbc” package version. 111 <p> 112 * @param level the SBML Level. 113 * @param version the Version within the SBML Level. 114 * @param pkgVersion the version of the package. 115 <p> 116 * <p> 117 * @note Attempting to add an object to an {@link SBMLDocument} having a different 118 * combination of SBML Level, Version and XML namespaces than the object 119 * itself will result in an error at the time a caller attempts to make the 120 * addition. A parent object must have compatible Level, Version and XML 121 * namespaces. (Strictly speaking, a parent may also have more XML 122 * namespaces than a child, but the reverse is not permitted.) The 123 * restriction is necessary to ensure that an SBML model has a consistent 124 * overall structure. This requires callers to manage their objects 125 * carefully, but the benefit is increased flexibility in how models can be 126 * created by permitting callers to create objects bottom-up if desired. In 127 * situations where objects are not yet attached to parents (e.g., 128 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 129 * libSBML determine such things as whether it is valid to assign a 130 * particular value to an attribute. For packages, this means that the 131 * parent object to which this package element is being added must have 132 * been created with the package namespace, or that the package namespace 133 * was added to it, even if that parent is not a package object itself. 134 */ public 135 Association(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 136 this(libsbmlJNI.new_Association__SWIG_1(level, version), true); 137 } 138 139 140/** 141 * Creates a new {@link Association} objet with the given SBML Level, Version, and 142 * “fbc” package version. 143 <p> 144 * @param level the SBML Level. 145 * @param version the Version within the SBML Level. 146 * @param pkgVersion the version of the package. 147 <p> 148 * <p> 149 * @note Attempting to add an object to an {@link SBMLDocument} having a different 150 * combination of SBML Level, Version and XML namespaces than the object 151 * itself will result in an error at the time a caller attempts to make the 152 * addition. A parent object must have compatible Level, Version and XML 153 * namespaces. (Strictly speaking, a parent may also have more XML 154 * namespaces than a child, but the reverse is not permitted.) The 155 * restriction is necessary to ensure that an SBML model has a consistent 156 * overall structure. This requires callers to manage their objects 157 * carefully, but the benefit is increased flexibility in how models can be 158 * created by permitting callers to create objects bottom-up if desired. In 159 * situations where objects are not yet attached to parents (e.g., 160 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 161 * libSBML determine such things as whether it is valid to assign a 162 * particular value to an attribute. For packages, this means that the 163 * parent object to which this package element is being added must have 164 * been created with the package namespace, or that the package namespace 165 * was added to it, even if that parent is not a package object itself. 166 */ public 167 Association(long level) throws org.sbml.libsbml.SBMLConstructorException { 168 this(libsbmlJNI.new_Association__SWIG_2(level), true); 169 } 170 171 172/** 173 * Creates a new {@link Association} objet with the given SBML Level, Version, and 174 * “fbc” package version. 175 <p> 176 * @param level the SBML Level. 177 * @param version the Version within the SBML Level. 178 * @param pkgVersion the version of the package. 179 <p> 180 * <p> 181 * @note Attempting to add an object to an {@link SBMLDocument} having a different 182 * combination of SBML Level, Version and XML namespaces than the object 183 * itself will result in an error at the time a caller attempts to make the 184 * addition. A parent object must have compatible Level, Version and XML 185 * namespaces. (Strictly speaking, a parent may also have more XML 186 * namespaces than a child, but the reverse is not permitted.) The 187 * restriction is necessary to ensure that an SBML model has a consistent 188 * overall structure. This requires callers to manage their objects 189 * carefully, but the benefit is increased flexibility in how models can be 190 * created by permitting callers to create objects bottom-up if desired. In 191 * situations where objects are not yet attached to parents (e.g., 192 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 193 * libSBML determine such things as whether it is valid to assign a 194 * particular value to an attribute. For packages, this means that the 195 * parent object to which this package element is being added must have 196 * been created with the package namespace, or that the package namespace 197 * was added to it, even if that parent is not a package object itself. 198 */ public 199 Association() throws org.sbml.libsbml.SBMLConstructorException { 200 this(libsbmlJNI.new_Association__SWIG_3(), true); 201 } 202 203 204/** 205 * Creates a new {@link Association} with the given {@link FbcPkgNamespaces} object, 206 * and constructed to mimic the XMLNode: a '<gene>' node 207 * argument will result in a 208 * {@link libsbmlConstants#GENE_ASSOCIATION GENE_ASSOCIATION} node; an 209 * <and> node argument will result in a 210 * {@link libsbmlConstants#AND_ASSOCIATION AND_ASSOCIATION} node; an 211 * <or> node argument will result in a 212 * {@link libsbmlConstants#OR_ASSOCIATION OR_ASSOCIATION} node. Any 213 * other node will result in a 214 * {@link libsbmlConstants#UNKNOWN_ASSOCIATION UNKNOWN_ASSOCIATION} node. 215 * 'And' and 'or' nodes will have {@link Association} children that again 216 * parallel the children of the given {@link XMLNode}. 217 <p> 218 * <p> 219 * The package namespaces object used in this constructor is derived from a 220 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces 221 * information. It is used to communicate the SBML Level, Version, and 222 * package version and name information used in addition to SBML Level 3 Core. A 223 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 224 * package namespace object somewhere in a program once, then hand that object 225 * as needed to object constructors of that package that accept it as and 226 * argument, such as this one. 227 <p> 228 * @param fbcns the {@link FbcPkgNamespaces} object. 229 * @param node the {@link XMLNode} to copy. 230 <p> 231 * <p> 232 * @note Attempting to add an object to an {@link SBMLDocument} having a different 233 * combination of SBML Level, Version and XML namespaces than the object 234 * itself will result in an error at the time a caller attempts to make the 235 * addition. A parent object must have compatible Level, Version and XML 236 * namespaces. (Strictly speaking, a parent may also have more XML 237 * namespaces than a child, but the reverse is not permitted.) The 238 * restriction is necessary to ensure that an SBML model has a consistent 239 * overall structure. This requires callers to manage their objects 240 * carefully, but the benefit is increased flexibility in how models can be 241 * created by permitting callers to create objects bottom-up if desired. In 242 * situations where objects are not yet attached to parents (e.g., 243 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 244 * libSBML determine such things as whether it is valid to assign a 245 * particular value to an attribute. For packages, this means that the 246 * parent object to which this package element is being added must have 247 * been created with the package namespace, or that the package namespace 248 * was added to it, even if that parent is not a package object itself. 249 */ public 250 Association(XMLNode node, FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException { 251 this(libsbmlJNI.new_Association__SWIG_4(XMLNode.getCPtr(node), node, FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 252 } 253 254 255/** 256 * Creates a new {@link Association} with the given {@link FbcPkgNamespaces} object. 257 <p> 258 * <p> 259 * The package namespaces object used in this constructor is derived from a 260 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces 261 * information. It is used to communicate the SBML Level, Version, and 262 * package version and name information used in addition to SBML Level 3 Core. A 263 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 264 * package namespace object somewhere in a program once, then hand that object 265 * as needed to object constructors of that package that accept it as and 266 * argument, such as this one. 267 <p> 268 * @param fbcns the {@link FbcPkgNamespaces} object. 269 <p> 270 * <p> 271 * @note Attempting to add an object to an {@link SBMLDocument} having a different 272 * combination of SBML Level, Version and XML namespaces than the object 273 * itself will result in an error at the time a caller attempts to make the 274 * addition. A parent object must have compatible Level, Version and XML 275 * namespaces. (Strictly speaking, a parent may also have more XML 276 * namespaces than a child, but the reverse is not permitted.) The 277 * restriction is necessary to ensure that an SBML model has a consistent 278 * overall structure. This requires callers to manage their objects 279 * carefully, but the benefit is increased flexibility in how models can be 280 * created by permitting callers to create objects bottom-up if desired. In 281 * situations where objects are not yet attached to parents (e.g., 282 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 283 * libSBML determine such things as whether it is valid to assign a 284 * particular value to an attribute. For packages, this means that the 285 * parent object to which this package element is being added must have 286 * been created with the package namespace, or that the package namespace 287 * was added to it, even if that parent is not a package object itself. 288 */ public 289 Association(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException { 290 this(libsbmlJNI.new_Association__SWIG_5(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 291 } 292 293 294/** 295 * Copy constructor. 296 <p> 297 * @param source the instance to copy. 298 */ public 299 Association(Association source) throws org.sbml.libsbml.SBMLConstructorException { 300 this(libsbmlJNI.new_Association__SWIG_6(Association.getCPtr(source), source), true); 301 } 302 303 304/** 305 * Returns the string of the 'type' attribute of this {@link Association} object. 306 <p> 307 * @return the string of the 'type' attribute of this {@link Association} object. 308 */ public 309 int getType() { 310 return libsbmlJNI.Association_getType(swigCPtr, this); 311 } 312 313 314/** 315 * Predicate returning <code>true</code> if this {@link Association}'s 'type' attribute is 316 * set. 317 <p> 318 * @return <code>true</code> if this {@link Association} object's 'type' attribute has been set, 319 * otherwise <code>false</code> is returned. 320 */ public 321 boolean isSetType() { 322 return libsbmlJNI.Association_isSetType(swigCPtr, this); 323 } 324 325 326/** 327 * Sets the SIdRef string of the 'type' attribute of this {@link Association} object. 328 <p> 329 * @param type a SIdRef string to be set. 330 <p> 331 * <p> 332 * @return integer value indicating success/failure of the 333 * function. The possible values 334 * returned by this function are: 335 * <ul> 336 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 337 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 338 * </ul> 339 */ public 340 int setType(int type) { 341 return libsbmlJNI.Association_setType(swigCPtr, this, type); 342 } 343 344 345/** 346 * Unsets the value of the 'id' attribute of this {@link Association} object. 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_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 355 * </ul> 356 */ public 357 int unsetType() { 358 return libsbmlJNI.Association_unsetType(swigCPtr, this); 359 } 360 361 362/** 363 * Returns the string of the 'reference' attribute of this {@link Association} object. 364 <p> 365 * @return the string of the 'reference' attribute of this {@link Association} object. 366 */ public 367 String getReference() { 368 return libsbmlJNI.Association_getReference(swigCPtr, this); 369 } 370 371 372/** 373 * Predicate returning <code>true</code> if this {@link Association}'s 'reference' attribute 374 * has been set. 375 <p> 376 * @return <code>true</code> if this {@link Association} object's 'reference' attribute has been set, 377 * otherwise <code>false</code> is returned. 378 */ public 379 boolean isSetReference() { 380 return libsbmlJNI.Association_isSetReference(swigCPtr, this); 381 } 382 383 384/** 385 * Sets the SIdRef string of the 'reference' attribute of this {@link Association} object. 386 <p> 387 * @param reference a SIdRef string to be set. 388 <p> 389 * <p> 390 * @return integer value indicating success/failure of the 391 * function. The possible values 392 * returned by this function are: 393 * <ul> 394 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 395 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 396 * </ul> 397 */ public 398 int setReference(String reference) { 399 return libsbmlJNI.Association_setReference(swigCPtr, this, reference); 400 } 401 402 403/** 404 * Unsets the value of the 'id' attribute of this {@link Association} object. 405 <p> 406 * <p> 407 * @return integer value indicating success/failure of the 408 * function. The possible values 409 * returned by this function are: 410 * <ul> 411 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 412 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 413 * </ul> 414 */ public 415 int unsetReference() { 416 return libsbmlJNI.Association_unsetReference(swigCPtr, this); 417 } 418 419 420/** 421 * Adds a gene with the given <code>id</code> to the association. 422 <p> 423 * @param id the gene name. 424 <p> 425 * <p> 426 * @return integer value indicating success/failure of the 427 * function. The possible values 428 * returned by this function are: 429 * <ul> 430 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 431 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 432 * </ul> 433 */ public 434 int addGene(String id) { 435 return libsbmlJNI.Association_addGene(swigCPtr, this, id); 436 } 437 438 439/** 440 * Returns the number of child Associations of this {@link Association} object. 441 <p> 442 * @return the number of associations. 443 */ public 444 long getNumAssociations() { 445 return libsbmlJNI.Association_getNumAssociations(swigCPtr, this); 446 } 447 448 449/** 450 * Adds a child {@link Association} to this {@link Association} object. 451 <p> 452 * @param association the {@link Association} object to add. 453 <p> 454 * <p> 455 * @return integer value indicating success/failure of the 456 * function. The possible values 457 * returned by this function are: 458 * <ul> 459 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 460 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 461 * </ul> 462 */ public 463 int addAssociation(Association association) { 464 return libsbmlJNI.Association_addAssociation(swigCPtr, this, Association.getCPtr(association), association); 465 } 466 467 468/** 469 * Removes the child Associations with the given <code>index</code> from this 470 * {@link Association} object. 471 <p> 472 * @param index the index number of the item to remove. 473 <p> 474 * <p> 475 * @return integer value indicating success/failure of the 476 * function. The possible values 477 * returned by this function are: 478 * <ul> 479 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 480 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 481 * </ul> 482 */ public 483 int removeAssociation(int index) { 484 return libsbmlJNI.Association_removeAssociation(swigCPtr, this, index); 485 } 486 487 488/** 489 * Removes all children of this {@link Association} object. 490 <p> 491 * <p> 492 * @return integer value indicating success/failure of the 493 * function. The possible values 494 * returned by this function are: 495 * <ul> 496 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 497 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 498 * </ul> 499 */ public 500 int clearAssociations() { 501 return libsbmlJNI.Association_clearAssociations(swigCPtr, this); 502 } 503 504 505/** 506 * Creates a new {@link Association} of type 'and'. 507 <p> 508 * This method does not actually add the created {@link Association} as a child of 509 * this {@link Association} object or do anything else with it—the returning 510 * pointer is now owned by the caller. 511 <p> 512 * @return a new 'and' type association. 513 */ public 514 Association createAnd() { 515 long cPtr = libsbmlJNI.Association_createAnd(swigCPtr, this); 516 return (cPtr == 0) ? null : new Association(cPtr, false); 517 } 518 519 520/** 521 * Creates a new {@link Association} of type 'or'. 522 <p> 523 * This method does not actually add the created {@link Association} as a child of 524 * this {@link Association} object or do anything else with it—the returning 525 * pointer is now owned by the caller. 526 <p> 527 * @return a new 'or' type association. 528 */ public 529 Association createOr() { 530 long cPtr = libsbmlJNI.Association_createOr(swigCPtr, this); 531 return (cPtr == 0) ? null : new Association(cPtr, false); 532 } 533 534 535/** 536 * Creates a new {@link Association} of type 'and' with a given gene reference. 537 <p> 538 * This method does not actually add the created {@link Association} as a child of 539 * this {@link Association} object or do anything else with it—the returning 540 * pointer is now owned by the caller. 541 <p> 542 * @param reference the gene reference, as a string. 543 <p> 544 * @return a new {@link Association} object. 545 */ public 546 Association createGene(String reference) { 547 long cPtr = libsbmlJNI.Association_createGene__SWIG_0(swigCPtr, this, reference); 548 return (cPtr == 0) ? null : new Association(cPtr, false); 549 } 550 551 552/** 553 * Creates a new {@link Association} of type 'and' with a given gene reference. 554 <p> 555 * This method does not actually add the created {@link Association} as a child of 556 * this {@link Association} object or do anything else with it—the returning 557 * pointer is now owned by the caller. 558 <p> 559 * @param reference the gene reference, as a string. 560 <p> 561 * @return a new {@link Association} object. 562 */ public 563 Association createGene() { 564 long cPtr = libsbmlJNI.Association_createGene__SWIG_1(swigCPtr, this); 565 return (cPtr == 0) ? null : new Association(cPtr, false); 566 } 567 568 569/** 570 * Creates an {@link XMLNode} object from this {@link Association} object. 571 */ public 572 XMLNode toXML() { 573 return new XMLNode(libsbmlJNI.Association_toXML(swigCPtr, this), true); 574 } 575 576 577/** 578 * Returns the XML element name of this SBML object. 579 <p> 580 * @return the name of this element, as a text string. 581 */ public 582 String getElementName() { 583 return libsbmlJNI.Association_getElementName(swigCPtr, this); 584 } 585 586 587/** 588 * Creates and returns a deep copy of this {@link Association} object. 589 <p> 590 * @return a (deep) copy of this {@link Association} object. 591 */ public 592 Association cloneObject() { 593 long cPtr = libsbmlJNI.Association_cloneObject(swigCPtr, this); 594 return (cPtr == 0) ? null : new Association(cPtr, true); 595 } 596 597 598/** 599 * Returns the libSBML type code of this object instance. 600 <p> 601 * <p> 602 * LibSBML attaches an identifying code to every kind of SBML object. These 603 * are integer constants known as <em>SBML type codes</em>. The names of all 604 * the codes begin with the characters <code>SBML_</code>. 605 * In the Java language interface for libSBML, the 606 * type codes are defined as static integer constants in the interface class 607 * {@link libsbmlConstants}. Note that different Level 3 608 * package plug-ins may use overlapping type codes; to identify the package 609 * to which a given object belongs, call the 610 * <code>{@link SBase#getPackageName()} 611 * </code> 612 * method on the object. 613 <p> 614 * @return the SBML type code for this object: 615 * {@link libsbmlConstants#SBML_FBC_ASSOCIATION SBML_FBC_ASSOCIATION}. 616 <p> 617 * <p> 618 * @warning <span class='warning'>The specific integer values of the possible 619 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 620 * packages, To fully identify the correct code, <strong>it is necessary to 621 * invoke both getTypeCode() and getPackageName()</strong>.</span> 622 <p> 623 * @see #getElementName() 624 * @see #getPackageName() 625 */ public 626 int getTypeCode() { 627 return libsbmlJNI.Association_getTypeCode(swigCPtr, this); 628 } 629 630 631/** 632 * Parses a gene association in infix format and returns a corresponding 633 * {@link Association} object. 634 <p> 635 * This parses a string that has a list of gene names and conjunctions 636 * or disjunctions. For example: 637 * <pre class='fragment'> 638(b2422) and (b2425) and (b2423) and (b2424) or (b2422) and (b2423) and (b2424) and (b2413) and (b3917) 639</pre> 640 <p> 641 * @param association the string to parse. 642 <p> 643 * @return the parsed association, or <code>null</code> in case of an error. 644 <p> 645 * 646 <p> 647 * @see #toInfix() 648 */ public 649 static Association parseInfixAssociation(String association) { 650 long cPtr = libsbmlJNI.Association_parseInfixAssociation(association); 651 return (cPtr == 0) ? null : new Association(cPtr, false); 652 } 653 654 655/** 656 * Converts this {@link Association} object into an infix string representation. 657 * The format is the same as is found in parseInfixAssociation(). 658 <p> 659 * @return the association as infix string. 660 <p> 661 * @see #parseInfixAssociation(String association) 662 */ public 663 String toInfix() { 664 return libsbmlJNI.Association_toInfix(swigCPtr, this); 665 } 666 667}