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-fbc"><a href="group__fbc.html">fbc</a></span> 013 Extension of {@link Model}. 014 <p> 015 * The {@link FbcModelPlugin} object is used to extend the standard SBML {@link Model} object 016 * with features used in the SBML Level 3 <a href='../../../extensions-summary.html#fbc'>Flux Balance Constraints</a> (“fbc”) 017 * package. In Version 1 of the “fbc” specification, the 018 * extended {@link Model} class has two optional subobjects: {@link ListOfObjectives} and 019 * {@link ListOfFluxBounds}. In Version 2 of the specification, the extended 020 * {@link Model} object is defined differently: it is extended with a new required 021 * attribute named 'strict', and the two optional subobjects {@link ListOfObjectives} 022 * and {@link ListOfGeneProducts}. (ListOfFluxBounds is not used in Version 2.) 023 <p> 024 * <h2>The 'strict' attribute on the (extended) {@link Model} class</h2> 025 <p> 026 * The mandatory attribute 'strict', of type <code>boolean</code>, is used to 027 * apply an additional set of restrictions to the model. The 'strict' 028 * attribute helps ensure that the Flux Balance Constraints package can be 029 * used to encode legacy flux-balance analysis models expressible as Linear 030 * Programs (LP's) for software that is unable to analyze arbitrary 031 * mathematical expressions that may appear in an SBML model. In addition, a 032 * 'strict' model is fully described and mathematically consistent, for 033 * example, by ensuring that all fluxes have a valid upper or lower bound. 034 <p> 035 * The following restrictions are in effect if an “fbc” model 036 * object has a value of <code>'true'</code> for the attribute 'strict' on 037 * Model: 038 <p> 039 * <ul> 040 * <li> Each {@link Reaction} in a {@link Model} must define values for the attributes 041 * 'lowerFluxBound' and 'upperFluxBound', with each attribute pointing to a 042 * valid {@link Parameter} object defined in the current {@link Model}. 043 <p> 044 * <li> Each {@link Parameter} object referred to by the {@link Reaction} attributes 045 * 'lowerFluxBound' and 'upperFluxBound' must have its 'constant' attribute 046 * set to the value <code>'true'</code> and its 'value' attribute set to a 047 * value of type <code>double</code>. This value may not be 048 * <code>'NaN'</code>. 049 <p> 050 * <li> {@link SpeciesReference} objects in {@link Reaction} objects must have their 051 * 'stoichiometry' attribute set to a <code>double</code> value that is not 052 * <code>'NaN'</code>, nor <code>'-INF'</code>, nor <code>'INF'</code>. In 053 * addition, the value of their 'constant' attribute must be set to 054 * <code>'true'</code>. 055 <p> 056 * <li> {@link InitialAssignment} objects may not target the {@link Parameter} objects 057 * referenced by the {@link Reaction} attributes 'lowerFluxBound' and 058 * 'upperFluxBound', nor any {@link SpeciesReference} objects. 059 <p> 060 * <li> All defined {@link FluxObjective} objects must have their coefficient 061 * attribute set to a <code>double</code> value that is not 062 * <code>'NaN'</code>, nor <code>'-INF'</code>, nor <code>'INF'</code>. 063 <p> 064 * <li> A {@link Reaction} 'lowerFluxBound' attribute may not point to a {@link Parameter} 065 * object that has a value of <code>'INF'</code>. 066 <p> 067 * <li> A {@link Reaction} 'upperFluxBound' attribute may not point to a {@link Parameter} 068 * object that has a value of <code>'-INF'</code>. 069 <p> 070 * <li> For all {@link Reaction} objects, the value of a 'lowerFluxBound' attribute 071 * must be less than or equal to the value of the 'upperFluxBound' attribute. 072 * 073 * </ul> <p> 074 * While it is not compulsory for a 'strict' Flux Balance Constraints model 075 * to define an {@link Objective}, doing so does does allow the model to be 076 * formulated as a Linear Program and optimized. However, this decision is 077 * left to the modeler. Note that all other properties of the objects 078 * referred to in the list above are to be set as specified in the relevant 079 * SBML Level 3 Version 1 Core and <a href='../../../extensions-summary.html#fbc'>Flux Balance Constraints</a> (“fbc”) 080 * specifications. 081 <p> 082 * Alternatively, if the value of the strict attribute is 083 * <code>'false'</code>, then none of these restrictions apply and the model 084 * creator can choose to define “fbc” models that are not 085 * necessarily encodable as an LP. For example, if strict is 086 * <code>'false'</code>, the {@link InitialAssignment} construct may be used to set 087 * any valid numerical entity, including {@link Parameter} values and stoichiometric 088 * coefficients, with any value of type <code>double</code>. In addition, 089 * {@link Parameter} elements are no longer required to be flagged as constant, thus 090 * allowing for a Flux Balance Constraints model's use in alternative, hybrid 091 * modeling strategies. 092 <p> 093 * <h2>Lists of subobjects on the (extended) {@link Model} class</h2> 094 <p> 095 * The {@link ListOfObjectives} is used to define the objectives of a given 096 * “fbc” model. Objectives generally consist of linear 097 * combinations of model variables (fluxes) and a direction for the 098 * optimality constraint (either maximization or minimization). Each 099 * {@link Objective} has a {@link ListOfFluxObjectives} subobjects. 100 <p> 101 * In Version 2 of “fbc”, the {@link ListOfGeneProducts} is used to 102 * define the gene products represented by the “fbc” model. 103 <p> 104 * In Version 1 of “fbc”, there is no {@link ListOfGeneProducts}, 105 * and instead, {@link Model} can have an optional {@link ListOfFluxBounds}. 106 <p> 107 * @see Objective 108 * @see FluxObjective 109 * @see FluxBound 110 */ 111 112public class FbcModelPlugin extends SBasePlugin { 113 private long swigCPtr; 114 115 protected FbcModelPlugin(long cPtr, boolean cMemoryOwn) 116 { 117 super(libsbmlJNI.FbcModelPlugin_SWIGUpcast(cPtr), cMemoryOwn); 118 swigCPtr = cPtr; 119 } 120 121 protected static long getCPtr(FbcModelPlugin obj) 122 { 123 return (obj == null) ? 0 : obj.swigCPtr; 124 } 125 126 protected static long getCPtrAndDisown (FbcModelPlugin obj) 127 { 128 long ptr = 0; 129 130 if (obj != null) 131 { 132 ptr = obj.swigCPtr; 133 obj.swigCMemOwn = false; 134 } 135 136 return ptr; 137 } 138 139 protected void finalize() { 140 delete(); 141 } 142 143 public synchronized void delete() { 144 if (swigCPtr != 0) { 145 if (swigCMemOwn) { 146 swigCMemOwn = false; 147 libsbmlJNI.delete_FbcModelPlugin(swigCPtr); 148 } 149 swigCPtr = 0; 150 } 151 super.delete(); 152 } 153 154 155/** 156 * Creates a new {@link FbcModelPlugin} 157 */ public 158 FbcModelPlugin(String uri, String prefix, FbcPkgNamespaces fbcns) { 159 this(libsbmlJNI.new_FbcModelPlugin__SWIG_0(uri, prefix, FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 160 } 161 162 163/** 164 * Copy constructor for {@link FbcModelPlugin}. 165 <p> 166 * @param orig; the {@link FbcModelPlugin} instance to copy. 167 */ public 168 FbcModelPlugin(FbcModelPlugin orig) { 169 this(libsbmlJNI.new_FbcModelPlugin__SWIG_1(FbcModelPlugin.getCPtr(orig), orig), true); 170 } 171 172 173/** 174 * Creates and returns a deep copy of this {@link FbcModelPlugin} object. 175 <p> 176 * @return a (deep) copy of this {@link FbcModelPlugin} object. 177 */ public 178 SBasePlugin cloneObject() { 179 long cPtr = libsbmlJNI.FbcModelPlugin_cloneObject(swigCPtr, this); 180 return (cPtr == 0) ? null : new FbcModelPlugin(cPtr, true); 181 } 182 183 184/** * @internal */ public 185 SBase createObject(XMLInputStream stream) { 186 return libsbml.DowncastSBase(libsbmlJNI.FbcModelPlugin_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false); 187} 188 189 190/** * @internal */ public 191 int appendFrom(Model model) { 192 return libsbmlJNI.FbcModelPlugin_appendFrom(swigCPtr, this, Model.getCPtr(model), model); 193 } 194 195 196/** * @internal */ public 197 boolean readOtherXML(SBase parentObject, XMLInputStream stream) { 198 return libsbmlJNI.FbcModelPlugin_readOtherXML(swigCPtr, this, SBase.getCPtr(parentObject), parentObject, XMLInputStream.getCPtr(stream), stream); 199 } 200 201 202/** * @internal */ public 203 void addExpectedAttributes(SWIGTYPE_p_ExpectedAttributes attributes) { 204 libsbmlJNI.FbcModelPlugin_addExpectedAttributes(swigCPtr, this, SWIGTYPE_p_ExpectedAttributes.getCPtr(attributes)); 205 } 206 207 208/** * @internal */ public 209 void readAttributes(XMLAttributes attributes, SWIGTYPE_p_ExpectedAttributes expectedAttributes) { 210 libsbmlJNI.FbcModelPlugin_readAttributes(swigCPtr, this, XMLAttributes.getCPtr(attributes), attributes, SWIGTYPE_p_ExpectedAttributes.getCPtr(expectedAttributes)); 211 } 212 213 214/** * @internal */ public 215 void writeAttributes(XMLOutputStream stream) { 216 libsbmlJNI.FbcModelPlugin_writeAttributes(swigCPtr, this, XMLOutputStream.getCPtr(stream), stream); 217 } 218 219 220/** 221 * Returns the value of the 'strict' attribute of this {@link FbcModelPlugin}. 222 <p> 223 * @return the value of the 'strict' attribute of this {@link FbcModelPlugin} as a boolean. 224 */ public 225 boolean getStrict() { 226 return libsbmlJNI.FbcModelPlugin_getStrict(swigCPtr, this); 227 } 228 229 230/** 231 * Predicate returning <code>true</code> if this {@link FbcModelPlugin}'s 'strict' attribute 232 * is set. 233 <p> 234 * @return <code>true</code> if this {@link FbcModelPlugin}'s 'strict' attribute has been set, 235 * otherwise <code>false</code> is returned. 236 */ public 237 boolean isSetStrict() { 238 return libsbmlJNI.FbcModelPlugin_isSetStrict(swigCPtr, this); 239 } 240 241 242/** 243 * Sets the value of the 'strict' attribute of this {@link FbcModelPlugin}. 244 <p> 245 * @param strict; boolean value of the 'strict' attribute to be set 246 <p> 247 * @return integer value indicating success/failure of the 248 * function. The possible values 249 * returned by this function are: 250 * <ul> 251 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 252 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 253 * </ul> 254 */ public 255 int setStrict(boolean strict) { 256 return libsbmlJNI.FbcModelPlugin_setStrict(swigCPtr, this, strict); 257 } 258 259 260/** 261 * Unsets the value of the 'strict' attribute of this {@link FbcModelPlugin}. 262 <p> 263 * @return integer value indicating success/failure of the 264 * function. The possible values 265 * returned by this function are: 266 * <ul> 267 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 268 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 269 * </ul> 270 */ public 271 int unsetStrict() { 272 return libsbmlJNI.FbcModelPlugin_unsetStrict(swigCPtr, this); 273 } 274 275 276/** 277 * Returns the {@link ListOfFluxBounds} in this plugin object. 278 <p> 279 * @return {@link ListOfFluxBounds} object in this plugin object. 280 */ public 281 ListOfFluxBounds getListOfFluxBounds() { 282 long cPtr = libsbmlJNI.FbcModelPlugin_getListOfFluxBounds__SWIG_0(swigCPtr, this); 283 return (cPtr == 0) ? null : new ListOfFluxBounds(cPtr, false); 284 } 285 286 287/** 288 * Returns the {@link FluxBound} object that belongs to the given index. If the 289 * index is invalid, <code>null</code> is returned. 290 <p> 291 * @param n the index number of the {@link FluxBound} to get. 292 <p> 293 * @return the nth {@link FluxBound} in the {@link ListOfFluxBounds}. 294 */ public 295 FluxBound getFluxBound(long n) { 296 long cPtr = libsbmlJNI.FbcModelPlugin_getFluxBound__SWIG_0(swigCPtr, this, n); 297 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 298 } 299 300 301/** 302 * Returns the {@link FluxBound} object based on its identifier. 303 <p> 304 * @param sid a string representing the identifier 305 * of the {@link FluxBound} to get. 306 <p> 307 * @return {@link FluxBound} in the {@link ListOfFluxBounds} with the given <code>sid</code> 308 * or null if no such {@link FluxBound} exists. 309 <p> 310 * @see #getFluxBound(long n) 311 * @see #getListOfFluxBounds() 312 */ public 313 FluxBound getFluxBound(String sid) { 314 long cPtr = libsbmlJNI.FbcModelPlugin_getFluxBound__SWIG_2(swigCPtr, this, sid); 315 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 316 } 317 318 319/** 320 <p> 321 * @param reaction the id of an reaction to find fluxBounds for 322 <p> 323 * @return a listOfFluxBounds for the given reaction id 324 */ public 325 ListOfFluxBounds getFluxBoundsForReaction(String reaction) { 326 long cPtr = libsbmlJNI.FbcModelPlugin_getFluxBoundsForReaction(swigCPtr, this, reaction); 327 return (cPtr == 0) ? null : new ListOfFluxBounds(cPtr, false); 328 } 329 330 331/** 332 * Adds a copy of the given {@link FluxBound} object to the list of FluxBounds. 333 <p> 334 * @param bound the {@link FluxBound} object to be added to the list of FluxBounds. 335 <p> 336 * <p> 337 * @return integer value indicating success/failure of the 338 * function. The possible values 339 * returned by this function are: 340 * <ul> 341 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 342 * </ul> 343 */ public 344 int addFluxBound(FluxBound bound) { 345 return libsbmlJNI.FbcModelPlugin_addFluxBound(swigCPtr, this, FluxBound.getCPtr(bound), bound); 346 } 347 348 349/** 350 * Creates a new {@link FluxBound} object and adds it to the list of {@link FluxBound} objects 351 * and returns it. 352 <p> 353 * @return a newly created {@link FluxBound} object 354 */ public 355 FluxBound createFluxBound() { 356 long cPtr = libsbmlJNI.FbcModelPlugin_createFluxBound(swigCPtr, this); 357 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 358 } 359 360 361/** 362 * Removes the nth {@link FluxBound} object from this plugin object and 363 * returns a pointer to it. 364 <p> 365 * The caller owns the returned object and is responsible for 366 * deleting it. 367 <p> 368 * @param n the index of the {@link FluxBound} object to remove 369 <p> 370 * @return the {@link FluxBound} object removed. As mentioned above, the 371 * caller owns the returned object. <code>null</code> is returned if the 372 * given index is out of range. 373 */ public 374 FluxBound removeFluxBound(long n) { 375 long cPtr = libsbmlJNI.FbcModelPlugin_removeFluxBound__SWIG_0(swigCPtr, this, n); 376 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 377 } 378 379 380/** 381 * Removes the {@link FluxBound} object with the given <code>sid</code> attribute from 382 * this plugin object and returns a pointer to it. 383 <p> 384 * The caller owns the returned object and is responsible for 385 * deleting it. 386 <p> 387 * @param sid the id attribute of the {@link FluxBound} object to remove 388 <p> 389 * @return the {@link FluxBound} object removed. As mentioned above, the 390 * caller owns the returned object. <code>null</code> is returned if the 391 * given index is out of range. 392 */ public 393 FluxBound removeFluxBound(String sid) { 394 long cPtr = libsbmlJNI.FbcModelPlugin_removeFluxBound__SWIG_1(swigCPtr, this, sid); 395 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 396 } 397 398 399/** 400 * Returns the number of {@link FluxBound} object in this plugin object. 401 <p> 402 * @return the number of {@link FluxBound} object in this plugin object. 403 */ public 404 long getNumFluxBounds() { 405 return libsbmlJNI.FbcModelPlugin_getNumFluxBounds(swigCPtr, this); 406 } 407 408 409/** 410 * Returns the 'ListOfObjectives' in this {@link FbcModelPlugin} object. 411 <p> 412 * @return the 'ListOfObjectives' attribute of this {@link FbcModelPlugin}. 413 */ public 414 ListOfObjectives getListOfObjectives() { 415 long cPtr = libsbmlJNI.FbcModelPlugin_getListOfObjectives__SWIG_0(swigCPtr, this); 416 return (cPtr == 0) ? null : new ListOfObjectives(cPtr, false); 417 } 418 419 420/** 421 * Get a {@link Objective} from the {@link ListOfObjectives}. 422 <p> 423 * @param n the index number of the {@link Objective} to get. 424 <p> 425 * @return the nth {@link Objective} in the {@link ListOfObjectives} within this {@link FbcModelPlugin}. 426 <p> 427 * @see #getNumObjectives() 428 */ public 429 Objective getObjective(long n) { 430 long cPtr = libsbmlJNI.FbcModelPlugin_getObjective__SWIG_0(swigCPtr, this, n); 431 return (cPtr == 0) ? null : new Objective(cPtr, false); 432 } 433 434 435/** 436 * Get a {@link Objective} from the {@link ListOfObjectives} 437 * based on its identifier. 438 <p> 439 * @param sid a string representing the identifier 440 * of the {@link Objective} to get. 441 <p> 442 * @return the {@link Objective} in the {@link ListOfObjectives} 443 * with the given id or null if no such 444 * {@link Objective} exists. 445 <p> 446 * 447 * @see #getNumObjectives() 448 <p> 449 * @see #getObjective(long n) 450 */ public 451 Objective getObjective(String sid) { 452 long cPtr = libsbmlJNI.FbcModelPlugin_getObjective__SWIG_2(swigCPtr, this, sid); 453 return (cPtr == 0) ? null : new Objective(cPtr, false); 454 } 455 456 457/** 458 * Adds a copy the given 'Objective' to this {@link FbcModelPlugin}. 459 <p> 460 * @param o; the {@link Objective} object to add 461 <p> 462 * @return integer value indicating success/failure of the 463 * function. The possible values 464 * returned by this function are: 465 * <ul> 466 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 467 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 468 * </ul> 469 */ public 470 int addObjective(Objective o) { 471 return libsbmlJNI.FbcModelPlugin_addObjective(swigCPtr, this, Objective.getCPtr(o), o); 472 } 473 474 475/** 476 * Get the number of {@link Objective} objects in this {@link FbcModelPlugin}. 477 <p> 478 * @return the number of {@link Objective} objects in this {@link FbcModelPlugin} 479 */ public 480 long getNumObjectives() { 481 return libsbmlJNI.FbcModelPlugin_getNumObjectives(swigCPtr, this); 482 } 483 484 485/** 486 * Creates a new {@link Objective} object, adds it to this FbcModelPlugins 487 * {@link ListOfObjectives} and returns the {@link Objective} object created. 488 <p> 489 * @return a new {@link Objective} object instance 490 <p> 491 * @see #addObjective(Objective o) 492 */ public 493 Objective createObjective() { 494 long cPtr = libsbmlJNI.FbcModelPlugin_createObjective(swigCPtr, this); 495 return (cPtr == 0) ? null : new Objective(cPtr, false); 496 } 497 498 499/** 500 * Removes the nth {@link Objective} from the {@link ListOfObjectives} within this {@link FbcModelPlugin}. 501 * and returns a pointer to it. 502 <p> 503 * The caller owns the returned item and is responsible for deleting it. 504 <p> 505 * @param n the index of the {@link Objective} to remove. 506 <p> 507 * @see #getNumObjectives() 508 */ public 509 Objective removeObjective(long n) { 510 long cPtr = libsbmlJNI.FbcModelPlugin_removeObjective__SWIG_0(swigCPtr, this, n); 511 return (cPtr == 0) ? null : new Objective(cPtr, true); 512 } 513 514 515/** 516 * Removes the {@link Objective} with the given identifier from the {@link ListOfObjectives} within this {@link FbcModelPlugin} 517 * and returns a pointer to it. 518 <p> 519 * The caller owns the returned item and is responsible for deleting it. 520 * If none of the items in this list have the identifier <code>sid</code>, then 521 * <code>null</code> is returned. 522 <p> 523 * @param sid the identifier of the {@link Objective} to remove. 524 <p> 525 * @return the {@link Objective} removed. As mentioned above, the caller owns the 526 * returned item. 527 */ public 528 Objective removeObjective(String sid) { 529 long cPtr = libsbmlJNI.FbcModelPlugin_removeObjective__SWIG_1(swigCPtr, this, sid); 530 return (cPtr == 0) ? null : new Objective(cPtr, true); 531 } 532 533 534/** 535 * Returns the current active objective. 536 */ public 537 Objective getActiveObjective() { 538 long cPtr = libsbmlJNI.FbcModelPlugin_getActiveObjective__SWIG_0(swigCPtr, this); 539 return (cPtr == 0) ? null : new Objective(cPtr, false); 540 } 541 542 543/** 544 * Sets the id of the active objective. 545 */ public 546 int setActiveObjectiveId(String objectiveId) { 547 return libsbmlJNI.FbcModelPlugin_setActiveObjectiveId(swigCPtr, this, objectiveId); 548 } 549 550 551/** 552 * returns the id of the current active objective. 553 */ public 554 String getActiveObjectiveId() { 555 return libsbmlJNI.FbcModelPlugin_getActiveObjectiveId(swigCPtr, this); 556 } 557 558 559/** 560 * Unsets the active objective. 561 */ public 562 void unsetActiveObjectiveId() { 563 libsbmlJNI.FbcModelPlugin_unsetActiveObjectiveId(swigCPtr, this); 564 } 565 566 567/** 568 * Returns the 'ListOfGeneProducts' in this {@link FbcModelPlugin} object. 569 <p> 570 * @return the 'ListOfGeneProducts' attribute of this {@link FbcModelPlugin}. 571 */ public 572 ListOfGeneProducts getListOfGeneProducts() { 573 long cPtr = libsbmlJNI.FbcModelPlugin_getListOfGeneProducts__SWIG_0(swigCPtr, this); 574 return (cPtr == 0) ? null : new ListOfGeneProducts(cPtr, false); 575 } 576 577 578/** 579 * Get a {@link GeneProduct} from the {@link ListOfGeneProducts}. 580 <p> 581 * @param n the index number of the {@link GeneProduct} to get. 582 <p> 583 * @return the nth {@link GeneProduct} in the {@link ListOfGeneProducts} within this {@link FbcModelPlugin}. 584 <p> 585 * @see #getNumGeneProducts() 586 */ public 587 GeneProduct getGeneProduct(long n) { 588 long cPtr = libsbmlJNI.FbcModelPlugin_getGeneProduct__SWIG_0(swigCPtr, this, n); 589 return (cPtr == 0) ? null : new GeneProduct(cPtr, false); 590 } 591 592 593/** 594 * Get a {@link GeneProduct} from the {@link ListOfGeneProducts} 595 * based on its identifier. 596 <p> 597 * @param sid a string representing the identifier 598 * of the {@link GeneProduct} to get. 599 <p> 600 * @return the {@link GeneProduct} in the {@link ListOfGeneProducts} 601 * with the given id or null if no such 602 * {@link GeneProduct} exists. 603 <p> 604 * 605 * @see #getNumGeneProducts() 606 <p> 607 * @see #getGeneProduct(long n) 608 */ public 609 GeneProduct getGeneProduct(String sid) { 610 long cPtr = libsbmlJNI.FbcModelPlugin_getGeneProduct__SWIG_2(swigCPtr, this, sid); 611 return (cPtr == 0) ? null : new GeneProduct(cPtr, false); 612 } 613 614 615/** 616 * Get a {@link GeneProduct} from the {@link ListOfGeneProducts} 617 * based on its label. 618 <p> 619 * @param label a string representing the label 620 * of the {@link GeneProduct} to get. 621 <p> 622 * @return the {@link GeneProduct} in the {@link ListOfGeneProducts} 623 * with the given label or null if no such 624 * {@link GeneProduct} exists. 625 <p> 626 * 627 * @see #getNumGeneProducts() 628 <p> 629 * @see #getGeneProduct(long n) 630 */ public 631 GeneProduct getGeneProductByLabel(String label) { 632 long cPtr = libsbmlJNI.FbcModelPlugin_getGeneProductByLabel(swigCPtr, this, label); 633 return (cPtr == 0) ? null : new GeneProduct(cPtr, false); 634 } 635 636 637/** 638 * Adds a copy the given 'GeneProduct' to this {@link FbcModelPlugin}. 639 <p> 640 * @param gp; the {@link GeneProduct} object to add 641 <p> 642 * @return integer value indicating success/failure of the 643 * function. The possible values 644 * returned by this function are: 645 * <ul> 646 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 647 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 648 * </ul> 649 */ public 650 int addGeneProduct(GeneProduct gp) { 651 return libsbmlJNI.FbcModelPlugin_addGeneProduct(swigCPtr, this, GeneProduct.getCPtr(gp), gp); 652 } 653 654 655/** 656 * Get the number of {@link GeneProduct} objects in this {@link FbcModelPlugin}. 657 <p> 658 * @return the number of {@link GeneProduct} objects in this {@link FbcModelPlugin} 659 */ public 660 long getNumGeneProducts() { 661 return libsbmlJNI.FbcModelPlugin_getNumGeneProducts(swigCPtr, this); 662 } 663 664 665/** 666 * Creates a new {@link GeneProduct} object, adds it to this FbcModelPlugins 667 * {@link ListOfGeneProducts} and returns the {@link GeneProduct} object created. 668 <p> 669 * @return a new {@link GeneProduct} object instance 670 <p> 671 * @see #addGeneProduct(GeneProduct gp) 672 */ public 673 GeneProduct createGeneProduct() { 674 long cPtr = libsbmlJNI.FbcModelPlugin_createGeneProduct(swigCPtr, this); 675 return (cPtr == 0) ? null : new GeneProduct(cPtr, false); 676 } 677 678 679/** 680 * Removes the nth {@link GeneProduct} from the {@link ListOfGeneProducts} within this {@link FbcModelPlugin}. 681 * and returns a pointer to it. 682 <p> 683 * The caller owns the returned item and is responsible for deleting it. 684 <p> 685 * @param n the index of the {@link GeneProduct} to remove. 686 <p> 687 * @see #getNumGeneProducts() 688 */ public 689 GeneProduct removeGeneProduct(long n) { 690 long cPtr = libsbmlJNI.FbcModelPlugin_removeGeneProduct__SWIG_0(swigCPtr, this, n); 691 return (cPtr == 0) ? null : new GeneProduct(cPtr, true); 692 } 693 694 695/** 696 * Removes the {@link GeneProduct} with the given identifier from the {@link ListOfGeneProducts} within this {@link FbcModelPlugin} 697 * and returns a pointer to it. 698 <p> 699 * The caller owns the returned item and is responsible for deleting it. 700 * If none of the items in this list have the identifier <code>sid</code>, then 701 * <code>null</code> is returned. 702 <p> 703 * @param sid the identifier of the {@link GeneProduct} to remove. 704 <p> 705 * @return the {@link GeneProduct} removed. As mentioned above, the caller owns the 706 * returned item. 707 */ public 708 GeneProduct removeGeneProduct(String sid) { 709 long cPtr = libsbmlJNI.FbcModelPlugin_removeGeneProduct__SWIG_1(swigCPtr, this, sid); 710 return (cPtr == 0) ? null : new GeneProduct(cPtr, true); 711 } 712 713 714/** 715 * Returns the {@link ListOfGeneAssociations} annotation object for level 1 in this plugin object. 716 <p> 717 * @return {@link ListOfGeneAssociations} annotation object for level 1 in this plugin object. 718 */ public 719 ListOfGeneAssociations getListOfGeneAssociations() { 720 long cPtr = libsbmlJNI.FbcModelPlugin_getListOfGeneAssociations__SWIG_0(swigCPtr, this); 721 return (cPtr == 0) ? null : new ListOfGeneAssociations(cPtr, false); 722 } 723 724 725/** 726 * Returns the {@link GeneAssociation} annotation object that belongs to the given index. If the 727 * index is invalid, <code>null</code> is returned. 728 <p> 729 * @param n the index number of the {@link GeneAssociation} annotation to get. 730 <p> 731 * @return the nth {@link GeneAssociation} annotation in the {@link ListOfGeneAssociations}. 732 */ public 733 GeneAssociation getGeneAssociation(long n) { 734 long cPtr = libsbmlJNI.FbcModelPlugin_getGeneAssociation__SWIG_0(swigCPtr, this, n); 735 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 736 } 737 738 739/** 740 * Returns the {@link GeneAssociation} annotation object based on its identifier. 741 <p> 742 * @param sid a string representing the identifier 743 * of the {@link GeneAssociation} annotation to get. 744 <p> 745 * @return {@link GeneAssociation} annotation in the {@link ListOfGeneAssociations} with the given <code>sid</code> 746 * or null if no such {@link GeneAssociation} annotation exists. 747 <p> 748 * @see #getGeneAssociation(long n) 749 * @see #getListOfGeneAssociations() 750 */ public 751 GeneAssociation getGeneAssociation(String sid) { 752 long cPtr = libsbmlJNI.FbcModelPlugin_getGeneAssociation__SWIG_2(swigCPtr, this, sid); 753 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 754 } 755 756 757/** 758 * Adds a copy of the given {@link GeneAssociation} annotation object to the list of GeneAssociations. 759 <p> 760 * @param association the {@link GeneAssociation} annotation object to be added to the list of GeneAssociations. 761 <p> 762 * <p> 763 * @return integer value indicating success/failure of the 764 * function. The possible values 765 * returned by this function are: 766 * <ul> 767 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 768 * </ul> 769 */ public 770 int addGeneAssociation(GeneAssociation association) { 771 return libsbmlJNI.FbcModelPlugin_addGeneAssociation(swigCPtr, this, GeneAssociation.getCPtr(association), association); 772 } 773 774 775/** 776 * Creates a new {@link GeneAssociation} annotation object and adds it to the list of {@link GeneAssociation} objects 777 * and returns it. 778 <p> 779 * @return a newly created {@link GeneAssociation} annotation object 780 */ public 781 GeneAssociation createGeneAssociation() { 782 long cPtr = libsbmlJNI.FbcModelPlugin_createGeneAssociation(swigCPtr, this); 783 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 784 } 785 786 787/** 788 * Removes the nth {@link GeneAssociation} annotation object from this plugin object and 789 * returns a pointer to it. 790 <p> 791 * The caller owns the returned object and is responsible for 792 * deleting it. 793 <p> 794 * @param n the index of the {@link GeneAssociation} annotation object to remove 795 <p> 796 * @return the {@link GeneAssociation} annotation object removed. As mentioned above, the 797 * caller owns the returned object. <code>null</code> is returned if the 798 * given index is out of range. 799 */ public 800 GeneAssociation removeGeneAssociation(long n) { 801 long cPtr = libsbmlJNI.FbcModelPlugin_removeGeneAssociation__SWIG_0(swigCPtr, this, n); 802 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 803 } 804 805 806/** 807 * Removes the {@link GeneAssociation} annotation object with the given <code>sid</code> attribute from 808 * this plugin object and returns a pointer to it. 809 <p> 810 * The caller owns the returned object and is responsible for 811 * deleting it. 812 <p> 813 * @param sid the id attribute of the {@link GeneAssociation} annotation object to remove 814 <p> 815 * @return the {@link GeneAssociation} annotation object removed. As mentioned above, the 816 * caller owns the returned object. <code>null</code> is returned if the 817 * given index is out of range. 818 */ public 819 GeneAssociation removeGeneAssociation(String sid) { 820 long cPtr = libsbmlJNI.FbcModelPlugin_removeGeneAssociation__SWIG_1(swigCPtr, this, sid); 821 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 822 } 823 824 825/** 826 * Returns the number of {@link GeneAssociation} annotation object in this plugin object. 827 <p> 828 * @return the number of {@link GeneAssociation} annotation object in this plugin object. 829 */ public 830 int getNumGeneAssociations() { 831 return libsbmlJNI.FbcModelPlugin_getNumGeneAssociations(swigCPtr, this); 832 } 833 834 835/** * @internal */ public 836 void connectToChild() { 837 libsbmlJNI.FbcModelPlugin_connectToChild(swigCPtr, this); 838 } 839 840 841/** * @internal */ public 842 void connectToParent(SBase sbase) { 843 libsbmlJNI.FbcModelPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase); 844 } 845 846 847/** * @internal */ public 848 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 849 libsbmlJNI.FbcModelPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 850 } 851 852}