001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.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 * Implementation of SBML's Reaction construct. 013 <p> 014 * A <em>reaction</em> represents any transformation, transport or binding 015 * process, typically a chemical reaction, that can change the quantity of 016 * one or more species. In SBML, a reaction is defined primarily in terms 017 * of the participating reactants and products (and their corresponding 018 * stoichiometries), along with optional modifier species, an optional rate 019 * at which the reaction takes place, and optional parameters. 020 <p> 021 * As with other major objects in SBML, {@link Reaction} has a mandatory attribute, 022 * 'id', used to give the compartment type an identifier. The identifier 023 * must be a text string conforming to the identifer syntax permitted in 024 * SBML. In SBML Level 2 and Level 3, the reaction 'id' 025 * identifier can be used in mathematical formulas elsewhere in an SBML 026 * model to represent the rate of that reaction; this usage is explained 027 * below. {@link Reaction} also has an optional 'name' attribute, of type 028 * <code>string.</code> The 'id' and 'name' must be used according to the guidelines 029 * described in the SBML specification. 030 <p> 031 * The species participating as reactants, products, and/or modifiers in a 032 * reaction are declared using lists of {@link SpeciesReference} and/or 033 * {@link ModifierSpeciesReference} instances stored in subelements 034 * 'listOfReactants', 'listOfProducts' and 'listOfModifiers'. Certain 035 * restrictions are placed on the appearance of species in reaction 036 * definitions: 037 * <ul> 038 * <li> The ability of a species to appear as a reactant or product of any 039 * reaction in a model is governed by certain flags in that species' 040 * definition; see the definition of {@link Species} for more information. 041 <p> 042 * <li> Any species appearing in the mathematical formula of the subelement 043 * 'kineticLaw' (described below) of a {@link Reaction} must be declared in at 044 * least one of that {@link Reaction}'s lists of reactants, products, and/or 045 * modifiers. Put another way, it is an error for a reaction's kinetic law 046 * formula to refer to species that have not been declared for that 047 * reaction. 048 <p> 049 * <li> A reaction definition can contain an empty list of reactants 050 * <em>or</em> an empty list of products, but it must have at least one 051 * reactant or product; in other words, a reaction without any reactant or 052 * product species is not permitted. (This restriction does not apply to 053 * modifier species, which remain optional in all cases.) 054 * </ul> 055 <p> 056 * A reaction can contain up to one {@link KineticLaw} object in a subelement named 057 * 'kineticLaw'. It defines the speed at which the process defined by the 058 * reaction takes place. The description of {@link KineticLaw} provides more 059 * details about its use. Note that although the inclusion of a {@link KineticLaw} 060 * object in an instance of a {@link Reaction} component is optional, there is no 061 * useful default that can be substituted in place of a missing rate 062 * expression in a reaction. Moreover, a reaction's rate cannot be defined 063 * in any other way in SBML—{@link InitialAssignment}, {@link AssignmentRule}, 064 * {@link RateRule}, {@link AlgebraicRule}, {@link Event}, and other constructs in SBML cannot be 065 * used to set the reaction rate separately. Nevertheless, for some 066 * modeling applications, reactions without any defined rate can be 067 * perfectly acceptable. 068 <p> 069 * {@link Reaction} also has a boolean attribute named 'reversible' for indicating 070 * whether the reaction is reversible. This attribute is optional in SBML 071 * Level 2, with a default of <code>true</code>; it is mandatory in SBML 072 * Level 3 (with no default value). To say that a reaction is 073 * <em>reversible</em> is to say it can proceed in either the forward or the reverse 074 * direction. Although the reversibility of a reaction can sometimes be 075 * deduced by inspecting its rate expression, this is not always the case, 076 * especially for complicated expressions. Moreover, the need in SBML to 077 * allow rate expressions (i.e., {@link KineticLaw}) to be optional leads to the 078 * need for a separate flag indicating reversibility. Note that labeling a 079 * reaction as irreversible is an assertion that the reaction always 080 * proceeds in the given forward direction. (Why else would it be flagged 081 * as irreversible?) This implies the rate expression in the {@link KineticLaw} 082 * always has a non-negative value during simulations. Software tools 083 * could provide a means of optionally testing that this condition holds. 084 * The presence of reversibility information in two places (i.e., the rate 085 * expression and the 'reversible' attribute on {@link Reaction}) leaves open the 086 * possibility that a model could contain contradictory information, but 087 * the creation of such a model would be an error on the part of the 088 * software generating it. 089 <p> 090 * The {@link Reaction} object class has another boolean attribute called 'fast'. 091 * This attribute is optional in SBML Level 2, with a default of 092 * <code>false</code>; it is mandatory in SBML Level 3 (with no default value). It 093 * is used to indicate that a reaction occurs on a vastly faster time scale 094 * thanothers in a system. Readers are directed to the SBML Level 2 095 * Version 4 specification, which provides more detail about the 096 * conditions under which a reaction can be considered to be fast in this 097 * sense. The attribute's default value is <code>false.</code> SBML Level 1 098 * and Level 2 Version 1 incorrectly claimed that software tools 099 * could ignore this attribute if they did not implement support for the 100 * corresponding concept; however, further research in SBML has revealed 101 * that this is not true, and 'fast' <em>cannot be ignored</em> if it is 102 * set to <code>true.</code> SBML Level 2 Versions 2–4 therefore 103 * stipulate that if a model has any reactions with 'fast' set to <code>true</code>, 104 * a software tool must be able to respect the attribute or else indicate 105 * to the user that it does not have the capacity to do so. Analysis 106 * software cannot ignore the value of the 'fast' attribute because doing 107 * so may lead to different results as compared to a software system that 108 * <em>does</em> make use of 'fast'. 109 <p> 110 * In SBML Level 3 Version 1, the {@link Reaction} object has an 111 * additional optional attribute named 'compartment', whose value must be 112 * the identifier of a compartment defined in the enclosing {@link Model} object. 113 * The 'compartment' attribute can be used to indicate the compartment in 114 * which the reaction is assumed to take place. If the attribute is 115 * present, its value must be the identifier of a {@link Compartment} object 116 * defined in the enclosing {@link Model} object. Similar to the 'reversible' 117 * attribute, the value of the 'compartment' attribute has no direct impact 118 * on the construction of mathematical equations for the SBML model. When 119 * a kinetic law is given for a reaction, the compartment location may 120 * already be implicit in the kinetic law (although this cannot always be 121 * guaranteed). Nevertheless, software tools may find the 'compartment' 122 * attribute value useful for such purposes as analyzing the structure of 123 * the model, guiding the modeler in constructing correct rate formulas, 124 * and visualization purposes. 125 <p> 126 * Readers are urged to read the SBML specification for more details about 127 * the proper use of {@link Reaction}. 128 */ 129 130public class Reaction extends SBase { 131 private long swigCPtr; 132 133 protected Reaction(long cPtr, boolean cMemoryOwn) 134 { 135 super(libsbmlJNI.Reaction_SWIGUpcast(cPtr), cMemoryOwn); 136 swigCPtr = cPtr; 137 } 138 139 protected static long getCPtr(Reaction obj) 140 { 141 return (obj == null) ? 0 : obj.swigCPtr; 142 } 143 144 protected static long getCPtrAndDisown (Reaction obj) 145 { 146 long ptr = 0; 147 148 if (obj != null) 149 { 150 ptr = obj.swigCPtr; 151 obj.swigCMemOwn = false; 152 } 153 154 return ptr; 155 } 156 157 protected void finalize() { 158 delete(); 159 } 160 161 public synchronized void delete() { 162 if (swigCPtr != 0) { 163 if (swigCMemOwn) { 164 swigCMemOwn = false; 165 libsbmlJNI.delete_Reaction(swigCPtr); 166 } 167 swigCPtr = 0; 168 } 169 super.delete(); 170 } 171 172 173/** 174 * Creates a new {@link Reaction} using the given SBML <code>level</code> and <code>version</code> 175 * values. 176 <p> 177 * @param level a long integer, the SBML Level to assign to this {@link Reaction} 178 <p> 179 * @param version a long integer, the SBML Version to assign to this 180 * {@link Reaction} 181 <p> 182 * @throws SBMLConstructorException 183 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 184 * of SBML object, are either invalid or mismatched with respect to the 185 * parent {@link SBMLDocument} object. 186 <p> 187 * <p> 188 * @note Upon the addition of a {@link Reaction} object to an {@link SBMLDocument} (e.g., 189 * using {@link Model#addReaction(Reaction r)}), the SBML Level, SBML Version and 190 * XML namespace of the document <em>override</em> the values used when 191 * creating the {@link Reaction} object via this constructor. This is necessary 192 * to ensure that an SBML document is a consistent structure. 193 * Nevertheless, the ability to supply the values at the time of creation 194 * of a {@link Reaction} is an important aid to producing valid SBML. Knowledge 195 * of the intented SBML Level and Version determine whether it is valid 196 * to assign a particular value to an attribute, or whether it is valid 197 * to add an object to an existing {@link SBMLDocument}. 198 */ public 199 Reaction(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 200 this(libsbmlJNI.new_Reaction__SWIG_0(level, version), true); 201 } 202 203 204/** 205 * Creates a new {@link Reaction} using the given {@link SBMLNamespaces} object 206 * <code>sbmlns</code>. 207 <p> 208 * <p> 209 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 210 * information. It is used to communicate the SBML Level, Version, and (in 211 * Level 3) packages used in addition to SBML Level 3 Core. A 212 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 213 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object 214 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 215 <p> 216 * @param sbmlns an {@link SBMLNamespaces} object. 217 <p> 218 * @throws SBMLConstructorException 219 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 220 * of SBML object, are either invalid or mismatched with respect to the 221 * parent {@link SBMLDocument} object. 222 <p> 223 * <p> 224 * @note Upon the addition of a {@link Reaction} object to an {@link SBMLDocument} (e.g., 225 * using {@link Model#addReaction(Reaction r)}), the SBML Level, SBML Version and 226 * XML namespace of the document <em>override</em> the values used when 227 * creating the {@link Reaction} object via this constructor. This is necessary 228 * to ensure that an SBML document is a consistent structure. 229 * Nevertheless, the ability to supply the values at the time of creation 230 * of a {@link Reaction} is an important aid to producing valid SBML. Knowledge 231 * of the intented SBML Level and Version determine whether it is valid 232 * to assign a particular value to an attribute, or whether it is valid 233 * to add an object to an existing {@link SBMLDocument}. 234 */ public 235 Reaction(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 236 this(libsbmlJNI.new_Reaction__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 237 } 238 239 240/** 241 * Copy constructor; creates a copy of this {@link Reaction}. 242 <p> 243 * @param orig the object to copy. 244 <p> 245 * @throws SBMLConstructorException 246 * Thrown if the argument <code>orig</code> is <code>null.</code> 247 */ public 248 Reaction(Reaction orig) throws org.sbml.libsbml.SBMLConstructorException { 249 this(libsbmlJNI.new_Reaction__SWIG_2(Reaction.getCPtr(orig), orig), true); 250 } 251 252 253/** 254 * Creates and returns a deep copy of this {@link Reaction}. 255 <p> 256 * @return a (deep) copy of this {@link Reaction}. 257 */ public 258 Reaction cloneObject() { 259 long cPtr = libsbmlJNI.Reaction_cloneObject(swigCPtr, this); 260 return (cPtr == 0) ? null : new Reaction(cPtr, true); 261 } 262 263 264/** 265 * Returns the first child element found that has the given <code>id</code> in the 266 * model-wide SId namespace, or <code>null</code> if no such object is found. 267 <p> 268 * @param id string representing the id of objects to find. 269 <p> 270 * @return pointer to the first element found with the given <code>id</code>. 271 */ public 272 SBase getElementBySId(String id) { 273 return libsbml.DowncastSBase(libsbmlJNI.Reaction_getElementBySId(swigCPtr, this, id), false); 274} 275 276 277/** 278 * Returns the first child element it can find with the given <code>metaid</code>, or 279 * <code>null</code> if no such object is found. 280 <p> 281 * @param metaid string representing the metaid of objects to find 282 <p> 283 * @return pointer to the first element found with the given <code>metaid</code>. 284 */ public 285 SBase getElementByMetaId(String metaid) { 286 return libsbml.DowncastSBase(libsbmlJNI.Reaction_getElementByMetaId(swigCPtr, this, metaid), false); 287} 288 289 290/** 291 * Renames all the <code>SIdRef</code> attributes on this element, including any 292 * found in MathML. 293 <p> 294 * <p> 295 * In SBML, object identifiers are of a data type called <code>SId</code>. 296 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 297 * introduced for attribute values that refer to <code>SId</code> values; in 298 * previous Levels of SBML, this data type did not exist and attributes were 299 * simply described to as 'referring to an identifier', but the effective 300 * data type was the same as <code>SIdRef</code>in Level 3. These and 301 * other methods of libSBML refer to the type <code>SIdRef</code> for all 302 * Levels of SBML, even if the corresponding SBML specification did not 303 * explicitly name the data type. 304 <p> 305 * This method works by looking at all attributes and (if appropriate) 306 * mathematical formulas, comparing the identifiers to the value of 307 * <code>oldid</code>. If any matches are found, the matching identifiers are replaced 308 * with <code>newid</code>. The method does <em>not</em> descend into child elements. 309 <p> 310 * @param oldid the old identifier 311 * @param newid the new identifier 312 */ public 313 void renameSIdRefs(String oldid, String newid) { 314 libsbmlJNI.Reaction_renameSIdRefs(swigCPtr, this, oldid, newid); 315 } 316 317 318/** 319 * Initializes the fields of this {@link Reaction} object to 'typical' default 320 * values. 321 <p> 322 * The SBML {@link Reaction} component has slightly different aspects and 323 * default attribute values in different SBML Levels and Versions. 324 * This method sets the values to certain common defaults, based 325 * mostly on what they are in SBML Level 2. Specifically: 326 <p> 327 * <ul> 328 * <li> Sets the 'reversible' attribute to <code>true</code> 329 * <li> Sets the 'fast' attribute to <code>false</code> 330 * <li> Marks the 'fast' attribute as <em>not</em> having been set 331 * 332 * </ul> <p> 333 * <p> 334 * @warning <span class='warning'>SBML definitions before SBML Level 2 335 * Version 2 incorrectly indicated that software tools could ignore the 336 * 'fast' attribute if they did not implement support for the corresponding 337 * concept; however, further research in SBML has revealed that this is not 338 * true, and 'fast' <em>cannot be ignored</em> if it is set to <code>true.</code> 339 * Beginning with SBML Level 2 Versions 2, the SBML specifications 340 * therefore stipulate that if a model has any reactions with 'fast' set to 341 * <code>true</code>, a software tool must be able to respect the attribute or else 342 * indicate to the user that it does not have the capacity to do so. Readers 343 * are directed to the SBML specifications, which provides more detail about 344 * the conditions under which a reaction can be considered to be fast in this 345 * sense.</span> 346 */ public 347 void initDefaults() { 348 libsbmlJNI.Reaction_initDefaults(swigCPtr, this); 349 } 350 351 352/** 353 * Returns the value of the 'id' attribute of this {@link Reaction}. 354 <p> 355 * @return the id of this {@link Reaction}. 356 */ public 357 String getId() { 358 return libsbmlJNI.Reaction_getId(swigCPtr, this); 359 } 360 361 362/** 363 * Returns the value of the 'name' attribute of this {@link Reaction}. 364 <p> 365 * @return the name of this {@link Reaction}. 366 */ public 367 String getName() { 368 return libsbmlJNI.Reaction_getName(swigCPtr, this); 369 } 370 371 372/** 373 * Returns the {@link KineticLaw} object contained in this {@link Reaction}. 374 <p> 375 * @return the {@link KineticLaw} instance. 376 */ public 377 KineticLaw getKineticLaw() { 378 long cPtr = libsbmlJNI.Reaction_getKineticLaw__SWIG_0(swigCPtr, this); 379 return (cPtr == 0) ? null : new KineticLaw(cPtr, false); 380 } 381 382 383/** 384 * Returns the value of the 'reversible' attribute on the {@link Reaction} as a 385 * boolean value. 386 <p> 387 * @return the reversibility status of this {@link Reaction}. 388 */ public 389 boolean getReversible() { 390 return libsbmlJNI.Reaction_getReversible(swigCPtr, this); 391 } 392 393 394/** 395 * Returns the value of the 'fast' attribute of this {@link Reaction}. 396 <p> 397 * @return the 'fast' status of this {@link Reaction}. 398 <p> 399 * <p> 400 * @warning <span class='warning'>SBML definitions before SBML Level 2 401 * Version 2 incorrectly indicated that software tools could ignore the 402 * 'fast' attribute if they did not implement support for the corresponding 403 * concept; however, further research in SBML has revealed that this is not 404 * true, and 'fast' <em>cannot be ignored</em> if it is set to <code>true.</code> 405 * Beginning with SBML Level 2 Versions 2, the SBML specifications 406 * therefore stipulate that if a model has any reactions with 'fast' set to 407 * <code>true</code>, a software tool must be able to respect the attribute or else 408 * indicate to the user that it does not have the capacity to do so. Readers 409 * are directed to the SBML specifications, which provides more detail about 410 * the conditions under which a reaction can be considered to be fast in this 411 * sense.</span> 412 */ public 413 boolean getFast() { 414 return libsbmlJNI.Reaction_getFast(swigCPtr, this); 415 } 416 417 418/** 419 * (SBML Level 3 only) Returns the value of the 'compartment' 420 * attribute on the {@link Reaction}. 421 <p> 422 * @return the compartment of this {@link Reaction}. 423 <p> 424 * @note The 'compartment' attribute is available in SBML Level 3 425 * Version 1 Core, but is not present on {@link Reaction} in lower Levels of 426 * SBML. 427 */ public 428 String getCompartment() { 429 return libsbmlJNI.Reaction_getCompartment(swigCPtr, this); 430 } 431 432 433/** 434 * Predicate returning <code>true</code> if this 435 * {@link Reaction}'s 'id' attribute is set. 436 <p> 437 * @return <code>true</code> if the 'id' attribute of this {@link Reaction} is 438 * set, <code>false</code> otherwise. 439 */ public 440 boolean isSetId() { 441 return libsbmlJNI.Reaction_isSetId(swigCPtr, this); 442 } 443 444 445/** 446 * Predicate returning <code>true</code> if this 447 * {@link Reaction}'s 'name' attribute is set. 448 <p> 449 * @return <code>true</code> if the 'name' attribute of this {@link Reaction} is 450 * set, <code>false</code> otherwise. 451 */ public 452 boolean isSetName() { 453 return libsbmlJNI.Reaction_isSetName(swigCPtr, this); 454 } 455 456 457/** 458 * Predicate returning <code>true</code> if this 459 * {@link Reaction} contains a kinetic law object. 460 <p> 461 * @return <code>true</code> if a {@link KineticLaw} is present in this {@link Reaction},, <code>false</code> 462 * otherwise. 463 */ public 464 boolean isSetKineticLaw() { 465 return libsbmlJNI.Reaction_isSetKineticLaw(swigCPtr, this); 466 } 467 468 469/** 470 * Predicate returning <code>true</code> if the value of 471 * the 'fast' attribute on this {@link Reaction}. 472 <p> 473 * @return <code>true</code> if the 'fast' attribute is true, <code>false</code> otherwise. 474 <p> 475 * <p> 476 * @warning <span class='warning'>SBML definitions before SBML Level 2 477 * Version 2 incorrectly indicated that software tools could ignore the 478 * 'fast' attribute if they did not implement support for the corresponding 479 * concept; however, further research in SBML has revealed that this is not 480 * true, and 'fast' <em>cannot be ignored</em> if it is set to <code>true.</code> 481 * Beginning with SBML Level 2 Versions 2, the SBML specifications 482 * therefore stipulate that if a model has any reactions with 'fast' set to 483 * <code>true</code>, a software tool must be able to respect the attribute or else 484 * indicate to the user that it does not have the capacity to do so. Readers 485 * are directed to the SBML specifications, which provides more detail about 486 * the conditions under which a reaction can be considered to be fast in this 487 * sense.</span> 488 */ public 489 boolean isSetFast() { 490 return libsbmlJNI.Reaction_isSetFast(swigCPtr, this); 491 } 492 493 494/** 495 * Predicate returning <code>true</code> if this 496 * {@link Reaction}'s 'compartment' attribute is set. 497 <p> 498 * @return <code>true</code> if the 'compartment' attribute of this {@link Reaction} is 499 * set, <code>false</code> otherwise. 500 <p> 501 * @note The 'compartment' attribute is available in SBML 502 * Level 3 Version 1 Core, but is not present on {@link Reaction} in 503 * lower Levels of SBML. 504 */ public 505 boolean isSetCompartment() { 506 return libsbmlJNI.Reaction_isSetCompartment(swigCPtr, this); 507 } 508 509 510/** 511 * Predicate returning <code>true</code> if this 512 * {@link Reaction}'s 'reversible' attribute is set. 513 <p> 514 * @return <code>true</code> if the 'reversible' attribute of this {@link Reaction} is 515 * set, <code>false</code> otherwise. 516 */ public 517 boolean isSetReversible() { 518 return libsbmlJNI.Reaction_isSetReversible(swigCPtr, this); 519 } 520 521 522/** 523 * Sets the value of the 'id' attribute of this {@link Reaction}. 524 <p> 525 * The string <code>sid</code> is copied. 526 <p> 527 * <p> 528 * SBML has strict requirements for the syntax of identifiers, that is, the 529 * values of the 'id' attribute present on most types of SBML objects. 530 * The following is a summary of the definition of the SBML identifier type 531 * <code>SId</code>, which defines the permitted syntax of identifiers. We 532 * express the syntax using an extended form of BNF notation: 533 * <pre style='margin-left: 2em; border: none; font-weight: bold; font-size: 13px; color: black'> 534 * letter .= 'a'..'z','A'..'Z' 535 * digit .= '0'..'9' 536 * idChar .= letter | digit | '_' 537 * SId .= ( letter | '_' ) idChar* 538 * </pre> 539 * The characters <code>(</code> and <code>)</code> are used for grouping, the 540 * character <code>*</code> 'zero or more times', and the character 541 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 542 * determined by an exact character sequence match; i.e., comparisons must be 543 * performed in a case-sensitive manner. In addition, there are a few 544 * conditions for the uniqueness of identifiers in an SBML model. Please 545 * consult the SBML specifications for the exact details of the uniqueness 546 * requirements. 547 <p> 548 * @param sid the string to use as the identifier of this {@link Reaction} 549 <p> 550 * @return integer value indicating success/failure of the 551 * function. The possible values 552 * returned by this function are: 553 * <ul> 554 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 555 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 556 * </ul> 557 */ public 558 int setId(String sid) { 559 return libsbmlJNI.Reaction_setId(swigCPtr, this, sid); 560 } 561 562 563/** 564 * Sets the value of the 'name' attribute of this {@link Reaction}. 565 <p> 566 * The string in <code>name</code> is copied. 567 <p> 568 * @param name the new name for the {@link Reaction} 569 <p> 570 * @return integer value indicating success/failure of the 571 * function. The possible values 572 * returned by this function are: 573 * <ul> 574 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 575 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 576 * </ul> 577 */ public 578 int setName(String name) { 579 return libsbmlJNI.Reaction_setName(swigCPtr, this, name); 580 } 581 582 583/** 584 * Sets the 'kineticLaw' subelement of this {@link Reaction} to a copy of the 585 * given {@link KineticLaw} object. 586 <p> 587 * @param kl the {@link KineticLaw} object to use. 588 <p> 589 * @return integer value indicating success/failure of the 590 * function. The possible values 591 * returned by this function are: 592 * <ul> 593 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 594 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH } 595 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH } 596 * </ul> 597 */ public 598 int setKineticLaw(KineticLaw kl) { 599 return libsbmlJNI.Reaction_setKineticLaw(swigCPtr, this, KineticLaw.getCPtr(kl), kl); 600 } 601 602 603/** 604 * Sets the value of the 'reversible' attribute of this {@link Reaction}. 605 <p> 606 * @param value the value of the 'reversible' attribute. 607 <p> 608 * @return integer value indicating success/failure of the 609 * function. The possible values 610 * returned by this function are: 611 * <ul> 612 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 613 * </ul> 614 */ public 615 int setReversible(boolean value) { 616 return libsbmlJNI.Reaction_setReversible(swigCPtr, this, value); 617 } 618 619 620/** 621 * Sets the value of the 'fast' attribute of this {@link Reaction}. 622 <p> 623 * @param value the value of the 'fast' attribute. 624 <p> 625 * @return integer value indicating success/failure of the 626 * function. The possible values 627 * returned by this function are: 628 * <ul> 629 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 630 * 631 * </ul> <p> 632 * <p> 633 * @warning <span class='warning'>SBML definitions before SBML Level 2 634 * Version 2 incorrectly indicated that software tools could ignore the 635 * 'fast' attribute if they did not implement support for the corresponding 636 * concept; however, further research in SBML has revealed that this is not 637 * true, and 'fast' <em>cannot be ignored</em> if it is set to <code>true.</code> 638 * Beginning with SBML Level 2 Versions 2, the SBML specifications 639 * therefore stipulate that if a model has any reactions with 'fast' set to 640 * <code>true</code>, a software tool must be able to respect the attribute or else 641 * indicate to the user that it does not have the capacity to do so. Readers 642 * are directed to the SBML specifications, which provides more detail about 643 * the conditions under which a reaction can be considered to be fast in this 644 * sense.</span> 645 */ public 646 int setFast(boolean value) { 647 return libsbmlJNI.Reaction_setFast(swigCPtr, this, value); 648 } 649 650 651/** 652 * Sets the value of the 'compartment' attribute of this {@link Reaction}. 653 <p> 654 * The string <code>sid</code> is copied. 655 <p> 656 * @param sid the string to use as the compartment of this {@link Reaction} 657 <p> 658 * @return integer value indicating success/failure of the 659 * function. The possible values 660 * returned by this function are: 661 * <ul> 662 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 663 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 664 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 665 * 666 * </ul> <p> 667 * @note The 'compartment' attribute is available in SBML 668 * Level 3 Version 1 Core, but is not present on {@link Reaction} in 669 * lower Levels of SBML. 670 */ public 671 int setCompartment(String sid) { 672 return libsbmlJNI.Reaction_setCompartment(swigCPtr, this, sid); 673 } 674 675 676/** 677 * Unsets the value of the 'name' attribute of this {@link Reaction}. 678 <p> 679 * @return integer value indicating success/failure of the 680 * function. The possible values 681 * returned by this function are: 682 * <ul> 683 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 684 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 685 * </ul> 686 */ public 687 int unsetName() { 688 return libsbmlJNI.Reaction_unsetName(swigCPtr, this); 689 } 690 691 692/** 693 * Unsets the 'kineticLaw' subelement of this {@link Reaction}. 694 <p> 695 * @return integer value indicating success/failure of the 696 * function. The possible values 697 * returned by this function are: 698 * <ul> 699 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 700 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 701 * </ul> 702 */ public 703 int unsetKineticLaw() { 704 return libsbmlJNI.Reaction_unsetKineticLaw(swigCPtr, this); 705 } 706 707 708/** 709 * Unsets the value of the 'fast' attribute of this {@link Reaction}. 710 <p> 711 * @return integer value indicating success/failure of the 712 * function. The possible values 713 * returned by this function are: 714 * <ul> 715 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 716 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 717 * 718 * </ul> <p> 719 * <p> 720 * @warning <span class='warning'>SBML definitions before SBML Level 2 721 * Version 2 incorrectly indicated that software tools could ignore the 722 * 'fast' attribute if they did not implement support for the corresponding 723 * concept; however, further research in SBML has revealed that this is not 724 * true, and 'fast' <em>cannot be ignored</em> if it is set to <code>true.</code> 725 * Beginning with SBML Level 2 Versions 2, the SBML specifications 726 * therefore stipulate that if a model has any reactions with 'fast' set to 727 * <code>true</code>, a software tool must be able to respect the attribute or else 728 * indicate to the user that it does not have the capacity to do so. Readers 729 * are directed to the SBML specifications, which provides more detail about 730 * the conditions under which a reaction can be considered to be fast in this 731 * sense.</span> 732 */ public 733 int unsetFast() { 734 return libsbmlJNI.Reaction_unsetFast(swigCPtr, this); 735 } 736 737 738/** 739 * Unsets the value of the 'compartment' attribute of this {@link Reaction}. 740 <p> 741 * @return integer value indicating success/failure of the 742 * function. The possible values 743 * returned by this function are: 744 * <ul> 745 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 746 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 747 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 748 * 749 * </ul> <p> 750 * @note The 'compartment' attribute is available in SBML 751 * Level 3 Version 1 Core, but is not present on {@link Reaction} in 752 * lower Levels of SBML. 753 */ public 754 int unsetCompartment() { 755 return libsbmlJNI.Reaction_unsetCompartment(swigCPtr, this); 756 } 757 758 759/** 760 * Adds a given {@link SpeciesReference} object as a reactant in this {@link Reaction}. 761 <p> 762 * The {@link SpeciesReference} instance in <code>sr</code> is copied. 763 <p> 764 * @param sr a {@link SpeciesReference} object referring to a {@link Species} in the 765 * enclosing {@link Model} 766 <p> 767 * @return integer value indicating success/failure of the 768 * function. The possible values 769 * returned by this function are: 770 * <ul> 771 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 772 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH } 773 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH } 774 * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID } 775 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 776 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 777 * 778 * </ul> <p> 779 * <p> 780 * @note This method should be used with some caution. The fact that this 781 * method <em>copies</em> the object passed to it means that the caller will be 782 * left holding a physically different object instance than the one contained 783 * inside this object. Changes made to the original object instance (such as 784 * resetting attribute values) will <em>not affect the instance in this 785 * object</em>. In addition, the caller should make sure to free the 786 * original object if it is no longer being used, or else a memory leak will 787 * result. Please see other methods on this class (particularly a 788 * corresponding method whose name begins with the word <code>create</code>) 789 * for alternatives that do not lead to these issues. 790 <p> 791 * @see #createReactant() 792 */ public 793 int addReactant(SpeciesReference sr) { 794 return libsbmlJNI.Reaction_addReactant(swigCPtr, this, SpeciesReference.getCPtr(sr), sr); 795 } 796 797 798/** 799 * Adds a given {@link SpeciesReference} object as a product in this {@link Reaction}. 800 <p> 801 * The {@link SpeciesReference} instance in <code>sr</code> is copied. 802 <p> 803 * @param sr a {@link SpeciesReference} object referring to a {@link Species} in the 804 * enclosing {@link Model} 805 <p> 806 * @return integer value indicating success/failure of the 807 * function. The possible values 808 * returned by this function are: 809 * <ul> 810 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 811 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH } 812 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH } 813 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 814 * 815 * </ul> <p> 816 * <p> 817 * @note This method should be used with some caution. The fact that this 818 * method <em>copies</em> the object passed to it means that the caller will be 819 * left holding a physically different object instance than the one contained 820 * inside this object. Changes made to the original object instance (such as 821 * resetting attribute values) will <em>not affect the instance in this 822 * object</em>. In addition, the caller should make sure to free the 823 * original object if it is no longer being used, or else a memory leak will 824 * result. Please see other methods on this class (particularly a 825 * corresponding method whose name begins with the word <code>create</code>) 826 * for alternatives that do not lead to these issues. 827 <p> 828 * @see #createProduct() 829 */ public 830 int addProduct(SpeciesReference sr) { 831 return libsbmlJNI.Reaction_addProduct(swigCPtr, this, SpeciesReference.getCPtr(sr), sr); 832 } 833 834 835/** 836 * Adds a given {@link ModifierSpeciesReference} object as a product in this 837 * {@link Reaction}. 838 <p> 839 * The {@link ModifierSpeciesReference} instance in <code>msr</code> is copied. 840 <p> 841 * @param msr a {@link ModifierSpeciesReference} object referring to a {@link Species} in 842 * the enclosing {@link Model} 843 <p> 844 * @return integer value indicating success/failure of the 845 * function. The possible values 846 * returned by this function are: 847 * <ul> 848 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 849 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 850 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH } 851 * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID } 852 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH } 853 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 854 * 855 * </ul> <p> 856 * <p> 857 * @note This method should be used with some caution. The fact that this 858 * method <em>copies</em> the object passed to it means that the caller will be 859 * left holding a physically different object instance than the one contained 860 * inside this object. Changes made to the original object instance (such as 861 * resetting attribute values) will <em>not affect the instance in this 862 * object</em>. In addition, the caller should make sure to free the 863 * original object if it is no longer being used, or else a memory leak will 864 * result. Please see other methods on this class (particularly a 865 * corresponding method whose name begins with the word <code>create</code>) 866 * for alternatives that do not lead to these issues. 867 <p> 868 * @see #createModifier() 869 */ public 870 int addModifier(ModifierSpeciesReference msr) { 871 return libsbmlJNI.Reaction_addModifier(swigCPtr, this, ModifierSpeciesReference.getCPtr(msr), msr); 872 } 873 874 875/** 876 * Creates a new {@link SpeciesReference}, adds it to this {@link Reaction}'s list of 877 * reactants, and returns it. 878 <p> 879 * @return a new {@link SpeciesReference} object. 880 */ public 881 SpeciesReference createReactant() { 882 long cPtr = libsbmlJNI.Reaction_createReactant(swigCPtr, this); 883 return (cPtr == 0) ? null : new SpeciesReference(cPtr, false); 884 } 885 886 887/** 888 * Creates a new {@link SpeciesReference}, adds it to this {@link Reaction}'s list of 889 * products, and returns it. 890 <p> 891 * @return a new {@link SpeciesReference} object. 892 */ public 893 SpeciesReference createProduct() { 894 long cPtr = libsbmlJNI.Reaction_createProduct(swigCPtr, this); 895 return (cPtr == 0) ? null : new SpeciesReference(cPtr, false); 896 } 897 898 899/** 900 * Creates a new {@link ModifierSpeciesReference}, adds it to this {@link Reaction}'s 901 * list of modifiers and returns it. 902 <p> 903 * @return a new {@link ModifierSpeciesReference} object. 904 */ public 905 ModifierSpeciesReference createModifier() { 906 long cPtr = libsbmlJNI.Reaction_createModifier(swigCPtr, this); 907 return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, false); 908 } 909 910 911/** 912 * Creates a new {@link KineticLaw} object, installs it as this {@link Reaction}'s 913 * 'kineticLaw' subelement, and returns it. 914 <p> 915 * If this {@link Reaction} had a previous {@link KineticLaw}, it will be destroyed. 916 <p> 917 * @return the new {@link KineticLaw} object 918 */ public 919 KineticLaw createKineticLaw() { 920 long cPtr = libsbmlJNI.Reaction_createKineticLaw(swigCPtr, this); 921 return (cPtr == 0) ? null : new KineticLaw(cPtr, false); 922 } 923 924 925/** 926 * Returns the list of reactants in this {@link Reaction} object. 927 <p> 928 * @return the {@link ListOfSpeciesReferences} containing the references to the 929 * species acting as reactants in this reaction 930 */ public 931 ListOfSpeciesReferences getListOfReactants() { 932 long cPtr = libsbmlJNI.Reaction_getListOfReactants__SWIG_0(swigCPtr, this); 933 return (cPtr == 0) ? null : new ListOfSpeciesReferences(cPtr, false); 934 } 935 936 937/** 938 * Returns the list of products in this {@link Reaction} object. 939 <p> 940 * @return the {@link ListOfSpeciesReferences} containing the references to the 941 * species acting as products in this reaction 942 */ public 943 ListOfSpeciesReferences getListOfProducts() { 944 long cPtr = libsbmlJNI.Reaction_getListOfProducts__SWIG_0(swigCPtr, this); 945 return (cPtr == 0) ? null : new ListOfSpeciesReferences(cPtr, false); 946 } 947 948 949/** 950 * Returns the list of modifiers in this {@link Reaction} object. 951 <p> 952 * @return the {@link ListOfSpeciesReferences} containing the references to the 953 * species acting as modifiers in this reaction 954 */ public 955 ListOfSpeciesReferences getListOfModifiers() { 956 long cPtr = libsbmlJNI.Reaction_getListOfModifiers__SWIG_0(swigCPtr, this); 957 return (cPtr == 0) ? null : new ListOfSpeciesReferences(cPtr, false); 958 } 959 960 961/** 962 * Returns the nth reactant species (as a {@link SpeciesReference} object) in 963 * the list of reactants in this {@link Reaction}. 964 <p> 965 * Callers should first call getNumReactants() to find out how many 966 * reactants there are, to avoid using an invalid index number. 967 <p> 968 * @param n the index of the reactant sought. 969 <p> 970 * @return the nth reactant (as a {@link SpeciesReference} object) of this 971 * {@link Reaction}. 972 */ public 973 SpeciesReference getReactant(long n) { 974 long cPtr = libsbmlJNI.Reaction_getReactant__SWIG_0(swigCPtr, this, n); 975 return (cPtr == 0) ? null : new SpeciesReference(cPtr, false); 976 } 977 978 979/** 980 * Returns the reactant species (as a {@link SpeciesReference} object) having 981 * a specific identifier in this {@link Reaction}. 982 <p> 983 * @param species the identifier of the reactant {@link Species} ('species' 984 * attribute of the reactant {@link SpeciesReference} object) 985 <p> 986 * @return a {@link SpeciesReference} object, or <code>null</code> if no species with the 987 * given identifier <code>species</code> appears as a reactant in this {@link Reaction}. 988 */ public 989 SpeciesReference getReactant(String species) { 990 long cPtr = libsbmlJNI.Reaction_getReactant__SWIG_2(swigCPtr, this, species); 991 return (cPtr == 0) ? null : new SpeciesReference(cPtr, false); 992 } 993 994 995/** 996 * Returns the nth product species (as a {@link SpeciesReference} object) in 997 * the list of products in this {@link Reaction}. 998 <p> 999 * Callers should first call getNumProducts() to find out how many 1000 * products there are, to avoid using an invalid index number. 1001 <p> 1002 * @param n the index of the product sought. 1003 <p> 1004 * @return the nth product (as a {@link SpeciesReference} object) of this 1005 * {@link Reaction}. 1006 */ public 1007 SpeciesReference getProduct(long n) { 1008 long cPtr = libsbmlJNI.Reaction_getProduct__SWIG_0(swigCPtr, this, n); 1009 return (cPtr == 0) ? null : new SpeciesReference(cPtr, false); 1010 } 1011 1012 1013/** 1014 * Returns the product species (as a {@link SpeciesReference} object) having 1015 * a specific identifier in this {@link Reaction}. 1016 <p> 1017 * @param species the identifier of the product {@link Species} ('species' 1018 * attribute of the product {@link SpeciesReference} object) 1019 <p> 1020 * @return a {@link SpeciesReference} object, or <code>null</code> if no species with the 1021 * given identifier <code>species</code> appears as a product in this {@link Reaction}. 1022 */ public 1023 SpeciesReference getProduct(String species) { 1024 long cPtr = libsbmlJNI.Reaction_getProduct__SWIG_2(swigCPtr, this, species); 1025 return (cPtr == 0) ? null : new SpeciesReference(cPtr, false); 1026 } 1027 1028 1029/** 1030 * Returns the nth modifier species (as a {@link ModifierSpeciesReference} object) 1031 * in the list of modifiers of this {@link Reaction}. 1032 <p> 1033 * Callers should first call getNumModifiers() to find out how many 1034 * modifiers there are, to avoid using an invalid index number. 1035 <p> 1036 * @param n the index of the modifier species sought 1037 <p> 1038 * @return the nth modifier (as a {@link ModifierSpeciesReference} object) of 1039 * this {@link Reaction}. 1040 */ public 1041 ModifierSpeciesReference getModifier(long n) { 1042 long cPtr = libsbmlJNI.Reaction_getModifier__SWIG_0(swigCPtr, this, n); 1043 return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, false); 1044 } 1045 1046 1047/** 1048 * Returns the modifier species (as a {@link ModifierSpeciesReference} object) 1049 * having a specific identifier in this {@link Reaction}. 1050 <p> 1051 * @param species the identifier of the modifier {@link Species} ('species' 1052 * attribute of the {@link ModifierSpeciesReference} object) 1053 <p> 1054 * @return a {@link ModifierSpeciesReference} object, or <code>null</code> if no species with 1055 * the given identifier <code>species</code> appears as a modifier in this 1056 * {@link Reaction}. 1057 */ public 1058 ModifierSpeciesReference getModifier(String species) { 1059 long cPtr = libsbmlJNI.Reaction_getModifier__SWIG_2(swigCPtr, this, species); 1060 return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, false); 1061 } 1062 1063 1064/** 1065 * Returns the number of reactant species in this {@link Reaction}. 1066 <p> 1067 * @return the number of reactants in this {@link Reaction}. 1068 */ public 1069 long getNumReactants() { 1070 return libsbmlJNI.Reaction_getNumReactants(swigCPtr, this); 1071 } 1072 1073 1074/** 1075 * Returns the number of product species in this {@link Reaction}. 1076 <p> 1077 * @return the number of products in this {@link Reaction}. 1078 */ public 1079 long getNumProducts() { 1080 return libsbmlJNI.Reaction_getNumProducts(swigCPtr, this); 1081 } 1082 1083 1084/** 1085 * Returns the number of modifier species in this {@link Reaction}. 1086 <p> 1087 * @return the number of modifiers in this {@link Reaction}. 1088 */ public 1089 long getNumModifiers() { 1090 return libsbmlJNI.Reaction_getNumModifiers(swigCPtr, this); 1091 } 1092 1093 1094/** 1095 * Removes the nth reactant species (SpeciesReference object) in the list of 1096 * reactants in this {@link Reaction} and returns a pointer to it. 1097 <p> 1098 * The caller owns the returned object and is responsible for deleting it. 1099 * The caller should first call getNumReactants() to find out how many 1100 * reactants there are, to avoid using an invalid index number. 1101 <p> 1102 * @param n the index of the reactant {@link SpeciesReference} object to remove 1103 <p> 1104 * @return the removed reactant {@link SpeciesReference} object, or <code>null</code> if the 1105 * given index is out of range. 1106 */ public 1107 SpeciesReference removeReactant(long n) { 1108 long cPtr = libsbmlJNI.Reaction_removeReactant__SWIG_0(swigCPtr, this, n); 1109 return (cPtr == 0) ? null : new SpeciesReference(cPtr, true); 1110 } 1111 1112 1113/** 1114 * Removes the reactant species (SpeciesReference object) having the given 1115 * 'species' attribute in this {@link Reaction} and returns a pointer to it. 1116 <p> 1117 * The caller owns the returned object and is responsible for deleting it. 1118 <p> 1119 * @param species the 'species' attribute of the reactant {@link SpeciesReference} 1120 * object 1121 <p> 1122 * @return the removed reactant {@link SpeciesReference} object, or <code>null</code> if no 1123 * reactant {@link SpeciesReference} object with the given 'species' attribute 1124 * <code>species</code> exists in this {@link Reaction}. 1125 */ public 1126 SpeciesReference removeReactant(String species) { 1127 long cPtr = libsbmlJNI.Reaction_removeReactant__SWIG_1(swigCPtr, this, species); 1128 return (cPtr == 0) ? null : new SpeciesReference(cPtr, true); 1129 } 1130 1131 1132/** 1133 * Removes the nth product species (SpeciesReference object) in the list of 1134 * products in this {@link Reaction} and returns a pointer to it. 1135 <p> 1136 * The caller owns the returned object and is responsible for deleting it. 1137 * The caller should first call getNumProducts() to find out how many 1138 * products there are, to avoid using an invalid index number. 1139 <p> 1140 * @param n the index of the product {@link SpeciesReference} object to remove 1141 <p> 1142 * @return the removed product {@link SpeciesReference} object, or <code>null</code> if the 1143 * given index is out of range. 1144 */ public 1145 SpeciesReference removeProduct(long n) { 1146 long cPtr = libsbmlJNI.Reaction_removeProduct__SWIG_0(swigCPtr, this, n); 1147 return (cPtr == 0) ? null : new SpeciesReference(cPtr, true); 1148 } 1149 1150 1151/** 1152 * Removes the product species (SpeciesReference object) having the given 1153 * 'species' attribute in this {@link Reaction} and returns a pointer to it. 1154 <p> 1155 * The caller owns the returned object and is responsible for deleting it. 1156 <p> 1157 * @param species the 'species' attribute of the product {@link SpeciesReference} 1158 * object 1159 <p> 1160 * @return the removed product {@link SpeciesReference} object, or <code>null</code> if no 1161 * product {@link SpeciesReference} object with the given 'species' attribute 1162 * <code>species</code> exists in this {@link Reaction}. 1163 */ public 1164 SpeciesReference removeProduct(String species) { 1165 long cPtr = libsbmlJNI.Reaction_removeProduct__SWIG_1(swigCPtr, this, species); 1166 return (cPtr == 0) ? null : new SpeciesReference(cPtr, true); 1167 } 1168 1169 1170/** 1171 * Removes the nth modifier species (ModifierSpeciesReference object) in 1172 * the list of modifiers in this {@link Reaction} and returns a pointer to it. 1173 <p> 1174 * The caller owns the returned object and is responsible for deleting it. 1175 * The caller should first call getNumModifiers() to find out how many 1176 * modifiers there are, to avoid using an invalid index number. 1177 <p> 1178 * @param n the index of the {@link ModifierSpeciesReference} object to remove 1179 <p> 1180 * @return the removed {@link ModifierSpeciesReference} object, or <code>null</code> if the 1181 * given index is out of range. 1182 */ public 1183 ModifierSpeciesReference removeModifier(long n) { 1184 long cPtr = libsbmlJNI.Reaction_removeModifier__SWIG_0(swigCPtr, this, n); 1185 return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, true); 1186 } 1187 1188 1189/** 1190 * Removes the modifier species (ModifierSpeciesReference object) having 1191 * the given 'species' attribute in this {@link Reaction} and returns a pointer to it. 1192 <p> 1193 * The caller owns the returned object and is responsible for deleting it. 1194 <p> 1195 * @param species the 'species' attribute of the {@link ModifierSpeciesReference} 1196 * object 1197 <p> 1198 * @return the removed {@link ModifierSpeciesReference} object, or <code>null</code> if no 1199 * {@link ModifierSpeciesReference} object with the given 'species' attribute @p 1200 * species exists in this {@link Reaction}. 1201 */ public 1202 ModifierSpeciesReference removeModifier(String species) { 1203 long cPtr = libsbmlJNI.Reaction_removeModifier__SWIG_1(swigCPtr, this, species); 1204 return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, true); 1205 } 1206 1207 1208/** 1209 * Sets this SBML object to child SBML objects (if any). 1210 * (Creates a child-parent relationship by the parent) 1211 <p> 1212 * Subclasses must override this function if they define 1213 * one ore more child elements. 1214 * Basically, this function needs to be called in 1215 * constructor, copy constructor and assignment operator. 1216 <p> 1217 * @see setSBMLDocument 1218 * @see enablePackageInternal 1219 * @internal 1220 */ public 1221 void connectToChild() { 1222 libsbmlJNI.Reaction_connectToChild(swigCPtr, this); 1223 } 1224 1225 1226/** 1227 * Enables/Disables the given package with this element and child 1228 * elements (if any). 1229 * (This is an internal implementation for enablePackage function) 1230 <p> 1231 * @note Subclasses of the SBML Core package in which one or more child 1232 * elements are defined must override this function. 1233 * @internal 1234 */ public 1235 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 1236 libsbmlJNI.Reaction_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 1237 } 1238 1239 1240/** 1241 * Returns the libSBML type code for this SBML object. 1242 <p> 1243 * <p> 1244 * LibSBML attaches an identifying code to every kind of SBML object. These 1245 * are integer constants known as <em>SBML type codes</em>. The names of all 1246 * the codes begin with the characters “<code>SBML_</code>”. 1247 * In the Java language interface for libSBML, the 1248 * type codes are defined as static integer constants in the interface class 1249 * {@link libsbmlConstants}. Note that different Level 3 1250 * package plug-ins may use overlapping type codes; to identify the package 1251 * to which a given object belongs, call the <code>getPackageName()</code> 1252 * method on the object. 1253 <p> 1254 * @return the SBML type code for this object: 1255 * {@link libsbmlConstants#SBML_REACTION SBML_REACTION} (default). 1256 <p> 1257 * <p> 1258 * @warning <span class='warning'>The specific integer values of the possible 1259 * type codes may be reused by different Level 3 package plug-ins. 1260 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 1261 * both getTypeCode() and getPackageName()</strong>.</span> 1262 <p> 1263 * @see #getElementName() 1264 * @see #getPackageName() 1265 */ public 1266 int getTypeCode() { 1267 return libsbmlJNI.Reaction_getTypeCode(swigCPtr, this); 1268 } 1269 1270 1271/** 1272 * Returns the XML element name of this object, which for {@link Reaction}, is 1273 * always <code>'reaction'.</code> 1274 <p> 1275 * @return the name of this element, i.e., <code>'reaction'.</code> 1276 */ public 1277 String getElementName() { 1278 return libsbmlJNI.Reaction_getElementName(swigCPtr, this); 1279 } 1280 1281 1282/** 1283 * Predicate returning <code>true</code> if all the required attributes for this 1284 * {@link Reaction} object have been set. 1285 <p> 1286 * @note The required attributes for a {@link Reaction} object are: 1287 * <ul> 1288 * <li> 'id' (or 'name' in SBML Level 1) 1289 * <li> 'fast' (in Level 3 only, where it is defined as a required attribute) 1290 * <li> 'reversible' (in Level 3 only, where it is defined as a required attribute) 1291 * 1292 * </ul> <p> 1293 * @return a boolean value indicating whether all the required 1294 * attributes for this object have been defined. 1295 */ public 1296 boolean hasRequiredAttributes() { 1297 return libsbmlJNI.Reaction_hasRequiredAttributes(swigCPtr, this); 1298 } 1299 1300}