001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.10 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * An SBML <em>initial assignment</em>, evaluated once only. 013 <p> 014 * SBML Level 2 Versions 2–4 and SBML Level 3 provide two ways of assigning initial 015 * values to entities in a model. The simplest and most basic is to set 016 * the values of the appropriate attributes in the relevant components; for 017 * example, the initial value of a model parameter (whether it is a 018 * constant or a variable) can be assigned by setting its 'value' attribute 019 * directly in the model definition. However, this approach is not 020 * suitable when the value must be calculated, because the initial value 021 * attributes on different components such as species, compartments, and 022 * parameters are single values and not mathematical expressions. In those 023 * situations, the {@link InitialAssignment} construct can be used; it permits the 024 * calculation of the value of a constant or the initial value of a 025 * variable from the values of <em>other</em> quantities in a model. 026 <p> 027 * As explained below, the provision of {@link InitialAssignment} does not mean 028 * that models necessarily must use this construct when defining initial 029 * values of quantities in a model. If a value can be set directly using 030 * the relevant attribute of a component in a model, then that 031 * approach may be more efficient and more portable to other software 032 * tools. {@link InitialAssignment} should be used when the other mechanism is 033 * insufficient for the needs of a particular model. 034 <p> 035 * The {@link InitialAssignment} construct has some similarities to {@link AssignmentRule}. 036 * The main differences are: (a) an {@link InitialAssignment} can set the value of 037 * a constant whereas an {@link AssignmentRule} cannot, and (b) unlike 038 * {@link AssignmentRule}, an {@link InitialAssignment} definition only applies up to and 039 * including the beginning of simulation time, i.e., <em>t ≤ 0</em>, 040 * while an {@link AssignmentRule} applies at all times. 041 <p> 042 * {@link InitialAssignment} has a required attribute, 'symbol', whose value must 043 * follow the guidelines for identifiers described in the SBML 044 * specification (e.g., Section 3.3 in the Level 2 Version 4 045 * specification). The value of this attribute in an {@link InitialAssignment} 046 * object can be the identifier of a {@link Compartment}, {@link Species} or global 047 * {@link Parameter} elsewhere in the model. The {@link InitialAssignment} defines the 048 * initial value of the constant or variable referred to by the 'symbol' 049 * attribute. (The attribute's name is 'symbol' rather than 'variable' 050 * because it may assign values to constants as well as variables in a 051 * model.) Note that an initial assignment cannot be made to reaction 052 * identifiers, that is, the 'symbol' attribute value of an 053 * {@link InitialAssignment} cannot be an identifier that is the 'id' attribute 054 * value of a {@link Reaction} object in the model. This is identical to a 055 * restriction placed on rules. 056 <p> 057 * {@link InitialAssignment} also has a required 'math' subelement that contains a 058 * MathML expression used to calculate the value of the constant or the 059 * initial value of the variable. The units of the value computed by the 060 * formula in the 'math' subelement should (in SBML Level 2 061 * Version 4 and in SBML Level 3) or must (in previous Versions) be identical to be the 062 * units associated with the identifier given in the 'symbol' attribute. 063 * (That is, the units are the units of the species, compartment, or 064 * parameter, as appropriate for the kind of object identified by the value 065 * of 'symbol'.) 066 <p> 067 * {@link InitialAssignment} was introduced in SBML Level 2 Version 2. It is not 068 * available in SBML Level 2 Version 1 nor in any version of Level 1. 069 <p> 070 * <h2>Semantics of Initial Assignments</h2> 071 <p> 072 * The value calculated by an {@link InitialAssignment} object overrides the value 073 * assigned to the given symbol by the object defining that symbol. For 074 * example, if a compartment's 'size' attribute is set in its definition, 075 * and the model also contains an {@link InitialAssignment} having that 076 * compartment's identifier as its 'symbol' attribute value, then the 077 * interpretation is that the 'size' assigned in the {@link Compartment} object 078 * should be ignored and the value assigned based on the computation 079 * defined in the {@link InitialAssignment}. Initial assignments can take place 080 * for {@link Compartment}, {@link Species} and global {@link Parameter} objects regardless of the 081 * value of their 'constant' attribute. 082 <p> 083 * The actions of all {@link InitialAssignment} objects are in general terms 084 * the same, but differ in the precise details depending on the type 085 * of variable being set: 086 * <ul> 087 * <li> <em>In the case of a species</em>, an {@link InitialAssignment} sets the 088 * referenced species' initial quantity (concentration or amount of 089 * substance) to the value determined by the formula in the 'math' 090 * subelement. The overall units of the formula should (in SBML 091 * Level 2 Version 4 and in SBML Level 3) or must (in previous Versions) be the same 092 * as the units specified for the species. 093 <p> 094 * <li> <em>In the case of a compartment</em>, an {@link InitialAssignment} sets 095 * the referenced compartment's initial size to the size determined by the 096 * formula in 'math'. The overall units of the formula should (in SBML 097 * Level 2 Version 4 and in SBML Level 3) or must (in previous Versions) be the same 098 * as the units specified for the size of the compartment. 099 <p> 100 * <li> <em>In the case of a parameter</em>, an {@link InitialAssignment} sets the 101 * referenced parameter's initial value to that determined by the formula 102 * in 'math'. The overall units of the formula should (in SBML 103 * Level 2 Version 4 and SBML Level 3) or must (in previous Versions) be the same 104 * as the units defined for the parameter. </ul> 105 <p> 106 * In the context of a simulation, initial assignments establish values 107 * that are in effect prior to and including the start of simulation time, 108 * i.e., <em>t ≤ 0</em>. Section 3.4.8 in the SBML Level 2 109 * Version 4 and SBML Level 3 Version 1 Core specifications provides information about the interpretation of 110 * assignments, rules, and entity values for simulation time up to and 111 * including the start time <em>t = 0</em>; this is important for 112 * establishing the initial conditions of a simulation if the model 113 * involves expressions containing the <em>delay</em> 'csymbol'. 114 <p> 115 * There cannot be two initial assignments for the same symbol in a model; 116 * that is, a model must not contain two or more {@link InitialAssignment} objects 117 * that both have the same identifier as their 'symbol' attribute value. A 118 * model must also not define initial assignments <em>and</em> assignment 119 * rules for the same entity. That is, there cannot be <em>both</em> an 120 * {@link InitialAssignment} and an {@link AssignmentRule} for the same symbol in a model, 121 * because both kinds of constructs apply prior to and at the start of 122 * simulated time—allowing both to exist for a given symbol would 123 * result in indeterminism). 124 <p> 125 * The ordering of {@link InitialAssignment} objects is not significant. The 126 * combined set of {@link InitialAssignment}, {@link AssignmentRule} and {@link KineticLaw} 127 * objects form a set of assignment statements that must be considered as a 128 * whole. The combined set of assignment statements should not contain 129 * algebraic loops: a chain of dependency between these statements should 130 * terminate. (More formally, consider the directed graph of assignment 131 * statements where nodes are a model's assignment statements and directed 132 * arcs exist for each occurrence of a symbol in an assignment statement 133 * 'math' attribute. The directed arcs in this graph start from the 134 * statement assigning the symbol and end at the statement that contains 135 * the symbol in their math elements. Such a graph must be acyclic.) 136 <p> 137 * Finally, it is worth being explicit about the expected behavior in the 138 * following situation. Suppose (1) a given symbol has a value <em>x</em> 139 * assigned to it in its definition, and (2) there is an initial assignment 140 * having the identifier as its 'symbol' value and reassigning the value to 141 * <em>y</em>, <em>and</em> (3) the identifier is also used in the 142 * mathematical formula of a second initial assignment. What value should 143 * the second initial assignment use? It is <em>y</em>, the value assigned 144 * to the symbol by the first initial assignment, not whatever value was 145 * given in the symbol's definition. This follows directly from the 146 * behavior described above: if an {@link InitialAssignment} object exists for a 147 * given symbol, then the symbol's value is overridden by that initial 148 * assignment. 149 */ 150 151public class InitialAssignment extends SBase { 152 private long swigCPtr; 153 154 protected InitialAssignment(long cPtr, boolean cMemoryOwn) 155 { 156 super(libsbmlJNI.InitialAssignment_SWIGUpcast(cPtr), cMemoryOwn); 157 swigCPtr = cPtr; 158 } 159 160 protected static long getCPtr(InitialAssignment obj) 161 { 162 return (obj == null) ? 0 : obj.swigCPtr; 163 } 164 165 protected static long getCPtrAndDisown (InitialAssignment obj) 166 { 167 long ptr = 0; 168 169 if (obj != null) 170 { 171 ptr = obj.swigCPtr; 172 obj.swigCMemOwn = false; 173 } 174 175 return ptr; 176 } 177 178 protected void finalize() { 179 delete(); 180 } 181 182 public synchronized void delete() { 183 if (swigCPtr != 0) { 184 if (swigCMemOwn) { 185 swigCMemOwn = false; 186 libsbmlJNI.delete_InitialAssignment(swigCPtr); 187 } 188 swigCPtr = 0; 189 } 190 super.delete(); 191 } 192 193 194/** 195 * Creates a new {@link InitialAssignment} using the given SBML <code>level</code> and <code>version</code> 196 * values. 197 <p> 198 * @param level a long integer, the SBML Level to assign to this {@link InitialAssignment} 199 <p> 200 * @param version a long integer, the SBML Version to assign to this 201 * {@link InitialAssignment} 202 <p> 203 * <p> 204 * @throws SBMLConstructorException 205 * Thrown if the given <code>level</code> and <code>version</code> combination are invalid 206 * or if this object is incompatible with the given level and version. 207 <p> 208 * <p> 209 * @note Attempting to add an object to an {@link SBMLDocument} having a different 210 * combination of SBML Level, Version and XML namespaces than the object 211 * itself will result in an error at the time a caller attempts to make the 212 * addition. A parent object must have compatible Level, Version and XML 213 * namespaces. (Strictly speaking, a parent may also have more XML 214 * namespaces than a child, but the reverse is not permitted.) The 215 * restriction is necessary to ensure that an SBML model has a consistent 216 * overall structure. This requires callers to manage their objects 217 * carefully, but the benefit is increased flexibility in how models can be 218 * created by permitting callers to create objects bottom-up if desired. In 219 * situations where objects are not yet attached to parents (e.g., 220 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 221 * libSBML determine such things as whether it is valid to assign a 222 * particular value to an attribute. 223 */ public 224 InitialAssignment(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 225 this(libsbmlJNI.new_InitialAssignment__SWIG_0(level, version), true); 226 } 227 228 229/** 230 * Creates a new {@link InitialAssignment} using the given {@link SBMLNamespaces} object 231 * <code>sbmlns</code>. 232 <p> 233 * <p> 234 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 235 * information. It is used to communicate the SBML Level, Version, and (in 236 * Level 3) packages used in addition to SBML Level 3 Core. A 237 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 238 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object 239 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 240 <p> 241 * @param sbmlns an {@link SBMLNamespaces} object. 242 <p> 243 * <p> 244 * @throws SBMLConstructorException 245 * Thrown if the given <code>sbmlns</code> is inconsistent or incompatible 246 * with this object. 247 <p> 248 * <p> 249 * @note Attempting to add an object to an {@link SBMLDocument} having a different 250 * combination of SBML Level, Version and XML namespaces than the object 251 * itself will result in an error at the time a caller attempts to make the 252 * addition. A parent object must have compatible Level, Version and XML 253 * namespaces. (Strictly speaking, a parent may also have more XML 254 * namespaces than a child, but the reverse is not permitted.) The 255 * restriction is necessary to ensure that an SBML model has a consistent 256 * overall structure. This requires callers to manage their objects 257 * carefully, but the benefit is increased flexibility in how models can be 258 * created by permitting callers to create objects bottom-up if desired. In 259 * situations where objects are not yet attached to parents (e.g., 260 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 261 * libSBML determine such things as whether it is valid to assign a 262 * particular value to an attribute. 263 */ public 264 InitialAssignment(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 265 this(libsbmlJNI.new_InitialAssignment__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 266 } 267 268 269/** 270 * Copy constructor; creates a copy of this {@link InitialAssignment}. 271 <p> 272 * @param orig the object to copy. 273 */ public 274 InitialAssignment(InitialAssignment orig) throws org.sbml.libsbml.SBMLConstructorException { 275 this(libsbmlJNI.new_InitialAssignment__SWIG_2(InitialAssignment.getCPtr(orig), orig), true); 276 } 277 278 279/** 280 * Creates and returns a deep copy of this {@link InitialAssignment} object. 281 <p> 282 * @return the (deep) copy of this {@link InitialAssignment} object. 283 */ public 284 InitialAssignment cloneObject() { 285 long cPtr = libsbmlJNI.InitialAssignment_cloneObject(swigCPtr, this); 286 return (cPtr == 0) ? null : new InitialAssignment(cPtr, true); 287 } 288 289 290/** 291 * Get the value of the 'symbol' attribute of this {@link InitialAssignment}. 292 <p> 293 * @return the identifier string stored as the 'symbol' attribute value 294 * in this {@link InitialAssignment}. 295 */ public 296 String getSymbol() { 297 return libsbmlJNI.InitialAssignment_getSymbol(swigCPtr, this); 298 } 299 300 301/** 302 * Get the mathematical formula of this {@link InitialAssignment}. 303 <p> 304 * @return an {@link ASTNode}, the value of the 'math' subelement of this 305 * {@link InitialAssignment} 306 */ public 307 ASTNode getMath() { 308 long cPtr = libsbmlJNI.InitialAssignment_getMath(swigCPtr, this); 309 return (cPtr == 0) ? null : new ASTNode(cPtr, false); 310 } 311 312 313/** 314 * Predicate returning <code>true</code> if this 315 * {@link InitialAssignment}'s 'symbol' attribute is set. 316 <p> 317 * @return <code>true</code> if the 'symbol' attribute of this {@link InitialAssignment} 318 * is set, <code>false</code> otherwise. 319 */ public 320 boolean isSetSymbol() { 321 return libsbmlJNI.InitialAssignment_isSetSymbol(swigCPtr, this); 322 } 323 324 325/** 326 * Predicate returning <code>true</code> if this 327 * {@link InitialAssignment}'s 'math' subelement contains a value. 328 <p> 329 * @return <code>true</code> if the 'math' for this {@link InitialAssignment} is set, 330 * <code>false</code> otherwise. 331 */ public 332 boolean isSetMath() { 333 return libsbmlJNI.InitialAssignment_isSetMath(swigCPtr, this); 334 } 335 336 337/** 338 * Sets the 'symbol' attribute value of this {@link InitialAssignment}. 339 <p> 340 * @param sid the identifier of a {@link Species}, {@link Compartment} or {@link Parameter} 341 * object defined elsewhere in this {@link Model}. 342 <p> 343 * <p> 344 * @return integer value indicating success/failure of the 345 * function. The possible values 346 * returned by this function are: 347 * <ul> 348 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 349 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 350 * </ul> 351 */ public 352 int setSymbol(String sid) { 353 return libsbmlJNI.InitialAssignment_setSymbol(swigCPtr, this, sid); 354 } 355 356 357/** 358 * Unsets the 'symbol' attribute value of this {@link InitialAssignment}. 359 <p> 360 * <p> 361 * @return integer value indicating success/failure of the 362 * function. The possible values 363 * returned by this function are: 364 * <ul> 365 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 366 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 367 * </ul> 368 */ public 369 int unsetSymbol() { 370 return libsbmlJNI.InitialAssignment_unsetSymbol(swigCPtr, this); 371 } 372 373 374/** 375 * Sets the 'math' subelement of this {@link InitialAssignment}. 376 <p> 377 * The AST passed in <code>math</code> is copied. 378 <p> 379 * @param math an AST containing the mathematical expression to 380 * be used as the formula for this {@link InitialAssignment}. 381 <p> 382 * <p> 383 * @return integer value indicating success/failure of the 384 * function. The possible values 385 * returned by this function are: 386 * <ul> 387 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 388 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 389 * </ul> 390 */ public 391 int setMath(ASTNode math) { 392 return libsbmlJNI.InitialAssignment_setMath(swigCPtr, this, ASTNode.getCPtr(math), math); 393 } 394 395 396/** 397 * Calculates and returns a {@link UnitDefinition} that expresses the units 398 * of measurement assumed for the 'math' expression of this 399 * {@link InitialAssignment}. 400 <p> 401 * <p> 402 * The units are calculated based on the mathematical expression in the 403 * {@link InitialAssignment} and the model quantities referenced by 404 * <code><ci></code> elements used within that expression. The method 405 * {@link InitialAssignment#getDerivedUnitDefinition()} returns the calculated 406 * units, to the extent that libSBML can compute them. 407 <p> 408 * <p> 409 * @note The functionality that facilitates unit analysis depends on the 410 * model as a whole. Thus, in cases where the object has not been added to 411 * a model or the model itself is incomplete, unit analysis is not possible 412 * and this method will return <code>null.</code> 413 <p> 414 * <p> 415 * @warning <span class='warning'>Note that it is possible the 'math' 416 * expression in the {@link InitialAssignment} contains literal numbers or parameters 417 * with undeclared units. In those cases, it is not possible to calculate 418 * the units of the overall expression without making assumptions. LibSBML 419 * does not make assumptions about the units, and 420 * {@link InitialAssignment#getDerivedUnitDefinition()} only returns the units as 421 * far as it is able to determine them. For example, in an expression <em>X 422 * + Y</em>, if <em>X</em> has unambiguously-defined units and <em>Y</em> 423 * does not, it will return the units of <em>X</em>. When using this method, 424 * <strong>it is critical that callers also invoke the method</strong> 425 * {@link InitialAssignment#containsUndeclaredUnits()} <strong>to determine whether 426 * this situation holds</strong>. Callers should take suitable action in 427 * those situations.</span> 428 <p> 429 * @return a {@link UnitDefinition} that expresses the units of the math 430 * expression of this {@link InitialAssignment}, or <code>null</code> if one cannot be constructed. 431 <p> 432 * @see #containsUndeclaredUnits() 433 */ public 434 UnitDefinition getDerivedUnitDefinition() { 435 long cPtr = libsbmlJNI.InitialAssignment_getDerivedUnitDefinition__SWIG_0(swigCPtr, this); 436 return (cPtr == 0) ? null : new UnitDefinition(cPtr, false); 437 } 438 439 440/** 441 * Predicate returning <code>true</code> if the math expression of this 442 * {@link InitialAssignment} contains parameters/numbers with undeclared units. 443 <p> 444 * @return <code>true</code> if the math expression of this {@link InitialAssignment} 445 * includes parameters/numbers 446 * with undeclared units, <code>false</code> otherwise. 447 <p> 448 * @note A return value of <code>true</code> indicates that the {@link UnitDefinition} 449 * returned by InitialAssignment.getDerivedUnitDefinition may not 450 * accurately represent the units of the expression. 451 <p> 452 * @see #getDerivedUnitDefinition() 453 */ public 454 boolean containsUndeclaredUnits() { 455 return libsbmlJNI.InitialAssignment_containsUndeclaredUnits__SWIG_0(swigCPtr, this); 456 } 457 458 459/** 460 * Returns the libSBML type code for this SBML object. 461 <p> 462 * <p> 463 * LibSBML attaches an identifying code to every kind of SBML object. These 464 * are integer constants known as <em>SBML type codes</em>. The names of all 465 * the codes begin with the characters <code>SBML_</code>. 466 * In the Java language interface for libSBML, the 467 * type codes are defined as static integer constants in the interface class 468 * {@link libsbmlConstants}. Note that different Level 3 469 * package plug-ins may use overlapping type codes; to identify the package 470 * to which a given object belongs, call the <code>getPackageName()</code> 471 * method on the object. 472 <p> 473 * @return the SBML type code for this object: 474 * {@link libsbmlConstants#SBML_INITIAL_ASSIGNMENT SBML_INITIAL_ASSIGNMENT} (default). 475 <p> 476 * <p> 477 * @warning <span class='warning'>The specific integer values of the possible 478 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 479 * packages, To fully identify the correct code, <strong>it is necessary to 480 * invoke both getTypeCode() and getPackageName()</strong>.</span> 481 <p> 482 * @see #getElementName() 483 * @see #getPackageName() 484 */ public 485 int getTypeCode() { 486 return libsbmlJNI.InitialAssignment_getTypeCode(swigCPtr, this); 487 } 488 489 490/** 491 * Returns the XML element name of this object, which for 492 * {@link InitialAssignment}, is always <code>'initialAssignment'.</code> 493 <p> 494 * @return the name of this element, i.e., <code>'initialAssignment'.</code> 495 */ public 496 String getElementName() { 497 return libsbmlJNI.InitialAssignment_getElementName(swigCPtr, this); 498 } 499 500 501/** 502 * Predicate returning <code>true</code> if all the required attributes for this 503 * {@link InitialAssignment} object have been set. 504 <p> 505 * The required attributes for an {@link InitialAssignment} object are: 506 * <ul> 507 * <li> 'symbol' 508 * 509 * </ul> <p> 510 * @return <code>true</code> if the required attributes have been set, <code>false</code> 511 * otherwise. 512 */ public 513 boolean hasRequiredAttributes() { 514 return libsbmlJNI.InitialAssignment_hasRequiredAttributes(swigCPtr, this); 515 } 516 517 518/** 519 * Predicate returning <code>true</code> if all the required elements for this 520 * {@link InitialAssignment} object have been set. 521 <p> 522 * @note The required elements for a {@link InitialAssignment} object are: 523 * <ul> 524 * <li> 'math' 525 * 526 * </ul> <p> 527 * @return a boolean value indicating whether all the required 528 * elements for this object have been defined. 529 */ public 530 boolean hasRequiredElements() { 531 return libsbmlJNI.InitialAssignment_hasRequiredElements(swigCPtr, this); 532 } 533 534 535/** * @internal */ public 536 String getId() { 537 return libsbmlJNI.InitialAssignment_getId(swigCPtr, this); 538 } 539 540 541/** 542 * <p> 543 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 544 * value. 545 <p> 546 * <p> 547 * In SBML, object identifiers are of a data type called <code>SId</code>. 548 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 549 * introduced for attribute values that refer to <code>SId</code> values; in 550 * previous Levels of SBML, this data type did not exist and attributes were 551 * simply described to as 'referring to an identifier', but the effective 552 * data type was the same as <code>SIdRef</code>in Level 3. These and 553 * other methods of libSBML refer to the type <code>SIdRef</code> for all 554 * Levels of SBML, even if the corresponding SBML specification did not 555 * explicitly name the data type. 556 <p> 557 * This method works by looking at all attributes and (if appropriate) 558 * mathematical formulas in MathML content, comparing the referenced 559 * identifiers to the value of <code>oldid</code>. If any matches are found, the 560 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 561 * descend into child elements. 562 <p> 563 * @param oldid the old identifier 564 * @param newid the new identifier 565 */ public 566 void renameSIdRefs(String oldid, String newid) { 567 libsbmlJNI.InitialAssignment_renameSIdRefs(swigCPtr, this, oldid, newid); 568 } 569 570 571/** 572 * <p> 573 * Replaces all uses of a given <code>UnitSIdRef</code> type attribute value with 574 * another value. 575 <p> 576 * <p> 577 * In SBML, unit definitions have identifiers of type <code>UnitSId</code>. In 578 * SBML Level 3, an explicit data type called <code>UnitSIdRef</code> was 579 * introduced for attribute values that refer to <code>UnitSId</code> values; in 580 * previous Levels of SBML, this data type did not exist and attributes were 581 * simply described to as 'referring to a unit identifier', but the effective 582 * data type was the same as <code>UnitSIdRef</code> in Level 3. These and 583 * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all 584 * Levels of SBML, even if the corresponding SBML specification did not 585 * explicitly name the data type. 586 <p> 587 * This method works by looking at all unit identifier attribute values 588 * (including, if appropriate, inside mathematical formulas), comparing the 589 * referenced unit identifiers to the value of <code>oldid</code>. If any matches 590 * are found, the matching values are replaced with <code>newid</code>. The method 591 * does <em>not</em> descend into child elements. 592 <p> 593 * @param oldid the old identifier 594 * @param newid the new identifier 595 */ public 596 void renameUnitSIdRefs(String oldid, String newid) { 597 libsbmlJNI.InitialAssignment_renameUnitSIdRefs(swigCPtr, this, oldid, newid); 598 } 599 600 601/** * @internal */ public 602 void replaceSIDWithFunction(String id, ASTNode function) { 603 libsbmlJNI.InitialAssignment_replaceSIDWithFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 604 } 605 606 607/** * @internal */ public 608 void divideAssignmentsToSIdByFunction(String id, ASTNode function) { 609 libsbmlJNI.InitialAssignment_divideAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 610 } 611 612 613/** * @internal */ public 614 void multiplyAssignmentsToSIdByFunction(String id, ASTNode function) { 615 libsbmlJNI.InitialAssignment_multiplyAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 616 } 617 618}