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 * The rate expression for an SBML reaction. 013 <p> 014 * An object of class {@link KineticLaw} is used to describe the rate at which the 015 * process defined by a given {@link Reaction} takes place. {@link KineticLaw} has 016 * subelements called 'math' (for MathML content) and 'listOfParameters' 017 * (of class {@link ListOfParameters}), in addition to the attributes and 018 * subelements it inherits from {@link SBase}. 019 <p> 020 * {@link KineticLaw}'s 'math' subelement for holding a MathML formula (required 021 * through SBML Level 3 Version 1, but optional as of SBML 022 * Level 3 Version 2) defines the 023 * rate of the reaction. The formula may refer to other entities in a 024 * model as well as local parameter definitions within the scope of the 025 * {@link Reaction} (see below). It is important to keep in mind, however, that 026 * the only {@link Species} identifiers that can be used in this formula are those 027 * declared in the lists of reactants, products and modifiers in the 028 * {@link Reaction} structure. (In other words, before a species can be referenced 029 * in the {@link KineticLaw}, it must be declared in one of those lists.) 030 <p> 031 * {@link KineticLaw} provides a way to define <em>local</em> parameters whose 032 * identifiers can be used in the 'math' formula of that {@link KineticLaw} 033 * instance. Prior to SBML Level 3, these parameter definitions are 034 * stored inside a 'listOfParameters' subelement containing {@link Parameter} 035 * objects; in SBML Level 3, this is achieved using a specialized 036 * object class called {@link LocalParameter} and the containing subelement is 037 * called 'listOfLocalParameters'. In both cases, the parameters so 038 * defined are only visible within the {@link KineticLaw} (or, as of SBML 039 * Level 3 Version 2, only visible within the parent {@link Reaction}); 040 * they cannot be accessed 041 * outside. A local parameter within one reaction is not visible from 042 * within another reaction, nor is it visible to any other construct 043 * outside of the {@link KineticLaw} in which it is defined. In addition, another 044 * important feature is that if such a {@link Parameter} (or in Level 3, 045 * {@link LocalParameter}) object has the same identifier as another object in the 046 * scope of the enclosing {@link Model}, the definition inside the {@link KineticLaw} takes 047 * precedence. In other words, within the {@link KineticLaw}'s 'math' formula, 048 * references to local parameter identifiers <strong>shadow any identical 049 * global identifiers</strong>. 050 <p> 051 * The values of local parameters defined within {@link KineticLaw} objects cannot 052 * change. In SBML Level 3, this quality is built into the 053 * {@link LocalParameter} construct. In Level 2, where the same kind of 054 * {@link Parameter} object class is used as for global parameters, the {@link Parameter} 055 * objects' 'constant' attribute must always have a value of <code>true</code> 056 * (either explicitly or left to its default value). 057 <p> 058 * <h2>A warning about identifier shadowing</h2> 059 <p> 060 * A common misconception is that different classes of objects (e.g., 061 * species, compartments, parameters) in SBML have different identifier 062 * scopes. They do not. The implication is that if a {@link KineticLaw}'s local 063 * parameter definition uses an identifier identical to <em>any</em> other 064 * identifier defined in the model outside the {@link KineticLaw}, even if the 065 * other identifier does <em>not</em> belong to a parameter type of object, the 066 * local parameter's identifier takes precedence within that {@link KineticLaw}'s 067 * 'math' formula. It is not an error in SBML for identifiers to shadow 068 * each other this way, but can lead to confusing and subtle errors. 069 <p> 070 * <h2>SBML Level/Version differences</h2> 071 <p> 072 * In SBML Level 2 Version 1, the SBML specification 073 * included two additional attributes on {@link KineticLaw} called 'substanceUnits' 074 * and 'timeUnits'. They were removed beginning with SBML Level 2 075 * Version 2 because further research determined they introduced many 076 * problems. The most significant problem was that their use could easily 077 * lead to the creation of valid models whose reactions nevertheless could 078 * not be integrated into a system of equations without outside knowledge 079 * for converting the quantities used. Examination of real-life models 080 * revealed that a common reason for using 'substanceUnits' on {@link KineticLaw} 081 * was to set the units of all reactions to the same set of substance 082 * units, something that is better achieved by using {@link UnitDefinition} to 083 * redefine <code>'substance'</code> for the whole {@link Model}. 084 <p> 085 * As mentioned above, in SBML Level 2 Versions 2–4, local 086 * parameters are of class {@link Parameter}. In SBML Level 3, the class of 087 * object is {@link LocalParameter}. 088 <p> 089 * In SBML Level 3 Version 2, the scope of the {@link LocalParameter} 090 * was expanded to the entire {@link Reaction}, instead of just the {@link KineticLaw}. 091 * This introduced a single new restriction: an L3v2 {@link LocalParameter} may 092 * not now shadow the <code>id</code> of any {@link Species} referenced by a {@link SpeciesReference} 093 * in the same {@link Reaction}. Other than that, there is no difference in any 094 * core construct. However, packages may take advantage of this new scope by 095 * adding elements to the {@link Reaction} that may now reference a {@link LocalParameter} 096 * defined in the same {@link Reaction}. 097 */ 098 099public class KineticLaw extends SBase { 100 private long swigCPtr; 101 102 protected KineticLaw(long cPtr, boolean cMemoryOwn) 103 { 104 super(libsbmlJNI.KineticLaw_SWIGUpcast(cPtr), cMemoryOwn); 105 swigCPtr = cPtr; 106 } 107 108 protected static long getCPtr(KineticLaw obj) 109 { 110 return (obj == null) ? 0 : obj.swigCPtr; 111 } 112 113 protected static long getCPtrAndDisown (KineticLaw obj) 114 { 115 long ptr = 0; 116 117 if (obj != null) 118 { 119 ptr = obj.swigCPtr; 120 obj.swigCMemOwn = false; 121 } 122 123 return ptr; 124 } 125 126 protected void finalize() { 127 delete(); 128 } 129 130 public synchronized void delete() { 131 if (swigCPtr != 0) { 132 if (swigCMemOwn) { 133 swigCMemOwn = false; 134 libsbmlJNI.delete_KineticLaw(swigCPtr); 135 } 136 swigCPtr = 0; 137 } 138 super.delete(); 139 } 140 141 142/** 143 * Creates a new {@link KineticLaw} using the given SBML <code>level</code> and <code>version</code> 144 * values. 145 <p> 146 * @param level a long integer, the SBML Level to assign to this {@link KineticLaw}. 147 <p> 148 * @param version a long integer, the SBML Version to assign to this 149 * {@link KineticLaw}. 150 <p> 151 * <p> 152 * @throws SBMLConstructorException 153 * Thrown if the given <code>level</code> and <code>version</code> combination are invalid 154 * or if this object is incompatible with the given level and version. 155 <p> 156 * <p> 157 * @note Attempting to add an object to an {@link SBMLDocument} having a different 158 * combination of SBML Level, Version and XML namespaces than the object 159 * itself will result in an error at the time a caller attempts to make the 160 * addition. A parent object must have compatible Level, Version and XML 161 * namespaces. (Strictly speaking, a parent may also have more XML 162 * namespaces than a child, but the reverse is not permitted.) The 163 * restriction is necessary to ensure that an SBML model has a consistent 164 * overall structure. This requires callers to manage their objects 165 * carefully, but the benefit is increased flexibility in how models can be 166 * created by permitting callers to create objects bottom-up if desired. In 167 * situations where objects are not yet attached to parents (e.g., 168 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 169 * libSBML determine such things as whether it is valid to assign a 170 * particular value to an attribute. 171 */ public 172 KineticLaw(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 173 this(libsbmlJNI.new_KineticLaw__SWIG_0(level, version), true); 174 } 175 176 177/** 178 * Creates a new {@link KineticLaw} using the given {@link SBMLNamespaces} object 179 * <code>sbmlns</code>. 180 <p> 181 * <p> 182 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 183 * information. It is used to communicate the SBML Level, Version, and (in 184 * Level 3) packages used in addition to SBML Level 3 Core. A 185 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 186 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object 187 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 188 <p> 189 * @param sbmlns an {@link SBMLNamespaces} object. 190 <p> 191 * <p> 192 * @throws SBMLConstructorException 193 * Thrown if the given <code>sbmlns</code> is inconsistent or incompatible 194 * with this object. 195 <p> 196 * <p> 197 * @note Attempting to add an object to an {@link SBMLDocument} having a different 198 * combination of SBML Level, Version and XML namespaces than the object 199 * itself will result in an error at the time a caller attempts to make the 200 * addition. A parent object must have compatible Level, Version and XML 201 * namespaces. (Strictly speaking, a parent may also have more XML 202 * namespaces than a child, but the reverse is not permitted.) The 203 * restriction is necessary to ensure that an SBML model has a consistent 204 * overall structure. This requires callers to manage their objects 205 * carefully, but the benefit is increased flexibility in how models can be 206 * created by permitting callers to create objects bottom-up if desired. In 207 * situations where objects are not yet attached to parents (e.g., 208 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 209 * libSBML determine such things as whether it is valid to assign a 210 * particular value to an attribute. 211 */ public 212 KineticLaw(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 213 this(libsbmlJNI.new_KineticLaw__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 214 } 215 216 217/** 218 * Copy constructor; creates a copy of this {@link KineticLaw}. 219 <p> 220 * @param orig the object to copy. 221 */ public 222 KineticLaw(KineticLaw orig) throws org.sbml.libsbml.SBMLConstructorException { 223 this(libsbmlJNI.new_KineticLaw__SWIG_2(KineticLaw.getCPtr(orig), orig), true); 224 } 225 226 227/** 228 * Creates and returns a deep copy of this {@link KineticLaw} object. 229 <p> 230 * @return the (deep) copy of this {@link KineticLaw} object. 231 */ public 232 KineticLaw cloneObject() { 233 long cPtr = libsbmlJNI.KineticLaw_cloneObject(swigCPtr, this); 234 return (cPtr == 0) ? null : new KineticLaw(cPtr, true); 235 } 236 237 238/** 239 * Returns the first child element found that has the given <code>id</code> in the 240 * model-wide SId namespace, or <code>null</code> if no such object is found. 241 <p> 242 * @param id string representing the id of the object to find. 243 <p> 244 * @return pointer to the first element found with the given <code>id</code>. 245 */ public 246 SBase getElementBySId(String id) { 247 return libsbml.DowncastSBase(libsbmlJNI.KineticLaw_getElementBySId(swigCPtr, this, id), false); 248} 249 250 251/** 252 * Returns the first child element it can find with the given <code>metaid</code>, or 253 * <code>null</code> if no such object is found. 254 <p> 255 * @param metaid string representing the metaid of the object to find. 256 <p> 257 * @return pointer to the first element found with the given <code>metaid</code>. 258 */ public 259 SBase getElementByMetaId(String metaid) { 260 return libsbml.DowncastSBase(libsbmlJNI.KineticLaw_getElementByMetaId(swigCPtr, this, metaid), false); 261} 262 263 264/** 265 * Returns the mathematical formula for this {@link KineticLaw} object and return 266 * it as as a text string. 267 <p> 268 * This is fundamentally equivalent to 269 * {@link KineticLaw#getMath()}. 270 * This variant is provided principally for compatibility compatibility 271 * with SBML Level 1. 272 <p> 273 * @return a string representing the formula of this {@link KineticLaw}. 274 <p> 275 * @note SBML Level 1 uses a text-string format for mathematical formulas. 276SBML Level 2 uses MathML, an XML format for representing mathematical 277expressions. LibSBML provides an Abstract Syntax Tree API for working with 278mathematical expressions; this API is more powerful than working with 279formulas directly in text form, and ASTs can be translated into either 280MathML or the text-string syntax. The libSBML methods that accept 281text-string formulas directly (such as this constructor) are provided for 282SBML Level 1 compatibility, but developers are encouraged to use the 283AST mechanisms. 284 285 <p> 286 * @see #getMath() 287 */ public 288 String getFormula() { 289 return libsbmlJNI.KineticLaw_getFormula(swigCPtr, this); 290 } 291 292 293/** 294 * Returns the mathematical formula for this {@link KineticLaw} object and return 295 * it as as an AST. 296 <p> 297 * This is fundamentally equivalent to 298 * {@link KineticLaw#getFormula()}. 299 * The latter is provided principally for compatibility compatibility 300 * with SBML Level 1, which represented mathematical formulas in 301 * text-string form. 302 <p> 303 * @return the {@link ASTNode} representation of the mathematical formula, 304 * or <code>null</code> if the math is not set. 305 <p> 306 * @see #getFormula() 307 */ public 308 ASTNode getMath() { 309 long cPtr = libsbmlJNI.KineticLaw_getMath(swigCPtr, this); 310 return (cPtr == 0) ? null : new ASTNode(cPtr, false); 311 } 312 313 314/** 315 * (SBML Level 2 Version 1 only) Returns the value of the 316 * 'timeUnits' attribute of this {@link KineticLaw} object. 317 <p> 318 * @return the 'timeUnits' attribute value. 319 <p> 320 * <p> 321 * @note The attributes 'timeUnits' and 'substanceUnits' are present only 322 * in SBML Level 2 Version 1. In SBML Level 2 323 * Version 2, the 'timeUnits' and 'substanceUnits' attributes were 324 * removed. For compatibility with new versions of SBML, users are 325 * cautioned to avoid these attributes. 326 */ public 327 String getTimeUnits() { 328 return libsbmlJNI.KineticLaw_getTimeUnits(swigCPtr, this); 329 } 330 331 332/** 333 * (SBML Level 2 Version 1 only) Returns the value of the 334 * 'substanceUnits' attribute of this {@link KineticLaw} object. 335 <p> 336 * @return the 'substanceUnits' attribute value. 337 <p> 338 * <p> 339 * @note The attributes 'timeUnits' and 'substanceUnits' are present only 340 * in SBML Level 2 Version 1. In SBML Level 2 341 * Version 2, the 'timeUnits' and 'substanceUnits' attributes were 342 * removed. For compatibility with new versions of SBML, users are 343 * cautioned to avoid these attributes. 344 */ public 345 String getSubstanceUnits() { 346 return libsbmlJNI.KineticLaw_getSubstanceUnits(swigCPtr, this); 347 } 348 349 350/** 351 * Predicate returning <code>true</code> if this {@link KineticLaw}'s 'formula' attribute is 352 * set. 353 <p> 354 * This is functionally identical to the method 355 * {@link KineticLaw#isSetMath()}. It is 356 * provided in order to mirror the parallel between 357 * {@link KineticLaw#getFormula()} and 358 * {@link KineticLaw#getMath()}. 359 <p> 360 * @return <code>true</code> if the formula (meaning the <code>math</code> subelement) of 361 * this {@link KineticLaw} is set, <code>false</code> otherwise. 362 <p> 363 * @note SBML Level 1 uses a text-string format for mathematical formulas. 364SBML Level 2 uses MathML, an XML format for representing mathematical 365expressions. LibSBML provides an Abstract Syntax Tree API for working with 366mathematical expressions; this API is more powerful than working with 367formulas directly in text form, and ASTs can be translated into either 368MathML or the text-string syntax. The libSBML methods that accept 369text-string formulas directly (such as this constructor) are provided for 370SBML Level 1 compatibility, but developers are encouraged to use the 371AST mechanisms. 372 373 <p> 374 * @see #isSetMath() 375 */ public 376 boolean isSetFormula() { 377 return libsbmlJNI.KineticLaw_isSetFormula(swigCPtr, this); 378 } 379 380 381/** 382 * Predicate returning <code>true</code> if this Kinetic's 'math' subelement is set. 383 <p> 384 * This is identical to the method 385 * {@link KineticLaw#isSetFormula()}. 386 * It is provided in order to mirror the parallel between 387 * {@link KineticLaw#getFormula()} and 388 * {@link KineticLaw#getMath()}. 389 <p> 390 * @return <code>true</code> if the formula (meaning the <code>math</code> subelement) of 391 * this {@link KineticLaw} is set, <code>false</code> otherwise. 392 <p> 393 * @see #isSetFormula() 394 */ public 395 boolean isSetMath() { 396 return libsbmlJNI.KineticLaw_isSetMath(swigCPtr, this); 397 } 398 399 400/** 401 * (SBML Level 2 Version 1 only) Predicate returning <code>true</code> if 402 * this {@link SpeciesReference}'s 'timeUnits' attribute is set. 403 <p> 404 * @return <code>true</code> if the 'timeUnits' attribute of this {@link KineticLaw} object 405 * is set, <code>false</code> otherwise. 406 <p> 407 * <p> 408 * @note The attributes 'timeUnits' and 'substanceUnits' are present only 409 * in SBML Level 2 Version 1. In SBML Level 2 410 * Version 2, the 'timeUnits' and 'substanceUnits' attributes were 411 * removed. For compatibility with new versions of SBML, users are 412 * cautioned to avoid these attributes. 413 */ public 414 boolean isSetTimeUnits() { 415 return libsbmlJNI.KineticLaw_isSetTimeUnits(swigCPtr, this); 416 } 417 418 419/** 420 * (SBML Level 2 Version 1 only) Predicate returning <code>true</code> if 421 * this {@link SpeciesReference}'s 'substanceUnits' attribute is set. 422 <p> 423 * @return <code>true</code> if the 'substanceUnits' attribute of this {@link KineticLaw} 424 * object is set, <code>false</code> otherwise. 425 <p> 426 * <p> 427 * @note The attributes 'timeUnits' and 'substanceUnits' are present only 428 * in SBML Level 2 Version 1. In SBML Level 2 429 * Version 2, the 'timeUnits' and 'substanceUnits' attributes were 430 * removed. For compatibility with new versions of SBML, users are 431 * cautioned to avoid these attributes. 432 */ public 433 boolean isSetSubstanceUnits() { 434 return libsbmlJNI.KineticLaw_isSetSubstanceUnits(swigCPtr, this); 435 } 436 437 438/** 439 * Sets the mathematical expression of this {@link KineticLaw} instance to the 440 * given <code>formula</code>. 441 <p> 442 * The given <code>formula</code> string is copied. Internally, libSBML stores the 443 * mathematical expression as an {@link ASTNode}. 444 <p> 445 * @param formula the mathematical expression to use, represented in 446 * text-string form. 447 <p> 448 * <p> 449 * @return integer value indicating success/failure of the 450 * function. The possible values 451 * returned by this function are: 452 * <ul> 453 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 454 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 455 * 456 * </ul> <p> 457 * @note SBML Level 1 uses a text-string format for mathematical formulas. 458SBML Level 2 uses MathML, an XML format for representing mathematical 459expressions. LibSBML provides an Abstract Syntax Tree API for working with 460mathematical expressions; this API is more powerful than working with 461formulas directly in text form, and ASTs can be translated into either 462MathML or the text-string syntax. The libSBML methods that accept 463text-string formulas directly (such as this constructor) are provided for 464SBML Level 1 compatibility, but developers are encouraged to use the 465AST mechanisms. 466 467 <p> 468 * @see #setMath(ASTNode math) 469 */ public 470 int setFormula(String formula) { 471 return libsbmlJNI.KineticLaw_setFormula(swigCPtr, this, formula); 472 } 473 474 475/** 476 * Sets the mathematical expression of this {@link KineticLaw} instance to a copy 477 * of the given {@link ASTNode}. 478 <p> 479 * This is fundamentally identical to 480 * {@link KineticLaw#setFormula(String formula)}. 481 * The latter is provided principally for compatibility compatibility with 482 * SBML Level 1, which represented mathematical formulas in text-string 483 * form. 484 <p> 485 * @param math an {@link ASTNode} representing a formula tree. 486 <p> 487 * <p> 488 * @return integer value indicating success/failure of the 489 * function. The possible values 490 * returned by this function are: 491 * <ul> 492 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 493 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 494 * 495 * </ul> <p> 496 * @see #setFormula(String formula) 497 */ public 498 int setMath(ASTNode math) { 499 return libsbmlJNI.KineticLaw_setMath(swigCPtr, this, ASTNode.getCPtr(math), math); 500 } 501 502 503/** 504 * (SBML Level 2 Version 1 only) Sets the 'timeUnits' attribute 505 * of this {@link KineticLaw} object to a copy of the identifier in <code>sid</code>. 506 <p> 507 * @param sid the identifier of the units to use. 508 <p> 509 * <p> 510 * @return integer value indicating success/failure of the 511 * function. The possible values 512 * returned by this function are: 513 * <ul> 514 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 515 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 516 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 517 * 518 * </ul> <p> 519 * <p> 520 * @note The attributes 'timeUnits' and 'substanceUnits' are present only 521 * in SBML Level 2 Version 1. In SBML Level 2 522 * Version 2, the 'timeUnits' and 'substanceUnits' attributes were 523 * removed. For compatibility with new versions of SBML, users are 524 * cautioned to avoid these attributes. 525 */ public 526 int setTimeUnits(String sid) { 527 return libsbmlJNI.KineticLaw_setTimeUnits(swigCPtr, this, sid); 528 } 529 530 531/** 532 * (SBML Level 2 Version 1 only) Sets the 'substanceUnits' 533 * attribute of this {@link KineticLaw} object to a copy of the identifier given 534 * in <code>sid</code>. 535 <p> 536 * @param sid the identifier of the units to use. 537 <p> 538 * <p> 539 * @return integer value indicating success/failure of the 540 * function. The possible values 541 * returned by this function are: 542 * <ul> 543 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 544 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 545 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 546 * 547 * </ul> <p> 548 * <p> 549 * @note The attributes 'timeUnits' and 'substanceUnits' are present only 550 * in SBML Level 2 Version 1. In SBML Level 2 551 * Version 2, the 'timeUnits' and 'substanceUnits' attributes were 552 * removed. For compatibility with new versions of SBML, users are 553 * cautioned to avoid these attributes. 554 */ public 555 int setSubstanceUnits(String sid) { 556 return libsbmlJNI.KineticLaw_setSubstanceUnits(swigCPtr, this, sid); 557 } 558 559 560/** 561 * (SBML Level 2 Version 1 only) Unsets the 'timeUnits' 562 * attribugte of this {@link KineticLaw} object. 563 <p> 564 * <p> 565 * @return integer value indicating success/failure of the 566 * function. The possible values 567 * returned by this function are: 568 * <ul> 569 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 570 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 571 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 572 * 573 * </ul> <p> 574 * <p> 575 * @note The attributes 'timeUnits' and 'substanceUnits' are present only 576 * in SBML Level 2 Version 1. In SBML Level 2 577 * Version 2, the 'timeUnits' and 'substanceUnits' attributes were 578 * removed. For compatibility with new versions of SBML, users are 579 * cautioned to avoid these attributes. 580 */ public 581 int unsetTimeUnits() { 582 return libsbmlJNI.KineticLaw_unsetTimeUnits(swigCPtr, this); 583 } 584 585 586/** 587 * (SBML Level 2 Version 1 only) Unsets the 'substanceUnits' 588 * attribute of this {@link KineticLaw} object. 589 <p> 590 * <p> 591 * @return integer value indicating success/failure of the 592 * function. The possible values 593 * returned by this function are: 594 * <ul> 595 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 596 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 597 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 598 * 599 * </ul> <p> 600 * <p> 601 * @note The attributes 'timeUnits' and 'substanceUnits' are present only 602 * in SBML Level 2 Version 1. In SBML Level 2 603 * Version 2, the 'timeUnits' and 'substanceUnits' attributes were 604 * removed. For compatibility with new versions of SBML, users are 605 * cautioned to avoid these attributes. 606 */ public 607 int unsetSubstanceUnits() { 608 return libsbmlJNI.KineticLaw_unsetSubstanceUnits(swigCPtr, this); 609 } 610 611 612/** 613 * Adds a copy of the given {@link Parameter} object to the list of local 614 * parameters in this {@link KineticLaw}. 615 * <p> 616 * This function should be used for SBML Level 1 and Level 2 documents, 617 * as the equivalent constructs in Level 3 are {@link LocalParameter} objects instead. 618 <p> 619 * @param p the {@link Parameter} to add. 620 <p> 621 * <p> 622 * @return integer value indicating success/failure of the 623 * function. The possible values 624 * returned by this function are: 625 * <ul> 626 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 627 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 628 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 629 * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID} 630 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 631 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 632 * 633 * </ul> <p> 634 * <p> 635 * @note This method should be used with some caution. The fact that this 636 * method <em>copies</em> the object passed to it means that the caller will be 637 * left holding a physically different object instance than the one contained 638 * inside this object. Changes made to the original object instance (such as 639 * resetting attribute values) will <em>not affect the instance in this 640 * object</em>. In addition, the caller should make sure to free the 641 * original object if it is no longer being used, or else a memory leak will 642 * result. Please see other methods on this class (particularly a 643 * corresponding method whose name begins with the word <code>create</code>) 644 * for alternatives that do not lead to these issues. 645 <p> 646 * @see #createParameter() 647 */ public 648 int addParameter(Parameter p) { 649 return libsbmlJNI.KineticLaw_addParameter(swigCPtr, this, Parameter.getCPtr(p), p); 650 } 651 652 653/** 654 * Adds a copy of the given {@link LocalParameter} object to the list of local 655 * parameters in this {@link KineticLaw}. 656 * <p> 657 * This function should be used for SBML Level 3 documents, as the equivalent 658 * constructs in Level 2 and Level 1 are {@link Parameter} objects instead. 659 <p> 660 * @param p the {@link LocalParameter} to add. 661 <p> 662 * <p> 663 * @return integer value indicating success/failure of the 664 * function. The possible values 665 * returned by this function are: 666 * <ul> 667 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 668 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 669 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 670 * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID} 671 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 672 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 673 * 674 * </ul> <p> 675 * <p> 676 * @note This method should be used with some caution. The fact that this 677 * method <em>copies</em> the object passed to it means that the caller will be 678 * left holding a physically different object instance than the one contained 679 * inside this object. Changes made to the original object instance (such as 680 * resetting attribute values) will <em>not affect the instance in this 681 * object</em>. In addition, the caller should make sure to free the 682 * original object if it is no longer being used, or else a memory leak will 683 * result. Please see other methods on this class (particularly a 684 * corresponding method whose name begins with the word <code>create</code>) 685 * for alternatives that do not lead to these issues. 686 <p> 687 * @see #createLocalParameter() 688 */ public 689 int addLocalParameter(LocalParameter p) { 690 return libsbmlJNI.KineticLaw_addLocalParameter(swigCPtr, this, LocalParameter.getCPtr(p), p); 691 } 692 693 694/** 695 * Creates a new {@link Parameter} object, adds it to this {@link KineticLaw}'s list of 696 * parameters, and returns the {@link Parameter} object created. 697 * <p> 698 * This function should be used for SBML Level 1 and Level 2 documents, 699 * as the equivalent constructs in Level 3 are {@link LocalParameter} objects instead. 700 <p> 701 * @return a new {@link Parameter} object instance. 702 <p> 703 * @see #addParameter(Parameter p) 704 */ public 705 Parameter createParameter() { 706 long cPtr = libsbmlJNI.KineticLaw_createParameter(swigCPtr, this); 707 return (cPtr == 0) ? null : new Parameter(cPtr, false); 708 } 709 710 711/** 712 * Creates a new {@link LocalParameter} object, adds it to this {@link KineticLaw}'s list 713 * of local parameters, and returns the {@link LocalParameter} object created. 714 * <p> 715 * This function should be used for SBML Level 3 documents, as the equivalent 716 * constructs in Level 2 and Level 1 are {@link Parameter} objects instead. 717 <p> 718 * @return a new {@link LocalParameter} object instance. 719 <p> 720 * @see #addLocalParameter(LocalParameter p) 721 */ public 722 LocalParameter createLocalParameter() { 723 long cPtr = libsbmlJNI.KineticLaw_createLocalParameter(swigCPtr, this); 724 return (cPtr == 0) ? null : new LocalParameter(cPtr, false); 725 } 726 727 728/** 729 * Returns the list of parameters in this {@link KineticLaw} object. 730 * <p> 731 * This function should be used for SBML Level 1 and Level 2 documents, 732 * as the equivalent constructs in Level 3 are {@link LocalParameter} objects instead. 733 <p> 734 * @return the list of Parameters for this {@link KineticLaw}. 735 */ public 736 ListOfParameters getListOfParameters() { 737 long cPtr = libsbmlJNI.KineticLaw_getListOfParameters__SWIG_0(swigCPtr, this); 738 return (cPtr == 0) ? null : new ListOfParameters(cPtr, false); 739 } 740 741 742/** 743 * Returns the list of local parameters in this {@link KineticLaw} object. 744 * <p> 745 * This function should be used for SBML Level 3 documents, as the equivalent 746 * constructs in Level 2 and Level 1 are {@link Parameter} objects instead. 747 <p> 748 * @return the list of LocalParameters for this {@link KineticLaw}. 749 */ public 750 ListOfLocalParameters getListOfLocalParameters() { 751 long cPtr = libsbmlJNI.KineticLaw_getListOfLocalParameters__SWIG_0(swigCPtr, this); 752 return (cPtr == 0) ? null : new ListOfLocalParameters(cPtr, false); 753 } 754 755 756/** 757 * Returns the nth {@link Parameter} object in the list of parameters in 758 * this {@link KineticLaw} instance. 759 * <p> 760 * This function should be used for SBML Level 1 and Level 2 documents, 761 * as the equivalent constructs in Level 3 are {@link LocalParameter} objects instead. 762 <p> 763 * @param n the index of the {@link Parameter} object sought. 764 <p> 765 * @return the nth {@link Parameter} of this {@link KineticLaw}. 766 */ public 767 Parameter getParameter(long n) { 768 long cPtr = libsbmlJNI.KineticLaw_getParameter__SWIG_0(swigCPtr, this, n); 769 return (cPtr == 0) ? null : new Parameter(cPtr, false); 770 } 771 772 773/** 774 * Returns the nth {@link LocalParameter} object in the list of local parameters in 775 * this {@link KineticLaw} instance. 776 * <p> 777 * This function should be used for SBML Level 3 documents, as the equivalent 778 * constructs in Level 2 and Level 1 are {@link Parameter} objects instead. 779 <p> 780 * @param n the index of the {@link LocalParameter} object sought. 781 <p> 782 * @return the nth {@link LocalParameter} of this {@link KineticLaw}. 783 */ public 784 LocalParameter getLocalParameter(long n) { 785 long cPtr = libsbmlJNI.KineticLaw_getLocalParameter__SWIG_0(swigCPtr, this, n); 786 return (cPtr == 0) ? null : new LocalParameter(cPtr, false); 787 } 788 789 790/** 791 * Returns a parameter based on its identifier. 792 * <p> 793 * This function should be used for SBML Level 1 and Level 2 documents, 794 * as the equivalent constructs in Level 3 are {@link LocalParameter} objects instead. 795 <p> 796 * @param sid the identifier of the {@link Parameter} being sought. 797 <p> 798 * @return the {@link Parameter} object in this {@link KineticLaw} instace having the 799 * given 'id', or <code>null</code> if no such {@link Parameter} exists. 800 */ public 801 Parameter getParameter(String sid) { 802 long cPtr = libsbmlJNI.KineticLaw_getParameter__SWIG_2(swigCPtr, this, sid); 803 return (cPtr == 0) ? null : new Parameter(cPtr, false); 804 } 805 806 807/** 808 * Returns a local parameter based on its identifier. 809 * <p> 810 * This function should be used for SBML Level 3 documents, as the equivalent 811 * constructs in Level 2 and Level 1 are {@link Parameter} objects instead. 812 <p> 813 * @param sid the identifier of the {@link LocalParameter} being sought. 814 <p> 815 * @return the {@link LocalParameter} object in this {@link KineticLaw} instace having the 816 * given 'id', or <code>null</code> if no such {@link LocalParameter} exists. 817 */ public 818 LocalParameter getLocalParameter(String sid) { 819 long cPtr = libsbmlJNI.KineticLaw_getLocalParameter__SWIG_2(swigCPtr, this, sid); 820 return (cPtr == 0) ? null : new LocalParameter(cPtr, false); 821 } 822 823 824/** 825 * Returns the number of parameters in this {@link KineticLaw} instance. 826 * <p> 827 * This function should be used for SBML Level 1 and Level 2 documents, 828 * as the equivalent constructs in Level 3 are {@link LocalParameter} objects instead. 829 <p> 830 * @return the number of Parameters in this {@link KineticLaw}. 831 */ public 832 long getNumParameters() { 833 return libsbmlJNI.KineticLaw_getNumParameters(swigCPtr, this); 834 } 835 836 837/** 838 * Returns the number of local parameters in this {@link KineticLaw} instance. 839 * <p> 840 * This function should be used for SBML Level 3 documents, as the equivalent 841 * constructs in Level 2 and Level 1 are {@link Parameter} objects instead. 842 <p> 843 * @return the number of LocalParameters in this {@link KineticLaw}. 844 */ public 845 long getNumLocalParameters() { 846 return libsbmlJNI.KineticLaw_getNumLocalParameters(swigCPtr, this); 847 } 848 849 850/** 851 * Calculates and returns a {@link UnitDefinition} that expresses the units of 852 * measurement assumed for the 'math' expression of this {@link KineticLaw}. 853 <p> 854 * <p> 855 * The units are calculated based on the mathematical expression in the 856 * {@link KineticLaw} and the model quantities referenced by <code><ci></code> 857 * elements used within that expression. The 858 * {@link KineticLaw#getDerivedUnitDefinition()} 859 * method returns the calculated units. 860 <p> 861 * <p> 862 * @note The functionality that facilitates unit analysis depends on the 863 * model as a whole. Thus, in cases where the object has not been added to 864 * a model or the model itself is incomplete, unit analysis is not possible 865 * and this method will return <code>null.</code> 866 <p> 867 * <p> 868 * @warning <span class='warning'>Note that it is possible the 'math' 869 * expression in the {@link KineticLaw} contains pure numbers or parameters with 870 * undeclared units. In those cases, it is not possible to calculate the 871 * units of the overall expression without making assumptions. LibSBML does 872 * not make assumptions about the units, and 873 * {@link KineticLaw#getDerivedUnitDefinition()} returns the units as far as it is 874 * able to determine them. For example, in an expression <em>X + Y</em>, if 875 * <em>X</em> has unambiguously-defined units and <em>Y</em> does not, it 876 * will return the units of <em>X</em>. <strong>It is important that callers 877 * also invoke the method</strong> 878 * {@link KineticLaw#containsUndeclaredUnits()}<strong>to determine whether this 879 * situation holds</strong>. Callers may wish to take suitable actions in 880 * those scenarios.</span> 881 <p> 882 * @return a {@link UnitDefinition} that expresses the units of the math 883 * expression of this {@link KineticLaw}, or <code>null</code> if one cannot be constructed. 884 <p> 885 * @see #containsUndeclaredUnits() 886 */ public 887 UnitDefinition getDerivedUnitDefinition() { 888 long cPtr = libsbmlJNI.KineticLaw_getDerivedUnitDefinition__SWIG_0(swigCPtr, this); 889 return (cPtr == 0) ? null : new UnitDefinition(cPtr, false); 890 } 891 892 893/** 894 * Predicate returning <code>true</code> if the math expression of this {@link KineticLaw} 895 * contains parameters/numbers with undeclared units. 896 <p> 897 * @return <code>true</code> if the math expression of this {@link KineticLaw} 898 * includes parameters/numbers 899 * with undeclared units, <code>false</code> otherwise. 900 <p> 901 * @note A return value of <code>true</code> indicates that the {@link UnitDefinition} 902 * returned by 903 * {@link KineticLaw#getDerivedUnitDefinition()} 904 * may not accurately represent the units of the expression. 905 <p> 906 * @see #getDerivedUnitDefinition() 907 */ public 908 boolean containsUndeclaredUnits() { 909 return libsbmlJNI.KineticLaw_containsUndeclaredUnits__SWIG_0(swigCPtr, this); 910 } 911 912 913/** 914 * Removes the nth {@link Parameter} object in the list of parameters 915 * in this {@link KineticLaw} instance and returns a pointer to it. 916 * <p> 917 * This function should be used for SBML Level 1 and Level 2 documents, 918 * as the equivalent constructs in Level 3 are {@link LocalParameter} objects instead. 919 <p> 920 * The caller owns the returned object and is responsible for deleting it. 921 <p> 922 * @param n the index of the {@link Parameter} object to remove. 923 <p> 924 * @return the {@link Parameter} object removed. As mentioned above, 925 * the caller owns the returned item. <code>null</code> is returned if the given index 926 * is out of range. 927 */ public 928 Parameter removeParameter(long n) { 929 long cPtr = libsbmlJNI.KineticLaw_removeParameter__SWIG_0(swigCPtr, this, n); 930 return (cPtr == 0) ? null : new Parameter(cPtr, true); 931 } 932 933 934/** 935 * Removes the nth {@link LocalParameter} object in the list of local parameters 936 * in this {@link KineticLaw} instance and returns a pointer to it. 937 * <p> 938 * This function should be used for SBML Level 3 documents, as the equivalent 939 * constructs in Level 2 and Level 1 are {@link Parameter} objects instead. 940 <p> 941 * The caller owns the returned object and is responsible for deleting it. 942 <p> 943 * @param n the index of the {@link LocalParameter} object to remove. 944 <p> 945 * @return the {@link LocalParameter} object removed. As mentioned above, 946 * the caller owns the returned item. <code>null</code> is returned if the given index 947 * is out of range. 948 */ public 949 LocalParameter removeLocalParameter(long n) { 950 long cPtr = libsbmlJNI.KineticLaw_removeLocalParameter__SWIG_0(swigCPtr, this, n); 951 return (cPtr == 0) ? null : new LocalParameter(cPtr, true); 952 } 953 954 955/** 956 * Removes a {@link Parameter} object with the given identifier in the list of 957 * parameters in this {@link KineticLaw} instance and returns a pointer to it. 958 * <p> 959 * This function should be used for SBML Level 1 and Level 2 documents, 960 * as the equivalent constructs in Level 3 are {@link LocalParameter} objects instead. 961 <p> 962 * The caller owns the returned object and is responsible for deleting it. 963 <p> 964 * @param sid the identifier of the {@link Parameter} to remove. 965 <p> 966 * @return the {@link Parameter} object removed. As mentioned above, the 967 * caller owns the returned object. <code>null</code> is returned if no {@link Parameter} 968 * object with the identifier exists in this {@link KineticLaw} instance. 969 */ public 970 Parameter removeParameter(String sid) { 971 long cPtr = libsbmlJNI.KineticLaw_removeParameter__SWIG_1(swigCPtr, this, sid); 972 return (cPtr == 0) ? null : new Parameter(cPtr, true); 973 } 974 975 976/** 977 * Removes a {@link LocalParameter} object with the given identifier in the list of 978 * local parameters in this {@link KineticLaw} instance and returns a pointer to it. 979 * <p> 980 * This function should be used for SBML Level 3 documents, as the equivalent 981 * constructs in Level 2 and Level 1 are {@link Parameter} objects instead. 982 <p> 983 * The caller owns the returned object and is responsible for deleting it. 984 <p> 985 * @param sid the identifier of the {@link LocalParameter} to remove. 986 <p> 987 * @return the {@link LocalParameter} object removed. As mentioned above, the 988 * caller owns the returned object. <code>null</code> is returned if no {@link LocalParameter} 989 * object with the identifier exists in this {@link KineticLaw} instance. 990 */ public 991 LocalParameter removeLocalParameter(String sid) { 992 long cPtr = libsbmlJNI.KineticLaw_removeLocalParameter__SWIG_1(swigCPtr, this, sid); 993 return (cPtr == 0) ? null : new LocalParameter(cPtr, true); 994 } 995 996 public void connectToChild() { 997 libsbmlJNI.KineticLaw_connectToChild(swigCPtr, this); 998 } 999 1000 1001/** * @internal */ public 1002 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 1003 libsbmlJNI.KineticLaw_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 1004 } 1005 1006 1007/** 1008 * Returns the libSBML type code for this SBML object. 1009 <p> 1010 * <p> 1011 * LibSBML attaches an identifying code to every kind of SBML object. These 1012 * are integer constants known as <em>SBML type codes</em>. The names of all 1013 * the codes begin with the characters <code>SBML_</code>. 1014 * In the Java language interface for libSBML, the 1015 * type codes are defined as static integer constants in the interface class 1016 * {@link libsbmlConstants}. Note that different Level 3 1017 * package plug-ins may use overlapping type codes; to identify the package 1018 * to which a given object belongs, call the 1019 * <code>{@link SBase#getPackageName()} 1020 * </code> 1021 * method on the object. 1022 <p> 1023 * @return the SBML type code for this object: 1024 * {@link libsbmlConstants#SBML_KINETIC_LAW SBML_KINETIC_LAW} (default). 1025 <p> 1026 * <p> 1027 * @warning <span class='warning'>The specific integer values of the possible 1028 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 1029 * packages, To fully identify the correct code, <strong>it is necessary to 1030 * invoke both getTypeCode() and getPackageName()</strong>.</span> 1031 <p> 1032 * @see #getElementName() 1033 * @see #getPackageName() 1034 */ public 1035 int getTypeCode() { 1036 return libsbmlJNI.KineticLaw_getTypeCode(swigCPtr, this); 1037 } 1038 1039 1040/** 1041 * Returns the XML element name of this object, which for {@link Species}, is 1042 * always <code>'kineticLaw'.</code> 1043 <p> 1044 * @return the name of this element, i.e., <code>'kineticLaw'.</code> 1045 */ public 1046 String getElementName() { 1047 return libsbmlJNI.KineticLaw_getElementName(swigCPtr, this); 1048 } 1049 1050 1051/** 1052 * Predicate returning <code>true</code> if all the required attributes for this 1053 * {@link KineticLaw} object have been set. 1054 <p> 1055 * The required attributes for a {@link KineticLaw} object are: 1056 * <ul> 1057 * <li> 'formula' (SBML Level 1 only) 1058 * 1059 * </ul> <p> 1060 * @return <code>true</code> if the required attributes have been set, <code>false</code> 1061 * otherwise. 1062 */ public 1063 boolean hasRequiredAttributes() { 1064 return libsbmlJNI.KineticLaw_hasRequiredAttributes(swigCPtr, this); 1065 } 1066 1067 1068/** 1069 * Predicate returning <code>true</code> if all the required elements for this 1070 * {@link KineticLaw} object have been set. 1071 <p> 1072 * @note The required elements for a {@link KineticLaw} object are: 1073 * <ul> 1074 * <li> 'math' inSBML Level 2 and Level 3 Version 1. 1075 * (In SBML Level 3 Version 2+, it is no longer required.) 1076 * 1077 * </ul> <p> 1078 * @return a boolean value indicating whether all the required 1079 * elements for this object have been defined. 1080 */ public 1081 boolean hasRequiredElements() { 1082 return libsbmlJNI.KineticLaw_hasRequiredElements(swigCPtr, this); 1083 } 1084 1085 1086/** 1087 * Finds this {@link KineticLaw}'s {@link Reaction} parent and calls unsetKineticLaw() on 1088 * it, indirectly deleting itself. 1089 <p> 1090 * Overridden from the {@link SBase} function since the parent is not a {@link ListOf}. 1091 <p> 1092 * <p> 1093 * @return integer value indicating success/failure of the 1094 * function. The possible values 1095 * returned by this function are: 1096 * <ul> 1097 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1098 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1099 * </ul> 1100 */ public 1101 int removeFromParentAndDelete() { 1102 return libsbmlJNI.KineticLaw_removeFromParentAndDelete(swigCPtr, this); 1103 } 1104 1105 1106/** 1107 * <p> 1108 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 1109 * value. 1110 <p> 1111 * <p> 1112 * In SBML, object identifiers are of a data type called <code>SId</code>. 1113 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 1114 * introduced for attribute values that refer to <code>SId</code> values; in 1115 * previous Levels of SBML, this data type did not exist and attributes were 1116 * simply described to as 'referring to an identifier', but the effective 1117 * data type was the same as <code>SIdRef</code> in Level 3. These and 1118 * other methods of libSBML refer to the type <code>SIdRef</code> for all 1119 * Levels of SBML, even if the corresponding SBML specification did not 1120 * explicitly name the data type. 1121 <p> 1122 * This method works by looking at all attributes and (if appropriate) 1123 * mathematical formulas in MathML content, comparing the referenced 1124 * identifiers to the value of <code>oldid</code>. If any matches are found, the 1125 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 1126 * descend into child elements. 1127 <p> 1128 * @param oldid the old identifier. 1129 * @param newid the new identifier. 1130 */ public 1131 void renameSIdRefs(String oldid, String newid) { 1132 libsbmlJNI.KineticLaw_renameSIdRefs(swigCPtr, this, oldid, newid); 1133 } 1134 1135 1136/** 1137 * <p> 1138 * Replaces all uses of a given <code>UnitSIdRef</code> type attribute value with 1139 * another value. 1140 <p> 1141 * <p> 1142 * In SBML, unit definitions have identifiers of type <code>UnitSId</code>. In 1143 * SBML Level 3, an explicit data type called <code>UnitSIdRef</code> was 1144 * introduced for attribute values that refer to <code>UnitSId</code> values; in 1145 * previous Levels of SBML, this data type did not exist and attributes were 1146 * simply described to as 'referring to a unit identifier', but the effective 1147 * data type was the same as <code>UnitSIdRef</code> in Level 3. These and 1148 * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all 1149 * Levels of SBML, even if the corresponding SBML specification did not 1150 * explicitly name the data type. 1151 <p> 1152 * This method works by looking at all unit identifier attribute values 1153 * (including, if appropriate, inside mathematical formulas), comparing the 1154 * referenced unit identifiers to the value of <code>oldid</code>. If any matches 1155 * are found, the matching values are replaced with <code>newid</code>. The method 1156 * does <em>not</em> descend into child elements. 1157 <p> 1158 * @param oldid the old identifier. 1159 * @param newid the new identifier. 1160 */ public 1161 void renameUnitSIdRefs(String oldid, String newid) { 1162 libsbmlJNI.KineticLaw_renameUnitSIdRefs(swigCPtr, this, oldid, newid); 1163 } 1164 1165 1166/** * @internal */ public 1167 void replaceSIDWithFunction(String id, ASTNode function) { 1168 libsbmlJNI.KineticLaw_replaceSIDWithFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 1169 } 1170 1171 1172/** * @internal */ public 1173 void divideAssignmentsToSIdByFunction(String id, ASTNode function) { 1174 libsbmlJNI.KineticLaw_divideAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 1175 } 1176 1177 1178/** * @internal */ public 1179 void multiplyAssignmentsToSIdByFunction(String id, ASTNode function) { 1180 libsbmlJNI.KineticLaw_multiplyAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 1181 } 1182 1183}