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 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>, in 027 * Version 2 of this package, is used to 028 * apply an additional set of restrictions to the model. The 'strict' 029 * attribute helps ensure that the Flux Balance Constraints package can be 030 * used to encode legacy flux-balance analysis models expressible as Linear 031 * Programs (LP's) for software that is unable to analyze arbitrary 032 * mathematical expressions that may appear in an SBML model. In addition, a 033 * 'strict' model is fully described and mathematically consistent, for 034 * example, by ensuring that all fluxes have a valid upper or lower bound. 035 <p> 036 * The following restrictions are in effect if an “fbc” model 037 * object has a value of <code>'true'</code> for the attribute 'strict' on 038 * Model: 039 <p> 040 * <ul> 041 * <li> Each {@link Reaction} in a {@link Model} must define values for the attributes 042 * 'lowerFluxBound' and 'upperFluxBound', with each attribute pointing to a 043 * valid {@link Parameter} object defined in the current {@link Model}. 044 <p> 045 * <li> Each {@link Parameter} object referred to by the {@link Reaction} attributes 046 * 'lowerFluxBound' and 'upperFluxBound' must have its 'constant' attribute 047 * set to the value <code>'true'</code> and its 'value' attribute set to a 048 * value of type <code>double</code>. This value may not be 049 * <code>'NaN'</code>. 050 <p> 051 * <li> {@link SpeciesReference} objects in {@link Reaction} objects must have their 052 * 'stoichiometry' attribute set to a <code>double</code> value that is not 053 * <code>'NaN'</code>, nor <code>'-INF'</code>, nor <code>'INF'</code>. In 054 * addition, the value of their 'constant' attribute must be set to 055 * <code>'true'</code>. 056 <p> 057 * <li> {@link InitialAssignment} objects may not target the {@link Parameter} objects 058 * referenced by the {@link Reaction} attributes 'lowerFluxBound' and 059 * 'upperFluxBound', nor any {@link SpeciesReference} objects. 060 <p> 061 * <li> All defined {@link FluxObjective} objects must have their coefficient 062 * attribute set to a <code>double</code> value that is not 063 * <code>'NaN'</code>, nor <code>'-INF'</code>, nor <code>'INF'</code>. 064 <p> 065 * <li> A {@link Reaction} 'lowerFluxBound' attribute may not point to a {@link Parameter} 066 * object that has a value of <code>'INF'</code>. 067 <p> 068 * <li> A {@link Reaction} 'upperFluxBound' attribute may not point to a {@link Parameter} 069 * object that has a value of <code>'-INF'</code>. 070 <p> 071 * <li> For all {@link Reaction} objects, the value of a 'lowerFluxBound' attribute 072 * must be less than or equal to the value of the 'upperFluxBound' attribute. 073 * 074 * </ul> <p> 075 * While it is not compulsory for a 'strict' Flux Balance Constraints model 076 * to define an {@link Objective}, doing so does does allow the model to be 077 * formulated as a Linear Program and optimized. However, this decision is 078 * left to the modeler. Note that all other properties of the objects 079 * referred to in the list above are to be set as specified in the relevant 080 * SBML Level 3 Version 1 Core and <a href='../../../extensions-summary.html#fbc'>Flux Balance Constraints</a> (“fbc”) 081 * specifications. 082 <p> 083 * Alternatively, if the value of the strict attribute is 084 * <code>'false'</code>, then none of these restrictions apply and the model 085 * creator can choose to define “fbc” models that are not 086 * necessarily encodable as an LP. For example, if strict is 087 * <code>'false'</code>, the {@link InitialAssignment} construct may be used to set 088 * any valid numerical entity, including {@link Parameter} values and stoichiometric 089 * coefficients, with any value of type <code>double</code>. In addition, 090 * {@link Parameter} elements are no longer required to be flagged as constant, thus 091 * allowing for a Flux Balance Constraints model's use in alternative, hybrid 092 * modeling strategies. 093 <p> 094 * <h2>Lists of subobjects on the (extended) {@link Model} class</h2> 095 <p> 096 * The {@link ListOfObjectives} is used to define the objectives of a given 097 * “fbc” model. Objectives generally consist of linear 098 * combinations of model variables (fluxes) and a direction for the 099 * optimality constraint (either maximization or minimization). Each 100 * {@link Objective} has a {@link ListOfFluxObjectives} subobjects. 101 <p> 102 * In Version 2 of “fbc”, the {@link ListOfGeneProducts} is used to 103 * define the gene products represented by the “fbc” model. 104 <p> 105 * In Version 1 of “fbc”, there is no {@link ListOfGeneProducts}, 106 * and instead, {@link Model} can have an optional {@link ListOfFluxBounds}. 107 <p> 108 * @see Objective 109 * @see FluxObjective 110 * @see FluxBound 111 */ 112 113public class FbcModelPlugin extends SBasePlugin { 114 private long swigCPtr; 115 116 protected FbcModelPlugin(long cPtr, boolean cMemoryOwn) 117 { 118 super(libsbmlJNI.FbcModelPlugin_SWIGUpcast(cPtr), cMemoryOwn); 119 swigCPtr = cPtr; 120 } 121 122 protected static long getCPtr(FbcModelPlugin obj) 123 { 124 return (obj == null) ? 0 : obj.swigCPtr; 125 } 126 127 protected static long getCPtrAndDisown (FbcModelPlugin obj) 128 { 129 long ptr = 0; 130 131 if (obj != null) 132 { 133 ptr = obj.swigCPtr; 134 obj.swigCMemOwn = false; 135 } 136 137 return ptr; 138 } 139 140 protected void finalize() { 141 delete(); 142 } 143 144 public synchronized void delete() { 145 if (swigCPtr != 0) { 146 if (swigCMemOwn) { 147 swigCMemOwn = false; 148 libsbmlJNI.delete_FbcModelPlugin(swigCPtr); 149 } 150 swigCPtr = 0; 151 } 152 super.delete(); 153 } 154 155 156/** 157 * Creates a new {@link FbcModelPlugin} object using the given parameters. 158 <p> 159 * <p> 160 * In the XML representation of an SBML document, XML namespaces are used to 161 * identify the origin of each XML construct used. XML namespaces are 162 * identified by their unique resource identifiers (URIs). The core SBML 163 * specifications stipulate the namespaces that must be used for core SBML 164 * constructs; for example, all XML elements that belong to SBML Level 3 165 * Version 1 Core must be placed in the XML namespace identified by the URI 166 * <code>'http://www.sbml.org/sbml/level3/version1/core'</code>. Individual 167 * SBML Level 3 packages define their own XML namespaces; for example, 168 * all elements belonging to the SBML Level 3 Layout Version 1 169 * package must be placed in the XML namespace 170 * <code>'http://www.sbml.org/sbml/level3/version1/layout/version1/'</code>. 171 <p> 172 * <p> 173 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 174 * information. It is used to communicate the SBML Level, Version, and (in 175 * Level 3) packages used in addition to SBML Level 3 Core. A 176 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 177 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object 178 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 179 <p> 180 * @param uri the URI of the SBML Level 3 package implemented by 181 * this libSBML package extension. 182 <p> 183 * @param prefix the XML namespace prefix being used for the package. 184 <p> 185 * @param fbcns the namespaces object for the package. 186 */ public 187 FbcModelPlugin(String uri, String prefix, FbcPkgNamespaces fbcns) { 188 this(libsbmlJNI.new_FbcModelPlugin__SWIG_0(uri, prefix, FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 189 } 190 191 192/** 193 * Copy constructor for {@link FbcModelPlugin}. 194 <p> 195 * @param orig the {@link FbcModelPlugin} instance to copy. 196 */ public 197 FbcModelPlugin(FbcModelPlugin orig) { 198 this(libsbmlJNI.new_FbcModelPlugin__SWIG_1(FbcModelPlugin.getCPtr(orig), orig), true); 199 } 200 201 202/** 203 * Creates and returns a deep copy of this {@link FbcModelPlugin} object. 204 <p> 205 * @return a (deep) copy of this {@link FbcModelPlugin} object. 206 */ public 207 SBasePlugin cloneObject() { 208 long cPtr = libsbmlJNI.FbcModelPlugin_cloneObject(swigCPtr, this); 209 return (cPtr == 0) ? null : new FbcModelPlugin(cPtr, true); 210 } 211 212 213/** * @internal */ public 214 SBase createObject(XMLInputStream stream) { 215 return libsbml.DowncastSBase(libsbmlJNI.FbcModelPlugin_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false); 216} 217 218 219/** * @internal */ public 220 int appendFrom(Model model) { 221 return libsbmlJNI.FbcModelPlugin_appendFrom(swigCPtr, this, Model.getCPtr(model), model); 222 } 223 224 225/** * @internal */ public 226 boolean readOtherXML(SBase parentObject, XMLInputStream stream) { 227 return libsbmlJNI.FbcModelPlugin_readOtherXML(swigCPtr, this, SBase.getCPtr(parentObject), parentObject, XMLInputStream.getCPtr(stream), stream); 228 } 229 230 231/** * @internal */ public 232 void addExpectedAttributes(SWIGTYPE_p_ExpectedAttributes attributes) { 233 libsbmlJNI.FbcModelPlugin_addExpectedAttributes(swigCPtr, this, SWIGTYPE_p_ExpectedAttributes.getCPtr(attributes)); 234 } 235 236 237/** * @internal */ public 238 void readAttributes(XMLAttributes attributes, SWIGTYPE_p_ExpectedAttributes expectedAttributes) { 239 libsbmlJNI.FbcModelPlugin_readAttributes(swigCPtr, this, XMLAttributes.getCPtr(attributes), attributes, SWIGTYPE_p_ExpectedAttributes.getCPtr(expectedAttributes)); 240 } 241 242 243/** * @internal */ public 244 void writeAttributes(XMLOutputStream stream) { 245 libsbmlJNI.FbcModelPlugin_writeAttributes(swigCPtr, this, XMLOutputStream.getCPtr(stream), stream); 246 } 247 248 249/** 250 * Returns the value of the 'strict' attribute of this {@link FbcModelPlugin}. 251 <p> 252 * <p> 253 * @note The 'strict' attribute of the {@link FbcModelPlugin} is only defined for 254 * version 2 of the 'Flux Balance Constraints' specification, and has no 255 * equivalent in version 1 of the specification. 256 <p> 257 * @return the value of the 'strict' attribute of this {@link FbcModelPlugin} as a boolean. 258 */ public 259 boolean getStrict() { 260 return libsbmlJNI.FbcModelPlugin_getStrict(swigCPtr, this); 261 } 262 263 264/** 265 * Predicate returning <code>true</code> if this {@link FbcModelPlugin}'s 'strict' attribute 266 * is set. 267 <p> 268 * <p> 269 * @note The 'strict' attribute of the {@link FbcModelPlugin} is only defined for 270 * version 2 of the 'Flux Balance Constraints' specification, and has no 271 * equivalent in version 1 of the specification. 272 <p> 273 * @return <code>true</code> if this {@link FbcModelPlugin}'s 'strict' attribute has been set, 274 * otherwise <code>false</code> is returned. 275 */ public 276 boolean isSetStrict() { 277 return libsbmlJNI.FbcModelPlugin_isSetStrict(swigCPtr, this); 278 } 279 280 281/** 282 * Sets the value of the 'strict' attribute of this {@link FbcModelPlugin}. 283 <p> 284 * <p> 285 * @note The 'strict' attribute of the {@link FbcModelPlugin} is only defined for 286 * version 2 of the 'Flux Balance Constraints' specification, and has no 287 * equivalent in version 1 of the specification. 288 <p> 289 * @param strict boolean value of the 'strict' attribute to be set. 290 <p> 291 * <p> 292 * @return integer value indicating success/failure of the 293 * function. The possible values 294 * returned by this function are: 295 * <ul> 296 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 297 * </ul> 298 */ public 299 int setStrict(boolean strict) { 300 return libsbmlJNI.FbcModelPlugin_setStrict(swigCPtr, this, strict); 301 } 302 303 304/** 305 * Unsets the value of the 'strict' attribute of this {@link FbcModelPlugin}. 306 <p> 307 * <p> 308 * @note The 'strict' attribute of the {@link FbcModelPlugin} is only defined for 309 * version 2 of the 'Flux Balance Constraints' specification, and has no 310 * equivalent in version 1 of the specification. 311 <p> 312 * <p> 313 * @return integer value indicating success/failure of the 314 * function. The possible values 315 * returned by this function are: 316 * <ul> 317 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 318 * </ul> 319 */ public 320 int unsetStrict() { 321 return libsbmlJNI.FbcModelPlugin_unsetStrict(swigCPtr, this); 322 } 323 324 325/** 326 * Returns the {@link ListOfFluxBounds} in this plugin object. 327 <p> 328 * <p> 329 * @note {@link FluxBound} objects are only defined for version 1 330 * of the 'Flux Balance Constraints' specification, and are 331 * replaced in version 2 by the 'upperFluxBound' and 332 * 'lowerFluxBound' attributes of the {@link FbcReactionPlugin}. 333 <p> 334 * @return {@link ListOfFluxBounds} object in this plugin object. 335 */ public 336 ListOfFluxBounds getListOfFluxBounds() { 337 long cPtr = libsbmlJNI.FbcModelPlugin_getListOfFluxBounds__SWIG_0(swigCPtr, this); 338 return (cPtr == 0) ? null : new ListOfFluxBounds(cPtr, false); 339 } 340 341 342/** 343 * Returns the {@link FluxBound} object that belongs to the given index. If the 344 * index is invalid, <code>null</code> is returned. 345 <p> 346 * <p> 347 * @note {@link FluxBound} objects are only defined for version 1 348 * of the 'Flux Balance Constraints' specification, and are 349 * replaced in version 2 by the 'upperFluxBound' and 350 * 'lowerFluxBound' attributes of the {@link FbcReactionPlugin}. 351 <p> 352 * @param n the index number of the {@link FluxBound} to get. 353 <p> 354 * @return the nth {@link FluxBound} in the {@link ListOfFluxBounds}. 355 */ public 356 FluxBound getFluxBound(long n) { 357 long cPtr = libsbmlJNI.FbcModelPlugin_getFluxBound__SWIG_0(swigCPtr, this, n); 358 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 359 } 360 361 362/** 363 * Returns the {@link FluxBound} object based on its identifier. 364 <p> 365 * <p> 366 * @note {@link FluxBound} objects are only defined for version 1 367 * of the 'Flux Balance Constraints' specification, and are 368 * replaced in version 2 by the 'upperFluxBound' and 369 * 'lowerFluxBound' attributes of the {@link FbcReactionPlugin}. 370 <p> 371 * @param sid a string representing the identifier 372 * of the {@link FluxBound} to get. 373 <p> 374 * @return {@link FluxBound} in the {@link ListOfFluxBounds} with the given <code>sid</code> 375 * or <code>null</code> if no such {@link FluxBound} exists. 376 <p> 377 * @see #getFluxBound(long n) 378 * @see #getListOfFluxBounds() 379 */ public 380 FluxBound getFluxBound(String sid) { 381 long cPtr = libsbmlJNI.FbcModelPlugin_getFluxBound__SWIG_2(swigCPtr, this, sid); 382 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 383 } 384 385 386/** 387 * Creates a new {@link ListOfFluxBounds} object that contains only the 388 * {@link FluxBound} objects associated with the given {@link Reaction}. If no such 389 * {@link Reaction} can be found, or if there are no {@link FluxBound} objects associated 390 * with it, returns null. 391 <p> 392 * <p> 393 * @note {@link FluxBound} objects are only defined for version 1 394 * of the 'Flux Balance Constraints' specification, and are 395 * replaced in version 2 by the 'upperFluxBound' and 396 * 'lowerFluxBound' attributes of the {@link FbcReactionPlugin}. 397 <p> 398 * @param reaction the id of an reaction to find {@link FluxBound} objects for. 399 <p> 400 * @return a {@link ListOfFluxBounds} for the given reaction id. 401 */ public 402 ListOfFluxBounds getFluxBoundsForReaction(String reaction) { 403 long cPtr = libsbmlJNI.FbcModelPlugin_getFluxBoundsForReaction(swigCPtr, this, reaction); 404 return (cPtr == 0) ? null : new ListOfFluxBounds(cPtr, false); 405 } 406 407 408/** 409 * Adds a copy of the given {@link FluxBound} object to the list of FluxBounds. 410 <p> 411 * <p> 412 * @note {@link FluxBound} objects are only defined for version 1 413 * of the 'Flux Balance Constraints' specification, and are 414 * replaced in version 2 by the 'upperFluxBound' and 415 * 'lowerFluxBound' attributes of the {@link FbcReactionPlugin}. 416 <p> 417 * @param bound the {@link FluxBound} object to be added to the list of FluxBounds. 418 <p> 419 * <p> 420 * @return integer value indicating success/failure of the 421 * function. The possible values 422 * returned by this function are: 423 * <ul> 424 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 425 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 426 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 427 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 428 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 429 * <li> {@link libsbmlConstants#LIBSBML_PKG_VERSION_MISMATCH LIBSBML_PKG_VERSION_MISMATCH} 430 * </ul> 431 */ public 432 int addFluxBound(FluxBound bound) { 433 return libsbmlJNI.FbcModelPlugin_addFluxBound(swigCPtr, this, FluxBound.getCPtr(bound), bound); 434 } 435 436 437/** 438 * Creates a new {@link FluxBound} object and adds it to the list of {@link FluxBound} objects 439 * and returns it. 440 <p> 441 * <p> 442 * @note {@link FluxBound} objects are only defined for version 1 443 * of the 'Flux Balance Constraints' specification, and are 444 * replaced in version 2 by the 'upperFluxBound' and 445 * 'lowerFluxBound' attributes of the {@link FbcReactionPlugin}. 446 <p> 447 * @return a newly created {@link FluxBound} object. 448 */ public 449 FluxBound createFluxBound() { 450 long cPtr = libsbmlJNI.FbcModelPlugin_createFluxBound(swigCPtr, this); 451 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 452 } 453 454 455/** 456 * Removes the nth {@link FluxBound} object from this plugin object and 457 * returns a pointer to it. 458 <p> 459 * The caller owns the returned object and is responsible for 460 * deleting it. 461 <p> 462 * <p> 463 * @note {@link FluxBound} objects are only defined for version 1 464 * of the 'Flux Balance Constraints' specification, and are 465 * replaced in version 2 by the 'upperFluxBound' and 466 * 'lowerFluxBound' attributes of the {@link FbcReactionPlugin}. 467 <p> 468 * @param n the index of the {@link FluxBound} object to remove. 469 <p> 470 * @return the {@link FluxBound} object removed. As mentioned above, the 471 * caller owns the returned object. <code>null</code> is returned if the 472 * given index is out of range. 473 */ public 474 FluxBound removeFluxBound(long n) { 475 long cPtr = libsbmlJNI.FbcModelPlugin_removeFluxBound__SWIG_0(swigCPtr, this, n); 476 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 477 } 478 479 480/** 481 * Removes the {@link FluxBound} object with the given <code>sid</code> attribute from 482 * this plugin object and returns a pointer to it. 483 <p> 484 * The caller owns the returned object and is responsible for 485 * deleting it. 486 <p> 487 * <p> 488 * @note {@link FluxBound} objects are only defined for version 1 489 * of the 'Flux Balance Constraints' specification, and are 490 * replaced in version 2 by the 'upperFluxBound' and 491 * 'lowerFluxBound' attributes of the {@link FbcReactionPlugin}. 492 <p> 493 * @param sid the id attribute of the {@link FluxBound} object to remove. 494 <p> 495 * @return the {@link FluxBound} object removed. As mentioned above, the 496 * caller owns the returned object. <code>null</code> is returned if the 497 * given index is out of range. 498 */ public 499 FluxBound removeFluxBound(String sid) { 500 long cPtr = libsbmlJNI.FbcModelPlugin_removeFluxBound__SWIG_1(swigCPtr, this, sid); 501 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 502 } 503 504 505/** 506 * Returns the number of {@link FluxBound} object in this plugin object. 507 <p> 508 * <p> 509 * @note {@link FluxBound} objects are only defined for version 1 510 * of the 'Flux Balance Constraints' specification, and are 511 * replaced in version 2 by the 'upperFluxBound' and 512 * 'lowerFluxBound' attributes of the {@link FbcReactionPlugin}. 513 <p> 514 * @return the number of {@link FluxBound} object in this plugin object. 515 */ public 516 long getNumFluxBounds() { 517 return libsbmlJNI.FbcModelPlugin_getNumFluxBounds(swigCPtr, this); 518 } 519 520 521/** 522 * Returns the {@link ListOfObjectives} in this {@link FbcModelPlugin} object. 523 <p> 524 * @return the {@link ListOfObjectives} child of this {@link FbcModelPlugin}. 525 */ public 526 ListOfObjectives getListOfObjectives() { 527 long cPtr = libsbmlJNI.FbcModelPlugin_getListOfObjectives__SWIG_0(swigCPtr, this); 528 return (cPtr == 0) ? null : new ListOfObjectives(cPtr, false); 529 } 530 531 532/** 533 * Get an {@link Objective} from the {@link ListOfObjectives}. 534 <p> 535 * @param n the index number of the {@link Objective} to get. 536 <p> 537 * @return the nth {@link Objective} in the {@link ListOfObjectives} within this {@link FbcModelPlugin}. 538 <p> 539 * @see #getNumObjectives() 540 */ public 541 Objective getObjective(long n) { 542 long cPtr = libsbmlJNI.FbcModelPlugin_getObjective__SWIG_0(swigCPtr, this, n); 543 return (cPtr == 0) ? null : new Objective(cPtr, false); 544 } 545 546 547/** 548 * Get an {@link Objective} from the {@link ListOfObjectives} 549 * based on its identifier. 550 <p> 551 * @param sid a string representing the identifier 552 * of the {@link Objective} to get. 553 <p> 554 * @return the {@link Objective} in the {@link ListOfObjectives} 555 * with the given id or <code>null</code> if no such 556 * {@link Objective} exists. 557 <p> 558 * 559 * @see #getNumObjectives() 560 <p> 561 * @see #getObjective(long n) 562 */ public 563 Objective getObjective(String sid) { 564 long cPtr = libsbmlJNI.FbcModelPlugin_getObjective__SWIG_2(swigCPtr, this, sid); 565 return (cPtr == 0) ? null : new Objective(cPtr, false); 566 } 567 568 569/** 570 * Adds a copy the given {@link Objective} to this {@link FbcModelPlugin}. 571 <p> 572 * @param o the {@link Objective} object to add. 573 <p> 574 * <p> 575 * @return integer value indicating success/failure of the 576 * function. The possible values 577 * returned by this function are: 578 * <ul> 579 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 580 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 581 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 582 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 583 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 584 * <li> {@link libsbmlConstants#LIBSBML_PKG_VERSION_MISMATCH LIBSBML_PKG_VERSION_MISMATCH} 585 * </ul> 586 */ public 587 int addObjective(Objective o) { 588 return libsbmlJNI.FbcModelPlugin_addObjective(swigCPtr, this, Objective.getCPtr(o), o); 589 } 590 591 592/** 593 * Get the number of {@link Objective} objects in this {@link FbcModelPlugin}. 594 <p> 595 * @return the number of {@link Objective} objects in this {@link FbcModelPlugin}. 596 */ public 597 long getNumObjectives() { 598 return libsbmlJNI.FbcModelPlugin_getNumObjectives(swigCPtr, this); 599 } 600 601 602/** 603 * Creates a new {@link Objective} object, adds it to this {@link FbcModelPlugin}'s 604 * {@link ListOfObjectives} and returns the {@link Objective} object created. 605 <p> 606 * @return a new {@link Objective} object instance. 607 <p> 608 * @see #addObjective(Objective o) 609 */ public 610 Objective createObjective() { 611 long cPtr = libsbmlJNI.FbcModelPlugin_createObjective(swigCPtr, this); 612 return (cPtr == 0) ? null : new Objective(cPtr, false); 613 } 614 615 616/** 617 * Removes the nth {@link Objective} from the {@link ListOfObjectives} within this {@link FbcModelPlugin}. 618 * and returns a pointer to it. 619 <p> 620 * The caller owns the returned item and is responsible for deleting it. 621 <p> 622 * @param n the index of the {@link Objective} to remove. 623 <p> 624 * @see #getNumObjectives() 625 */ public 626 Objective removeObjective(long n) { 627 long cPtr = libsbmlJNI.FbcModelPlugin_removeObjective__SWIG_0(swigCPtr, this, n); 628 return (cPtr == 0) ? null : new Objective(cPtr, true); 629 } 630 631 632/** 633 * Removes the {@link Objective} with the given identifier from the {@link ListOfObjectives} within this {@link FbcModelPlugin} 634 * and returns a pointer to it. 635 <p> 636 * The caller owns the returned item and is responsible for deleting it. 637 * If none of the items in this list have the identifier <code>sid</code>, then 638 * <code>null</code> is returned. 639 <p> 640 * @param sid the identifier of the {@link Objective} to remove. 641 <p> 642 * @return the {@link Objective} removed. As mentioned above, the caller owns the 643 * returned item. 644 */ public 645 Objective removeObjective(String sid) { 646 long cPtr = libsbmlJNI.FbcModelPlugin_removeObjective__SWIG_1(swigCPtr, this, sid); 647 return (cPtr == 0) ? null : new Objective(cPtr, true); 648 } 649 650 651/** 652 * Returns the current active objective. 653 <p> 654 * @return the {@link Objective} pointed to by the 'activeObjective' 655 * attribute, or <code>null</code> if no such {@link Objective} can be found. 656 */ public 657 Objective getActiveObjective() { 658 long cPtr = libsbmlJNI.FbcModelPlugin_getActiveObjective__SWIG_0(swigCPtr, this); 659 return (cPtr == 0) ? null : new Objective(cPtr, false); 660 } 661 662 663/** 664 * Sets the id of the active objective. 665 <p> 666 * <p> 667 * @return integer value indicating success/failure of the 668 * function. The possible values 669 * returned by this function are: 670 * <ul> 671 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 672 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 673 * </ul> 674 */ public 675 int setActiveObjectiveId(String objectiveId) { 676 return libsbmlJNI.FbcModelPlugin_setActiveObjectiveId(swigCPtr, this, objectiveId); 677 } 678 679 680/** 681 * Returns the id of the current active objective. 682 <p> 683 * @return the value of the 'activeObjective' attribute of the {@link ListOfObjectives}. 684 */ public 685 String getActiveObjectiveId() { 686 return libsbmlJNI.FbcModelPlugin_getActiveObjectiveId(swigCPtr, this); 687 } 688 689 690/** 691 * Unsets the 'activeObjective' attribute of the {@link ListOfObjectives}. 692 <p> 693 * <p> 694 * @return integer value indicating success/failure of the 695 * function. The possible values 696 * returned by this function are: 697 * <ul> 698 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 699 * 700 * </ul> <p> 701 * @return success status 702 */ public 703 int unsetActiveObjectiveId() { 704 return libsbmlJNI.FbcModelPlugin_unsetActiveObjectiveId(swigCPtr, this); 705 } 706 707 708/** 709 * Returns the {@link ListOfGeneProducts} in this {@link FbcModelPlugin} object. 710 <p> 711 * <p> 712 * @note {@link GeneProduct} objects are only defined for version 2 713 * of the 'Flux Balance Constraints' specification, and have no 714 * equivalent in version 1 of the specification. 715 <p> 716 * @return the {@link ListOfGeneProducts} child of this {@link FbcModelPlugin}. 717 */ public 718 ListOfGeneProducts getListOfGeneProducts() { 719 long cPtr = libsbmlJNI.FbcModelPlugin_getListOfGeneProducts__SWIG_0(swigCPtr, this); 720 return (cPtr == 0) ? null : new ListOfGeneProducts(cPtr, false); 721 } 722 723 724/** 725 * Get a {@link GeneProduct} from the {@link ListOfGeneProducts}. 726 <p> 727 * <p> 728 * @note {@link GeneProduct} objects are only defined for version 2 729 * of the 'Flux Balance Constraints' specification, and have no 730 * equivalent in version 1 of the specification. 731 <p> 732 * @param n the index number of the {@link GeneProduct} to get. 733 <p> 734 * @return the nth {@link GeneProduct} in the {@link ListOfGeneProducts} within this {@link FbcModelPlugin}. 735 <p> 736 * @see #getNumGeneProducts() 737 */ public 738 GeneProduct getGeneProduct(long n) { 739 long cPtr = libsbmlJNI.FbcModelPlugin_getGeneProduct__SWIG_0(swigCPtr, this, n); 740 return (cPtr == 0) ? null : new GeneProduct(cPtr, false); 741 } 742 743 744/** 745 * Get a {@link GeneProduct} from the {@link ListOfGeneProducts} 746 * based on its identifier. 747 <p> 748 * <p> 749 * @note {@link GeneProduct} objects are only defined for version 2 750 * of the 'Flux Balance Constraints' specification, and have no 751 * equivalent in version 1 of the specification. 752 <p> 753 * @param sid a string representing the identifier 754 * of the {@link GeneProduct} to get. 755 <p> 756 * @return the {@link GeneProduct} in the {@link ListOfGeneProducts} 757 * with the given id or <code>null</code> if no such 758 * {@link GeneProduct} exists. 759 <p> 760 * 761 * @see #getNumGeneProducts() 762 <p> 763 * @see #getGeneProduct(long n) 764 */ public 765 GeneProduct getGeneProduct(String sid) { 766 long cPtr = libsbmlJNI.FbcModelPlugin_getGeneProduct__SWIG_2(swigCPtr, this, sid); 767 return (cPtr == 0) ? null : new GeneProduct(cPtr, false); 768 } 769 770 771/** 772 * Get a {@link GeneProduct} from the {@link ListOfGeneProducts} 773 * based on its label. 774 <p> 775 * <p> 776 * @note {@link GeneProduct} objects are only defined for version 2 777 * of the 'Flux Balance Constraints' specification, and have no 778 * equivalent in version 1 of the specification. 779 <p> 780 * @param label a string representing the label 781 * of the {@link GeneProduct} to get. 782 <p> 783 * @return the {@link GeneProduct} in the {@link ListOfGeneProducts} 784 * with the given label or <code>null</code> if no such 785 * {@link GeneProduct} exists. 786 <p> 787 * 788 * @see #getNumGeneProducts() 789 <p> 790 * @see #getGeneProduct(long n) 791 */ public 792 GeneProduct getGeneProductByLabel(String label) { 793 long cPtr = libsbmlJNI.FbcModelPlugin_getGeneProductByLabel(swigCPtr, this, label); 794 return (cPtr == 0) ? null : new GeneProduct(cPtr, false); 795 } 796 797 798/** 799 * Adds a copy the given {@link GeneProduct} to this {@link FbcModelPlugin}. 800 <p> 801 * <p> 802 * @note {@link GeneProduct} objects are only defined for version 2 803 * of the 'Flux Balance Constraints' specification, and have no 804 * equivalent in version 1 of the specification. 805 <p> 806 * @param gp the {@link GeneProduct} object to add. 807 <p> 808 * <p> 809 * @return integer value indicating success/failure of the 810 * function. The possible values 811 * returned by this function are: 812 * <ul> 813 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 814 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 815 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 816 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 817 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 818 * <li> {@link libsbmlConstants#LIBSBML_PKG_VERSION_MISMATCH LIBSBML_PKG_VERSION_MISMATCH} 819 * </ul> 820 */ public 821 int addGeneProduct(GeneProduct gp) { 822 return libsbmlJNI.FbcModelPlugin_addGeneProduct(swigCPtr, this, GeneProduct.getCPtr(gp), gp); 823 } 824 825 826/** 827 * Get the number of {@link GeneProduct} objects in this {@link FbcModelPlugin}. 828 <p> 829 * <p> 830 * @note {@link GeneProduct} objects are only defined for version 2 831 * of the 'Flux Balance Constraints' specification, and have no 832 * equivalent in version 1 of the specification. 833 <p> 834 * @return the number of {@link GeneProduct} objects in this {@link FbcModelPlugin}. 835 */ public 836 long getNumGeneProducts() { 837 return libsbmlJNI.FbcModelPlugin_getNumGeneProducts(swigCPtr, this); 838 } 839 840 841/** 842 * Creates a new {@link GeneProduct} object, adds it to this {@link FbcModelPlugin}'s 843 * {@link ListOfGeneProducts} and returns the {@link GeneProduct} object created. 844 <p> 845 * <p> 846 * @note {@link GeneProduct} objects are only defined for version 2 847 * of the 'Flux Balance Constraints' specification, and have no 848 * equivalent in version 1 of the specification. 849 <p> 850 * @return a new {@link GeneProduct} object instance. 851 <p> 852 * @see #addGeneProduct(GeneProduct gp) 853 */ public 854 GeneProduct createGeneProduct() { 855 long cPtr = libsbmlJNI.FbcModelPlugin_createGeneProduct(swigCPtr, this); 856 return (cPtr == 0) ? null : new GeneProduct(cPtr, false); 857 } 858 859 860/** 861 * Removes the nth {@link GeneProduct} from the {@link ListOfGeneProducts} within this {@link FbcModelPlugin}. 862 * and returns a pointer to it. 863 <p> 864 * The caller owns the returned item and is responsible for deleting it. 865 <p> 866 * <p> 867 * @note {@link GeneProduct} objects are only defined for version 2 868 * of the 'Flux Balance Constraints' specification, and have no 869 * equivalent in version 1 of the specification. 870 <p> 871 * @param n the index of the {@link GeneProduct} to remove. 872 <p> 873 * @see #getNumGeneProducts() 874 */ public 875 GeneProduct removeGeneProduct(long n) { 876 long cPtr = libsbmlJNI.FbcModelPlugin_removeGeneProduct__SWIG_0(swigCPtr, this, n); 877 return (cPtr == 0) ? null : new GeneProduct(cPtr, true); 878 } 879 880 881/** 882 * Removes the {@link GeneProduct} with the given identifier from the {@link ListOfGeneProducts} within this {@link FbcModelPlugin} 883 * and returns a pointer to it. 884 <p> 885 * The caller owns the returned item and is responsible for deleting it. 886 * If none of the items in this list have the identifier <code>sid</code>, then 887 * <code>null</code> is returned. 888 <p> 889 * <p> 890 * @note {@link GeneProduct} objects are only defined for version 2 891 * of the 'Flux Balance Constraints' specification, and have no 892 * equivalent in version 1 of the specification. 893 <p> 894 * @param sid the identifier of the {@link GeneProduct} to remove. 895 <p> 896 * @return the {@link GeneProduct} removed. As mentioned above, the caller owns the 897 * returned item. 898 */ public 899 GeneProduct removeGeneProduct(String sid) { 900 long cPtr = libsbmlJNI.FbcModelPlugin_removeGeneProduct__SWIG_1(swigCPtr, this, sid); 901 return (cPtr == 0) ? null : new GeneProduct(cPtr, true); 902 } 903 904 905/** 906 * Returns the {@link ListOfGeneAssociations} annotation object for level 1 in this plugin object. 907 <p> 908 * <p> 909 * @note {@link GeneAssociation} objects are not defined in any version of the 910 * 'Flux Balance Constraints' specification, and can only be used for 911 * annotation purposes. Version 2 instead defines the 912 * {@link GeneProduct} and {@link GeneProductAssociation} classes to cover the information 913 * otherwise encoded here. 914 <p> 915 * @return {@link ListOfGeneAssociations} annotation object for level 1 in this plugin object. 916 */ public 917 ListOfGeneAssociations getListOfGeneAssociations() { 918 long cPtr = libsbmlJNI.FbcModelPlugin_getListOfGeneAssociations__SWIG_0(swigCPtr, this); 919 return (cPtr == 0) ? null : new ListOfGeneAssociations(cPtr, false); 920 } 921 922 923/** 924 * Returns the {@link GeneAssociation} annotation object that belongs to the given index. If the 925 * index is invalid, <code>null</code> is returned. 926 <p> 927 * <p> 928 * @note {@link GeneAssociation} objects are not defined in any version of the 929 * 'Flux Balance Constraints' specification, and can only be used for 930 * annotation purposes. Version 2 instead defines the 931 * {@link GeneProduct} and {@link GeneProductAssociation} classes to cover the information 932 * otherwise encoded here. 933 <p> 934 * @param n the index number of the {@link GeneAssociation} annotation to get. 935 <p> 936 * @return the nth {@link GeneAssociation} annotation in the {@link ListOfGeneAssociations}. 937 */ public 938 GeneAssociation getGeneAssociation(long n) { 939 long cPtr = libsbmlJNI.FbcModelPlugin_getGeneAssociation__SWIG_0(swigCPtr, this, n); 940 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 941 } 942 943 944/** 945 * Returns the {@link GeneAssociation} annotation object based on its identifier. 946 <p> 947 * <p> 948 * @note {@link GeneAssociation} objects are not defined in any version of the 949 * 'Flux Balance Constraints' specification, and can only be used for 950 * annotation purposes. Version 2 instead defines the 951 * {@link GeneProduct} and {@link GeneProductAssociation} classes to cover the information 952 * otherwise encoded here. 953 <p> 954 * @param sid a string representing the identifier 955 * of the {@link GeneAssociation} annotation to get. 956 <p> 957 * @return {@link GeneAssociation} annotation in the {@link ListOfGeneAssociations} with the given <code>sid</code> 958 * or <code>null</code> if no such {@link GeneAssociation} annotation exists. 959 <p> 960 * @see #getGeneAssociation(long n) 961 * @see #getListOfGeneAssociations() 962 */ public 963 GeneAssociation getGeneAssociation(String sid) { 964 long cPtr = libsbmlJNI.FbcModelPlugin_getGeneAssociation__SWIG_2(swigCPtr, this, sid); 965 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 966 } 967 968 969/** 970 * Adds a copy of the given {@link GeneAssociation} annotation object to the list of GeneAssociations. 971 <p> 972 * @param association the {@link GeneAssociation} annotation object to be added to the list of GeneAssociations. 973 <p> 974 * <p> 975 * @note {@link GeneAssociation} objects are not defined in any version of the 976 * 'Flux Balance Constraints' specification, and can only be used for 977 * annotation purposes. Version 2 instead defines the 978 * {@link GeneProduct} and {@link GeneProductAssociation} classes to cover the information 979 * otherwise encoded here. 980 <p> 981 * <p> 982 * @return integer value indicating success/failure of the 983 * function. The possible values 984 * returned by this function are: 985 * <ul> 986 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 987 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 988 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 989 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 990 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 991 * <li> {@link libsbmlConstants#LIBSBML_PKG_VERSION_MISMATCH LIBSBML_PKG_VERSION_MISMATCH} 992 * </ul> 993 */ public 994 int addGeneAssociation(GeneAssociation association) { 995 return libsbmlJNI.FbcModelPlugin_addGeneAssociation(swigCPtr, this, GeneAssociation.getCPtr(association), association); 996 } 997 998 999/** 1000 * Creates a new {@link GeneAssociation} annotation object and adds it to the list of {@link GeneAssociation} objects 1001 * and returns it. 1002 <p> 1003 * @return a newly created {@link GeneAssociation} annotation object. 1004 */ public 1005 GeneAssociation createGeneAssociation() { 1006 long cPtr = libsbmlJNI.FbcModelPlugin_createGeneAssociation(swigCPtr, this); 1007 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 1008 } 1009 1010 1011/** 1012 * Removes the nth {@link GeneAssociation} annotation object from this plugin object and 1013 * returns a pointer to it. 1014 <p> 1015 * The caller owns the returned object and is responsible for 1016 * deleting it. 1017 <p> 1018 * <p> 1019 * @note {@link GeneAssociation} objects are not defined in any version of the 1020 * 'Flux Balance Constraints' specification, and can only be used for 1021 * annotation purposes. Version 2 instead defines the 1022 * {@link GeneProduct} and {@link GeneProductAssociation} classes to cover the information 1023 * otherwise encoded here. 1024 <p> 1025 * @param n the index of the {@link GeneAssociation} annotation object to remove. 1026 <p> 1027 * @return the {@link GeneAssociation} annotation object removed. As mentioned above, the 1028 * caller owns the returned object. <code>null</code> is returned if the 1029 * given index is out of range. 1030 */ public 1031 GeneAssociation removeGeneAssociation(long n) { 1032 long cPtr = libsbmlJNI.FbcModelPlugin_removeGeneAssociation__SWIG_0(swigCPtr, this, n); 1033 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 1034 } 1035 1036 1037/** 1038 * Removes the {@link GeneAssociation} annotation object with the given <code>sid</code> attribute from 1039 * this plugin object and returns a pointer to it. 1040 <p> 1041 * The caller owns the returned object and is responsible for 1042 * deleting it. 1043 <p> 1044 * <p> 1045 * @note {@link GeneAssociation} objects are not defined in any version of the 1046 * 'Flux Balance Constraints' specification, and can only be used for 1047 * annotation purposes. Version 2 instead defines the 1048 * {@link GeneProduct} and {@link GeneProductAssociation} classes to cover the information 1049 * otherwise encoded here. 1050 <p> 1051 * @param sid the id attribute of the {@link GeneAssociation} annotation object to remove. 1052 <p> 1053 * @return the {@link GeneAssociation} annotation object removed. As mentioned above, the 1054 * caller owns the returned object. <code>null</code> is returned if the 1055 * given index is out of range. 1056 */ public 1057 GeneAssociation removeGeneAssociation(String sid) { 1058 long cPtr = libsbmlJNI.FbcModelPlugin_removeGeneAssociation__SWIG_1(swigCPtr, this, sid); 1059 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 1060 } 1061 1062 1063/** 1064 * Returns the number of {@link GeneAssociation} annotation object in this plugin object. 1065 <p> 1066 * <p> 1067 * @note {@link GeneAssociation} objects are not defined in any version of the 1068 * 'Flux Balance Constraints' specification, and can only be used for 1069 * annotation purposes. Version 2 instead defines the 1070 * {@link GeneProduct} and {@link GeneProductAssociation} classes to cover the information 1071 * otherwise encoded here. 1072 <p> 1073 * @return the number of {@link GeneAssociation} annotation object in this plugin object. 1074 */ public 1075 int getNumGeneAssociations() { 1076 return libsbmlJNI.FbcModelPlugin_getNumGeneAssociations(swigCPtr, this); 1077 } 1078 1079 1080/** * @internal */ public 1081 void connectToChild() { 1082 libsbmlJNI.FbcModelPlugin_connectToChild(swigCPtr, this); 1083 } 1084 1085 1086/** * @internal */ public 1087 void connectToParent(SBase sbase) { 1088 libsbmlJNI.FbcModelPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase); 1089 } 1090 1091 1092/** * @internal */ public 1093 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 1094 libsbmlJNI.FbcModelPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 1095 } 1096 1097}