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 Level 2's StoichiometryMath 013 * construct. 014 <p> 015 * <h2>Stoichiometries in SBML Level 2</h2> 016 <p> 017 * In SBML Level 2, product and reactant stoichiometries can be specified 018 * using <em>either</em> the 'stoichiometry' attribute or a 'stoichiometryMath' 019 * element in a {@link SpeciesReference} object. The 'stoichiometry' attribute is 020 * of type <code>double</code> and should contain values greater than zero (0). The 021 * 'stoichiometryMath' element is implemented as an element containing a 022 * MathML expression. These two are mutually exclusive; only one of 023 * 'stoichiometry' or 'stoichiometryMath' should be defined in a given 024 * {@link SpeciesReference} instance. When neither the attribute nor the element 025 * is present, the value of 'stoichiometry' in the enclosing 026 * {@link SpeciesReference} instance defaults to <code>1.</code> 027 <p> 028 * For maximum interoperability, {@link SpeciesReference}'s 'stoichiometry' 029 * attribute should be used in preference to 'stoichiometryMath' when a 030 * species' stoichiometry is a simple scalar number (integer or decimal). 031 * When the stoichiometry is a rational number, or when it is a more 032 * complicated formula, 'stoichiometryMath' must be used. The MathML 033 * expression in 'stoichiometryMath' may also refer to identifiers of 034 * entities in a model (except reaction identifiers). However, the only 035 * species identifiers that can be used in 'stoichiometryMath' are those 036 * referenced in the enclosing {@link Reaction}'s list of reactants, products and 037 * modifiers. 038 <p> 039 * The 'stoichiometry' attribute and the 'stoichiometryMath' element, when 040 * either is used, is each interpreted as a factor applied to the reaction 041 * rate to produce the rate of change of the species identified by the 042 * 'species' attribute in the enclosing {@link SpeciesReference}. This is the 043 * normal interpretation of a stoichiometry, but in SBML, one additional 044 * consideration has to be taken into account. The reaction rate, which is 045 * the result of the {@link KineticLaw}'s 'math' element, is always in the model's 046 * <em>substance</em> per <em>time</em> units. However, the rate of change of the 047 * species will involve the species' <em>substance</em> units (i.e., the units 048 * identified by the {@link Species} object's 'substanceUnits' attribute), and 049 * these units may be different from the model's default <em>substance</em> 050 * units. If the units <em>are</em> different, the stoichiometry must 051 * incorporate a conversion factor for converting the model's <em>substance</em> 052 * units to the species' <em>substance</em> units. The conversion factor is 053 * assumed to be included in the scalar value of the 'stoichiometry' 054 * attribute if 'stoichiometry' is used. If instead 'stoichiometryMath' is 055 * used, then the product of the model's 'substance' units times the 056 * 'stoichiometryMath' units must match the <em>substance</em> units of the 057 * species. Note that in either case, if the species' units and the 058 * model's default <em>substance</em> units are the same, the stoichiometry ends 059 * up being a dimensionless number and equivalent to the standard chemical 060 * stoichiometry found in textbooks. Examples and more explanations of 061 * this are given in the SBML specification. 062 <p> 063 * The following is a simple example of a species reference for species 064 * <code>'X0'</code>, with stoichiometry <code>2</code>, in a list of reactants within a reaction 065 * having the identifier <code>'J1':</code> 066 * <div class='fragment'><pre class='fragment'> 067 <model> 068 ... 069 <listOfReactions> 070 <reaction id='J1'> 071 <listOfReactants> 072 <speciesReference species='X0' stoichiometry='2'> 073 </listOfReactants> 074 ... 075 </reaction> 076 ... 077 </listOfReactions> 078 ... 079 </model> 080 </pre></div> 081 <p> 082 * The following is a more complex example of a species reference for 083 * species <code>'X0'</code>, with a stoichiometry formula consisting of 084 * a rational number: 085 * <div class='fragment'><pre class='fragment'> 086 <model> 087 ... 088 <listOfReactions> 089 <reaction id='J1'> 090 <listOfReactants> 091 <speciesReference species='X0'> 092 <stoichiometryMath> 093 <math xmlns='http://www.w3.org/1998/Math/MathML'> 094 <cn type='rational'> 3 <sep/> 2 </cn> 095 </math> 096 </stoichiometryMath> 097 </speciesReference> 098 </listOfReactants> 099 ... 100 </reaction> 101 ... 102 </listOfReactions> 103 ... 104 </model> 105 </pre></div> 106 <p> 107 * Additional discussions of stoichiometries and implications for species 108 * and reactions are included in the documentation of {@link SpeciesReference} 109 * class. 110 <p> 111 * <h2>Stoichiometries in SBML Level 3</h2> 112 <p> 113 * The {@link StoichiometryMath} construct is not defined in SBML Level 3 114 * Version 1 Core. Instead, Level 3 defines the identifier of 115 * {@link SpeciesReference} objects as a stand-in for the stoichiometry of the 116 * reactant or product being referenced, and allows that identifier to be 117 * used elsewhere in SBML models, including (for example) {@link InitialAssignment} 118 * objects. This makes it possible to achieve the same effect as 119 * {@link StoichiometryMath}, but with other SBML objects. For instance, to 120 * produce a stoichiometry value that is a rational number, a model can use 121 * {@link InitialAssignment} to assign the identifier of a {@link SpeciesReference} object 122 * to a MathML expression evaluating to a rational number. This is 123 * analogous to the same way that, in Level 2, the model would use 124 * {@link StoichiometryMath} with a MathML expression evaluating to a rational 125 * number. 126 <p> 127 * In SBML Level 2, the stoichiometry of a reactant or product is a 128 * combination of both a <em>biochemical stoichiometry</em> (meaning, the 129 * standard stoichiometry of a species in a reaction) and any necessary 130 * unit conversion factors. The introduction of an explicit attribute on 131 * the {@link Species} object for a conversion factor allows Level 3 to avoid 132 * having to overload the meaning of stoichiometry. In Level 3, the 133 * stoichiometry given by a {@link SpeciesReference} object in a reaction is a 134 * 'proper' biochemical stoichiometry, meaning a dimensionless number free 135 * of unit conversions. 136 <p> 137 * @see SpeciesReference 138 * @see Reaction 139 */ 140 141public class StoichiometryMath extends SBase { 142 private long swigCPtr; 143 144 protected StoichiometryMath(long cPtr, boolean cMemoryOwn) 145 { 146 super(libsbmlJNI.StoichiometryMath_SWIGUpcast(cPtr), cMemoryOwn); 147 swigCPtr = cPtr; 148 } 149 150 protected static long getCPtr(StoichiometryMath obj) 151 { 152 return (obj == null) ? 0 : obj.swigCPtr; 153 } 154 155 protected static long getCPtrAndDisown (StoichiometryMath obj) 156 { 157 long ptr = 0; 158 159 if (obj != null) 160 { 161 ptr = obj.swigCPtr; 162 obj.swigCMemOwn = false; 163 } 164 165 return ptr; 166 } 167 168 protected void finalize() { 169 delete(); 170 } 171 172 public synchronized void delete() { 173 if (swigCPtr != 0) { 174 if (swigCMemOwn) { 175 swigCMemOwn = false; 176 libsbmlJNI.delete_StoichiometryMath(swigCPtr); 177 } 178 swigCPtr = 0; 179 } 180 super.delete(); 181 } 182 183 184/** 185 * Creates a new {@link StoichiometryMath} object using the given SBML <code>level</code> 186 * values. 187 <p> 188 * @param level a long integer, the SBML Level to assign to this {@link StoichiometryMath} 189 <p> 190 * @param version a long integer, the SBML Version to assign to this 191 * {@link StoichiometryMath} 192 <p> 193 * @throws SBMLConstructorException 194 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 195 * of SBML object, are either invalid or mismatched with respect to the 196 * parent {@link SBMLDocument} object. 197 <p> 198 * <p> 199 * @note The {@link StoichiometryMath} construct exists only in SBML Level 2. 200 * It is an optional construct available for defining the stoichiometries of 201 * reactants and products in {@link Reaction} objects. Note that a different 202 * mechanism is used in SBML Level 3, where {@link StoichiometryMath} is not 203 * available. Please consult the top of this libSBML {@link StoichiometryMath} 204 * documentation for more information about the differences between SBML 205 * Level 2 and 3 with respect to stoichiometries. 206 <p> 207 * <p> 208 * @note Upon the addition of a {@link StoichiometryMath} object to an 209 * {@link SBMLDocument} (e.g., using 210 * {@link SpeciesReference#createStoichiometryMath()}), the SBML Level, SBML 211 * Version and XML namespace of the document <em>override</em> the values used 212 * when creating the {@link StoichiometryMath} object via this constructor. This 213 * is necessary to ensure that an SBML document is a consistent 214 * structure. Nevertheless, the ability to supply the values at the time 215 * of creation of a {@link StoichiometryMath} is an important aid to producing 216 * valid SBML. Knowledge of the intented SBML Level and Version 217 * determine whether it is valid to assign a particular value to an 218 * attribute, or whether it is valid to add an object to an existing 219 * {@link SBMLDocument}. 220 */ public 221 StoichiometryMath(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 222 this(libsbmlJNI.new_StoichiometryMath__SWIG_0(level, version), true); 223 } 224 225 226/** 227 * Creates a new {@link StoichiometryMath} object using the given {@link SBMLNamespaces} object 228 * <code>sbmlns</code>. 229 <p> 230 * <p> 231 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 232 * information. It is used to communicate the SBML Level, Version, and (in 233 * Level 3) packages used in addition to SBML Level 3 Core. A 234 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 235 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object 236 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 237 <p> 238 * @param sbmlns an {@link SBMLNamespaces} object. 239 <p> 240 * @throws SBMLConstructorException 241 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 242 * of SBML object, are either invalid or mismatched with respect to the 243 * parent {@link SBMLDocument} object. 244 <p> 245 * <p> 246 * @note The {@link StoichiometryMath} construct exists only in SBML Level 2. 247 * It is an optional construct available for defining the stoichiometries of 248 * reactants and products in {@link Reaction} objects. Note that a different 249 * mechanism is used in SBML Level 3, where {@link StoichiometryMath} is not 250 * available. Please consult the top of this libSBML {@link StoichiometryMath} 251 * documentation for more information about the differences between SBML 252 * Level 2 and 3 with respect to stoichiometries. 253 <p> 254 * <p> 255 * @note Upon the addition of a {@link StoichiometryMath} object to an 256 * {@link SBMLDocument} (e.g., using 257 * {@link SpeciesReference#createStoichiometryMath()}), the SBML Level, SBML 258 * Version and XML namespace of the document <em>override</em> the values used 259 * when creating the {@link StoichiometryMath} object via this constructor. This 260 * is necessary to ensure that an SBML document is a consistent 261 * structure. Nevertheless, the ability to supply the values at the time 262 * of creation of a {@link StoichiometryMath} is an important aid to producing 263 * valid SBML. Knowledge of the intented SBML Level and Version 264 * determine whether it is valid to assign a particular value to an 265 * attribute, or whether it is valid to add an object to an existing 266 * {@link SBMLDocument}. 267 */ public 268 StoichiometryMath(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 269 this(libsbmlJNI.new_StoichiometryMath__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 270 } 271 272 273/** 274 * Copy constructor; creates a copy of this {@link StoichiometryMath}. 275 <p> 276 * @param orig the object to copy. 277 <p> 278 * @throws SBMLConstructorException 279 * Thrown if the argument <code>orig</code> is <code>null.</code> 280 */ public 281 StoichiometryMath(StoichiometryMath orig) throws org.sbml.libsbml.SBMLConstructorException { 282 this(libsbmlJNI.new_StoichiometryMath__SWIG_2(StoichiometryMath.getCPtr(orig), orig), true); 283 } 284 285 286/** 287 * Creates and returns a deep copy of this {@link StoichiometryMath} object. 288 <p> 289 * @return a (deep) copy of this {@link StoichiometryMath}. 290 */ public 291 StoichiometryMath cloneObject() { 292 long cPtr = libsbmlJNI.StoichiometryMath_cloneObject(swigCPtr, this); 293 return (cPtr == 0) ? null : new StoichiometryMath(cPtr, true); 294 } 295 296 297/** 298 * Retrieves the mathematical formula within this {@link StoichiometryMath} and 299 * return it as an AST. 300 <p> 301 * @return the math of this {@link StoichiometryMath}. 302 <p> 303 * <p> 304 * @note The {@link StoichiometryMath} construct exists only in SBML Level 2. 305 * It is an optional construct available for defining the stoichiometries of 306 * reactants and products in {@link Reaction} objects. Note that a different 307 * mechanism is used in SBML Level 3, where {@link StoichiometryMath} is not 308 * available. Please consult the top of this libSBML {@link StoichiometryMath} 309 * documentation for more information about the differences between SBML 310 * Level 2 and 3 with respect to stoichiometries. 311 */ public 312 ASTNode getMath() { 313 long cPtr = libsbmlJNI.StoichiometryMath_getMath(swigCPtr, this); 314 return (cPtr == 0) ? null : new ASTNode(cPtr, false); 315 } 316 317 318/** 319 * Predicate to test whether the math for this {@link StoichiometryMath} object 320 * is set. 321 <p> 322 * @return <code>true</code> if the formula (meaning the <code>math</code> subelement) of 323 * this {@link StoichiometryMath} is set, <code>false</code> otherwise. 324 <p> 325 * <p> 326 * @note The {@link StoichiometryMath} construct exists only in SBML Level 2. 327 * It is an optional construct available for defining the stoichiometries of 328 * reactants and products in {@link Reaction} objects. Note that a different 329 * mechanism is used in SBML Level 3, where {@link StoichiometryMath} is not 330 * available. Please consult the top of this libSBML {@link StoichiometryMath} 331 * documentation for more information about the differences between SBML 332 * Level 2 and 3 with respect to stoichiometries. 333 */ public 334 boolean isSetMath() { 335 return libsbmlJNI.StoichiometryMath_isSetMath(swigCPtr, this); 336 } 337 338 339/** 340 * Sets the 'math' expression of this {@link StoichiometryMath} instance to a 341 * copy of the given {@link ASTNode}. 342 <p> 343 * @param math an {@link ASTNode} representing a formula tree. 344 <p> 345 * @return integer value indicating success/failure of the 346 * function. The possible values 347 * returned by this function are: 348 * <ul> 349 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 350 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 351 * 352 * </ul> <p> 353 * <p> 354 * @note The {@link StoichiometryMath} construct exists only in SBML Level 2. 355 * It is an optional construct available for defining the stoichiometries of 356 * reactants and products in {@link Reaction} objects. Note that a different 357 * mechanism is used in SBML Level 3, where {@link StoichiometryMath} is not 358 * available. Please consult the top of this libSBML {@link StoichiometryMath} 359 * documentation for more information about the differences between SBML 360 * Level 2 and 3 with respect to stoichiometries. 361 */ public 362 int setMath(ASTNode math) { 363 return libsbmlJNI.StoichiometryMath_setMath(swigCPtr, this, ASTNode.getCPtr(math), math); 364 } 365 366 367/** 368 * Calculates and returns a {@link UnitDefinition} object that expresses the 369 * units returned by the math expression in this {@link StoichiometryMath} 370 * object. 371 <p> 372 * The units are calculated based on the mathematical expression in the 373 * {@link StoichiometryMath} and the model quantities referenced by 374 * <code><ci></code> elements used within that expression. The 375 * {@link StoichiometryMath#getDerivedUnitDefinition()} method returns the 376 * calculated units. 377 <p> 378 * Note that the functionality that facilitates unit analysis depends 379 * on the model as a whole. Thus, in cases where the object has not 380 * been added to a model or the model itself is incomplete, 381 * unit analysis is not possible and this method will return <code>null.</code> 382 <p> 383 * @return a {@link UnitDefinition} that expresses the units of the math, 384 * or <code>null</code> if one cannot be constructed. 385 <p> 386 * @warning <span class='warning'>Note that it is possible the 'math' 387 * expression in the {@link StoichiometryMath} instance contains literal numbers or 388 * parameters with undeclared units. In those cases, it is not possible to 389 * calculate the units of the overall expression without making 390 * assumptions. LibSBML does not make assumptions about the units, and 391 * {@link StoichiometryMath#getDerivedUnitDefinition()} only returns the units as 392 * far as it is able to determine them. For example, in an expression 393 * <em>X + Y</em>, if <em>X</em> has unambiguously-defined units and 394 * <em>Y</em> does not, it will return the units of <em>X</em>. When using 395 * this method, <strong>it is critical that callers also invoke the 396 * method</strong> {@link StoichiometryMath#containsUndeclaredUnits()} <strong>to 397 * determine whether this situation holds</strong>. Callers should take 398 * suitable action in those situations.</span> 399 <p> 400 * @see #containsUndeclaredUnits() 401 */ public 402 UnitDefinition getDerivedUnitDefinition() { 403 long cPtr = libsbmlJNI.StoichiometryMath_getDerivedUnitDefinition__SWIG_0(swigCPtr, this); 404 return (cPtr == 0) ? null : new UnitDefinition(cPtr, false); 405 } 406 407 408/** 409 * Predicate returning <code>true</code> if the math 410 * expression of this {@link StoichiometryMath} object contains literal numbers 411 * or parameters with undeclared units. 412 <p> 413 * The {@link StoichiometryMath#getDerivedUnitDefinition()} method returns what 414 * libSBML computes the units of the Stoichiometry to be, to the extent 415 * that libSBML can compute them. However, if the expression contains 416 * literal numbers or parameters with undeclared units, libSBML may not 417 * be able to compute the full units of the expression and will only 418 * return what it can compute. Callers should always use 419 * {@link StoichiometryMath#containsUndeclaredUnits()} when using 420 * {@link StoichiometryMath#getDerivedUnitDefinition()} to decide whether the 421 * returned units may be incomplete. 422 <p> 423 * @return <code>true</code> if the math expression of this {@link StoichiometryMath} 424 * includes numbers/parameters with undeclared units, <code>false</code> otherwise. 425 <p> 426 * @note A return value of <code>true</code> indicates that the {@link UnitDefinition} 427 * returned by {@link StoichiometryMath#getDerivedUnitDefinition()} may not 428 * accurately represent the units of the expression. 429 <p> 430 * @see #getDerivedUnitDefinition() 431 */ public 432 boolean containsUndeclaredUnits() { 433 return libsbmlJNI.StoichiometryMath_containsUndeclaredUnits__SWIG_0(swigCPtr, this); 434 } 435 436 437/** 438 * Returns the libSBML type code of this object instance. 439 <p> 440 * <p> 441 * LibSBML attaches an identifying code to every kind of SBML object. These 442 * are integer constants known as <em>SBML type codes</em>. The names of all 443 * the codes begin with the characters “<code>SBML_</code>”. 444 * In the Java language interface for libSBML, the 445 * type codes are defined as static integer constants in the interface class 446 * {@link libsbmlConstants}. Note that different Level 3 447 * package plug-ins may use overlapping type codes; to identify the package 448 * to which a given object belongs, call the <code>getPackageName()</code> 449 * method on the object. 450 <p> 451 * @return the SBML type code for this object: 452 * {@link libsbmlConstants#SBML_STOICHIOMETRY_MATH SBML_STOICHIOMETRY_MATH} (default). 453 <p> 454 * <p> 455 * @warning <span class='warning'>The specific integer values of the possible 456 * type codes may be reused by different Level 3 package plug-ins. 457 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 458 * both getTypeCode() and getPackageName()</strong>.</span> 459 <p> 460 * @see #getElementName() 461 * @see #getPackageName() 462 */ public 463 int getTypeCode() { 464 return libsbmlJNI.StoichiometryMath_getTypeCode(swigCPtr, this); 465 } 466 467 468/** 469 * Returns the XML element name of this object, which for {@link StoichiometryMath}, is 470 * always <code>'stoichiometryMath'.</code> 471 <p> 472 * @return the name of this element, i.e., <code>'stoichiometryMath'.</code> 473 */ public 474 String getElementName() { 475 return libsbmlJNI.StoichiometryMath_getElementName(swigCPtr, this); 476 } 477 478 479/** 480 * Predicate returning <code>true</code> if 481 * all the required elements for this {@link StoichiometryMath} object 482 * have been set. 483 <p> 484 * @note The required elements for a {@link StoichiometryMath} object are: 485 * <ul> 486 * <li> 'math' 487 * 488 * </ul> <p> 489 * @return a boolean value indicating whether all the required 490 * elements for this object have been defined. 491 */ public 492 boolean hasRequiredElements() { 493 return libsbmlJNI.StoichiometryMath_hasRequiredElements(swigCPtr, this); 494 } 495 496 497/** 498 * Finds this {@link StoichiometryMath}'s {@link SpeciesReference} parent and calls 499 * unsetStoichiometryMath() on it, indirectly deleting itself. 500 <p> 501 * Overridden from the {@link SBase} function since the parent is not a {@link ListOf}. 502 <p> 503 * @return integer value indicating success/failure of the 504 * function. The possible values 505 * returned by this function are: 506 * <ul> 507 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 508 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 509 * </ul> 510 */ public 511 int removeFromParentAndDelete() { 512 return libsbmlJNI.StoichiometryMath_removeFromParentAndDelete(swigCPtr, this); 513 } 514 515 516/** 517 * Renames all the <code>SIdRef</code> attributes on this element, including any 518 * found in MathML. 519 <p> 520 * <p> 521 * In SBML, object identifiers are of a data type called <code>SId</code>. 522 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 523 * introduced for attribute values that refer to <code>SId</code> values; in 524 * previous Levels of SBML, this data type did not exist and attributes were 525 * simply described to as 'referring to an identifier', but the effective 526 * data type was the same as <code>SIdRef</code>in Level 3. These and 527 * other methods of libSBML refer to the type <code>SIdRef</code> for all 528 * Levels of SBML, even if the corresponding SBML specification did not 529 * explicitly name the data type. 530 <p> 531 * This method works by looking at all attributes and (if appropriate) 532 * mathematical formulas, comparing the identifiers to the value of 533 * <code>oldid</code>. If any matches are found, the matching identifiers are replaced 534 * with <code>newid</code>. The method does <em>not</em> descend into child elements. 535 <p> 536 * @param oldid the old identifier 537 * @param newid the new identifier 538 */ public 539 void renameSIdRefs(String oldid, String newid) { 540 libsbmlJNI.StoichiometryMath_renameSIdRefs(swigCPtr, this, oldid, newid); 541 } 542 543 544/** 545 * Renames all the <code>UnitSIdRef</code> attributes on this element. 546 <p> 547 * <p> 548 * In SBML, unit definitions have identifiers of type <code>UnitSId</code>. In 549 * SBML Level 3, an explicit data type called <code>UnitSIdRef</code> was 550 * introduced for attribute values that refer to <code>UnitSId</code> values; in 551 * previous Levels of SBML, this data type did not exist and attributes were 552 * simply described to as 'referring to a unit identifier', but the effective 553 * data type was the same as <code>UnitSIdRef</code> in Level 3. These and 554 * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all 555 * Levels of SBML, even if the corresponding SBML specification did not 556 * explicitly name the data type. 557 <p> 558 * This method works by looking at all unit identifier attribute values 559 * (including, if appropriate, inside mathematical formulas), comparing the 560 * unit identifiers to the value of <code>oldid</code>. If any matches are found, 561 * the matching identifiers are replaced with <code>newid</code>. The method does 562 * <em>not</em> descend into child elements. 563 <p> 564 * @param oldid the old identifier 565 * @param newid the new identifier 566 */ public 567 void renameUnitSIdRefs(String oldid, String newid) { 568 libsbmlJNI.StoichiometryMath_renameUnitSIdRefs(swigCPtr, this, oldid, newid); 569 } 570 571 572/** 573 * Replace all nodes with the name 'id' from the child 'math' object with the provided function. 574 <p> 575 * @internal 576 */ public 577 void replaceSIDWithFunction(String id, ASTNode function) { 578 libsbmlJNI.StoichiometryMath_replaceSIDWithFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 579 } 580 581}