001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.8 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 assignment to a variable by an SBML <em>event</em>. 013 <p> 014 * {@link Event} contains an optional element called 'listOfEventAssignments', of 015 * class {@link ListOfEventAssignments}. In every instance of an event definition 016 * in a model, the object's 'listOfEventAssignments' element must have a 017 * non-empty list of one or more 'eventAssignment' elements of class 018 * {@link EventAssignment}. The object class {@link EventAssignment} has one required 019 * attribute, 'variable', and a required element, 'math'. Being derived 020 * from {@link SBase}, it also has all the usual attributes and elements of its 021 * parent class. 022 <p> 023 * An {@link Event} object defines when the event can occur, the variables that are 024 * affected by the event, and how the variables are affected. The purpose 025 * of the {@link EventAssignment} object class is to define how variables are 026 * affected by an {@link Event}. In SBML Level 2, every {@link Event} object instance 027 * must have a nonempty list of event assignments; in SBML Level 3, 028 * the list of assignments is optional. 029 <p> 030 * The operation of an {@link Event} is divided into two phases (regardless of 031 * whether a delay is involved): one phase when the event is <em>triggered</em>, 032 * and the other when the event is <em>executed</em>. {@link EventAssignment} objects 033 * are interpreted when an event is executed. The effects are described 034 * below. 035 <p> 036 * <h2>The attribute 'variable'</h2> 037 <p> 038 * The {@link EventAssignment} attribute 'variable' must be the identifier of an 039 * existing {@link Compartment}, {@link Species}, {@link SpeciesReference}, or {@link Parameter} 040 * instance defined in the model. When the event is executed, the value of 041 * the model component identified by 'variable' is changed by the 042 * {@link EventAssignment} to the value computed by the 'math' element; that is, a 043 * species' quantity, species reference's stoichiometry, compartment's size 044 * or parameter's value are reset to the value computed by 'math'. 045 <p> 046 * Certain restrictions are placed on what can appear in 'variable': 047 * <ul> 048 * <li> The object identified by the value of the {@link EventAssignment} attribute 049 * 'variable' must not have its 'constant' attribute set to or default to 050 * <code>true.</code> (Constants cannot be affected by events.) 051 <p> 052 * <li> The 'variable' attribute must not contain the identifier of a 053 * reaction; only species, species references, compartment and parameter 054 * values may be set by an {@link Event}. 055 <p> 056 * <li> The value of every 'variable' attribute must be unique among the set 057 * of {@link EventAssignment} structures within a given {@link Event} structure. In other 058 * words, a single event cannot have multiple {@link EventAssignment} objects 059 * assigning the same variable. (All of them would be performed at the 060 * same time when that particular {@link Event} triggers, resulting in 061 * indeterminacy.) However, <em>separate</em> {@link Event} instances can refer to the 062 * same variable. 063 <p> 064 * <li> A variable cannot be assigned a value in an {@link EventAssignment} object 065 * instance and also be assigned a value by an {@link AssignmentRule}; i.e., the 066 * value of an {@link EventAssignment}'s 'variable' attribute cannot be the same as 067 * the value of a {@link AssignmentRule}' 'variable' attribute. (Assignment rules 068 * hold at all times, therefore it would be inconsistent to also define an 069 * event that reassigns the value of the same variable.) 070 * </ul> 071 <p> 072 * Note that the time of assignment of the object identified by the 073 * value of the 'variable' attribute is always the time at which the {@link Event} 074 * is <em>executed</em>, not when it is <em>triggered</em>. The timing is 075 * controlled by the optional {@link Delay} in an {@link Event}. The time of 076 * assignment is not affected by the 'useValuesFromTriggerTime' 077 * attribute on {@link Event}—that attribute affects the time at which the 078 * {@link EventAssignment}'s 'math' expression is <em>evaluated</em>. In other 079 * words, SBML allows decoupling the time at which the 080 * 'variable' is assigned from the time at which its value 081 * expression is calculated. 082 <p> 083 * <h2>The 'math' subelement in an {@link EventAssignment}</h2> 084 <p> 085 * The MathML expression contained in an {@link EventAssignment} defines the new 086 * value of the variable being assigned by the {@link Event}. 087 <p> 088 * As mentioned above, the time at which the expression in 'math' is 089 * evaluated is determined by the attribute 'useValuesFromTriggerTime' on 090 * {@link Event}. If the attribute value is <code>true</code>, the expression must be 091 * evaluated when the event is <em>triggered</em>; more precisely, the values of 092 * identifiers occurring in MathML <code><ci></code> elements in the 093 * {@link EventAssignment}'s 'math' expression are the values they have at the 094 * point when the event <em>triggered</em>. If, instead, 095 * 'useValuesFromTriggerTime''s value is <code>false</code>, it means the values at 096 * <em>execution</em> time should be used; that is, the values of identifiers 097 * occurring in MathML <code><ci></code> elements in the 098 * {@link EventAssignment}'s 'math' expression are the values they have at the 099 * point when the event <em>executed</em>. 100 <p> 101 * <h2>SBML Level/Version differences</h2> 102 <p> 103 * Between Version 4 and previous versions of SBML Level 2, the 104 * requirements regarding the matching of units between an 105 * EvengAssignment's formula and the units of the object identified by the 106 * 'variable' attribute changed. Previous versions required consistency, 107 * but in SBML Level 2 Version 4 and in SBML Level 3, unit 108 * consistency is only <em>recommended</em>. More precisely: 109 * <ul> 110 <p> 111 * <li> In the case of a species, an {@link EventAssignment} sets the referenced 112 * species' quantity (concentration or amount of substance) to the value 113 * determined by the formula in the {@link EventAssignment}'s 'math' subelement. 114 * The units of the 'math' formula should (in SBML Level 2 115 * Version 4 and in Level 3) or must (in previous Versions of 116 * Level 2) be identical to the units of the species. 117 <p> 118 * <li> (SBML Level 3 only.) In the case of a species reference, an 119 * {@link EventAssignment} sets the stoichiometry of the reactant or product 120 * referenced by the {@link SpeciesReference} object to the value determined by the 121 * formula in the 'math' element. The unit associated with the value 122 * produced by the 'math' formula should be <code>dimensionless</code>, because 123 * reactant and product stoichiometries in reactions are dimensionless 124 * quantities. 125 <p> 126 * <li> In the case of a compartment, an {@link EventAssignment} sets the 127 * referenced compartment's size to the size determined by the formula in 128 * the 'math' subelement of the {@link EventAssignment}. The overall units of the 129 * formula should (in SBML Level 2 Version 4 and in Level 3) 130 * or must (in previous Versions of Level 2) be identical to the units 131 * specified for the size of the compartment identified by the 132 * {@link EventAssignment}'s 'variable' attribute. 133 <p> 134 * <li> In the case of a parameter, an {@link EventAssignment} sets the referenced 135 * parameter's value to that determined by the formula in 'math'. The 136 * overall units of the formula should (in SBML Level 2 Version 4 137 * and Level 3) or must (in previous Versions of Level 2) be 138 * identical to the units defined for the parameter. 139 * </ul> 140 <p> 141 * Note that the formula placed in the 'math' element <em>has no assumed 142 * units</em>. The consistency of the units of the formula, and the units 143 * of the entity which the assignment affects, must be explicitly 144 * established just as in the case of the value of the {@link Delay} subelement. 145 * An approach similar to the one discussed in the context of {@link Delay} may be 146 * used for the formula of an {@link EventAssignment}. 147 <p> 148 * @see Event 149 */ 150 151public class EventAssignment extends SBase { 152 private long swigCPtr; 153 154 protected EventAssignment(long cPtr, boolean cMemoryOwn) 155 { 156 super(libsbmlJNI.EventAssignment_SWIGUpcast(cPtr), cMemoryOwn); 157 swigCPtr = cPtr; 158 } 159 160 protected static long getCPtr(EventAssignment obj) 161 { 162 return (obj == null) ? 0 : obj.swigCPtr; 163 } 164 165 protected static long getCPtrAndDisown (EventAssignment 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_EventAssignment(swigCPtr); 187 } 188 swigCPtr = 0; 189 } 190 super.delete(); 191 } 192 193 194/** 195 * Creates a new {@link EventAssignment} 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 EventAssignment} 199 <p> 200 * @param version a long integer, the SBML Version to assign to this 201 * {@link EventAssignment} 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 EventAssignment(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 225 this(libsbmlJNI.new_EventAssignment__SWIG_0(level, version), true); 226 } 227 228 229/** 230 * Creates a new {@link EventAssignment} 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 EventAssignment(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 265 this(libsbmlJNI.new_EventAssignment__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 266 } 267 268 269/** 270 * Copy constructor; creates a copy of this {@link EventAssignment}. 271 <p> 272 * @param orig the object to copy. 273 */ public 274 EventAssignment(EventAssignment orig) throws org.sbml.libsbml.SBMLConstructorException { 275 this(libsbmlJNI.new_EventAssignment__SWIG_2(EventAssignment.getCPtr(orig), orig), true); 276 } 277 278 279/** 280 * Creates and returns a deep copy of this {@link EventAssignment} object. 281 <p> 282 * @return the (deep) copy of this {@link EventAssignment} object. 283 */ public 284 EventAssignment cloneObject() { 285 long cPtr = libsbmlJNI.EventAssignment_cloneObject(swigCPtr, this); 286 return (cPtr == 0) ? null : new EventAssignment(cPtr, true); 287 } 288 289 290/** 291 * Get the value of this {@link EventAssignment}'s 'variable' attribute. 292 <p> 293 * @return the identifier stored in the 'variable' attribute of this 294 * {@link EventAssignment}. 295 */ public 296 String getVariable() { 297 return libsbmlJNI.EventAssignment_getVariable(swigCPtr, this); 298 } 299 300 301/** 302 * Get the mathematical expression in this {@link EventAssignment}'s 'math' 303 * subelement. 304 <p> 305 * @return the top {@link ASTNode} of an abstract syntax tree representing the 306 * mathematical formula in this {@link EventAssignment}. 307 */ public 308 ASTNode getMath() { 309 long cPtr = libsbmlJNI.EventAssignment_getMath(swigCPtr, this); 310 return (cPtr == 0) ? null : new ASTNode(cPtr, false); 311 } 312 313 314/** 315 * Predicate for testing whether the attribute 'variable' of this 316 * {@link EventAssignment} is set. 317 <p> 318 * @return <code>true</code> if the 'variable' attribute of this {@link EventAssignment} 319 * is set, <code>false</code> otherwise. 320 */ public 321 boolean isSetVariable() { 322 return libsbmlJNI.EventAssignment_isSetVariable(swigCPtr, this); 323 } 324 325 326/** 327 * Predicate for testing whether the 'math' subelement of this 328 * {@link EventAssignment} is set. 329 <p> 330 * @return <code>true</code> if this {@link EventAssignment} has a 'math' subelement, 331 * <code>false</code> otherwise. 332 */ public 333 boolean isSetMath() { 334 return libsbmlJNI.EventAssignment_isSetMath(swigCPtr, this); 335 } 336 337 338/** 339 * Sets the attribute 'variable' of this {@link EventAssignment} to a copy of 340 * the given identifier string. 341 <p> 342 * @param sid the identifier of a {@link Compartment}, {@link Species} or (global) 343 * {@link Parameter} defined in this model. 344 <p> 345 * <p> 346 * @return integer value indicating success/failure of the 347 * function. The possible values 348 * returned by this function are: 349 * <ul> 350 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 351 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 352 * </ul> 353 */ public 354 int setVariable(String sid) { 355 return libsbmlJNI.EventAssignment_setVariable(swigCPtr, this, sid); 356 } 357 358 359/** 360 * Unsets the attribute 'variable' of this {@link EventAssignment}. 361 <p> 362 * <p> 363 * @return integer value indicating success/failure of the 364 * function. The possible values 365 * returned by this function are: 366 * <ul> 367 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 368 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 369 * </ul> 370 */ public 371 int unsetVariable() { 372 return libsbmlJNI.EventAssignment_unsetVariable(swigCPtr, this); 373 } 374 375 376/** 377 * Sets the 'math' subelement of this {@link EventAssignment} to a copy of the 378 * given {@link ASTNode}. 379 <p> 380 * @param math an {@link ASTNode} that will be copied and stored as the 381 * mathematical formula for this {@link EventAssignment}. 382 <p> 383 * <p> 384 * @return integer value indicating success/failure of the 385 * function. The possible values 386 * returned by this function are: 387 * <ul> 388 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 389 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 390 * </ul> 391 */ public 392 int setMath(ASTNode math) { 393 return libsbmlJNI.EventAssignment_setMath(swigCPtr, this, ASTNode.getCPtr(math), math); 394 } 395 396 397/** 398 * Calculates and returns a {@link UnitDefinition} that expresses the units of 399 * measurement assumed for the 'math' expression of this {@link EventAssignment}. 400 <p> 401 * <p> 402 * The units are calculated based on the mathematical expression in the 403 * {@link EventAssignment} and the model quantities referenced by 404 * <code><ci></code> elements used within that expression. The method 405 * {@link EventAssignment#getDerivedUnitDefinition()} returns the calculated units, 406 * 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 EventAssignment} 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 EventAssignment#getDerivedUnitDefinition()} only returns the units as far 421 * 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> does 423 * 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 EventAssignment#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 EventAssignment}, or <code>null</code> if one cannot be constructed. 431 <p> 432 * @see #containsUndeclaredUnits() 433 */ public 434 UnitDefinition getDerivedUnitDefinition() { 435 long cPtr = libsbmlJNI.EventAssignment_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 EventAssignment} contains literal numbers or parameters with undeclared 443 * units. 444 <p> 445 * <p> 446 * The units are calculated based on the mathematical expression in the 447 * {@link EventAssignment} and the model quantities referenced by 448 * <code><ci></code> elements used within that expression. The method 449 * {@link EventAssignment#getDerivedUnitDefinition()} returns the calculated units, 450 * to the extent that libSBML can compute them. 451 <p> 452 * If the expression contains literal numbers or parameters with undeclared 453 * units, libSBML may not be able to compute the full units of the 454 * expression and will only return what it can compute. Callers should 455 * always use {@link EventAssignment#containsUndeclaredUnits()} when using 456 * {@link EventAssignment#getDerivedUnitDefinition()} to decide whether the 457 * returned units may be incomplete. 458 <p> 459 * @return <code>true</code> if the math expression of this {@link EventAssignment} 460 * includes parameters/numbers 461 * with undeclared units, <code>false</code> otherwise. 462 <p> 463 * @note A return value of <code>true</code> indicates that the {@link UnitDefinition} 464 * returned by {@link EventAssignment#getDerivedUnitDefinition()} may not 465 * accurately represent the units of the expression. 466 <p> 467 * @see #getDerivedUnitDefinition() 468 */ public 469 boolean containsUndeclaredUnits() { 470 return libsbmlJNI.EventAssignment_containsUndeclaredUnits__SWIG_0(swigCPtr, this); 471 } 472 473 474/** 475 * Returns the libSBML type code of this object instance. 476 <p> 477 * <p> 478 * LibSBML attaches an identifying code to every kind of SBML object. These 479 * are integer constants known as <em>SBML type codes</em>. The names of all 480 * the codes begin with the characters <code>SBML_</code>. 481 * In the Java language interface for libSBML, the 482 * type codes are defined as static integer constants in the interface class 483 * {@link libsbmlConstants}. Note that different Level 3 484 * package plug-ins may use overlapping type codes; to identify the package 485 * to which a given object belongs, call the <code>getPackageName()</code> 486 * method on the object. 487 <p> 488 * @return the SBML type code for this object: 489 * {@link libsbmlConstants#SBML_EVENT_ASSIGNMENT SBML_EVENT_ASSIGNMENT} (default). 490 <p> 491 * <p> 492 * @warning <span class='warning'>The specific integer values of the possible 493 * type codes may be reused by different Level 3 package plug-ins. 494 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 495 * both getTypeCode() and getPackageName()</strong>.</span> 496 <p> 497 * @see #getElementName() 498 * @see #getPackageName() 499 */ public 500 int getTypeCode() { 501 return libsbmlJNI.EventAssignment_getTypeCode(swigCPtr, this); 502 } 503 504 505/** 506 * Returns the XML element name of this object, which for 507 * {@link EventAssignment}, is always <code>'eventAssignment'.</code> 508 <p> 509 * @return the name of this element, i.e., <code>'eventAssignment'.</code> 510 */ public 511 String getElementName() { 512 return libsbmlJNI.EventAssignment_getElementName(swigCPtr, this); 513 } 514 515 516/** 517 * Predicate returning <code>true</code> if all the required attributes for this 518 * {@link EventAssignment} object have been set. 519 <p> 520 * The required attributes for a {@link EventAssignment} object are: 521 * <ul> 522 * <li> 'variable' 523 * 524 * </ul> <p> 525 * @return <code>true</code> if the required attributes have been set, <code>false</code> 526 * otherwise. 527 */ public 528 boolean hasRequiredAttributes() { 529 return libsbmlJNI.EventAssignment_hasRequiredAttributes(swigCPtr, this); 530 } 531 532 533/** 534 * Predicate returning <code>true</code> if all the required elements for this 535 * {@link EventAssignment} object have been set. 536 <p> 537 * @note The required elements for a {@link EventAssignment} object are: 538 * <ul> 539 * <li> 'math' 540 * 541 * </ul> <p> 542 * @return a boolean value indicating whether all the required 543 * elements for this object have been defined. 544 */ public 545 boolean hasRequiredElements() { 546 return libsbmlJNI.EventAssignment_hasRequiredElements(swigCPtr, this); 547 } 548 549 550/** * @internal */ public 551 String getId() { 552 return libsbmlJNI.EventAssignment_getId(swigCPtr, this); 553 } 554 555 556/** 557 * <p> 558 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 559 * value. 560 <p> 561 * <p> 562 * In SBML, object identifiers are of a data type called <code>SId</code>. 563 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 564 * introduced for attribute values that refer to <code>SId</code> values; in 565 * previous Levels of SBML, this data type did not exist and attributes were 566 * simply described to as 'referring to an identifier', but the effective 567 * data type was the same as <code>SIdRef</code>in Level 3. These and 568 * other methods of libSBML refer to the type <code>SIdRef</code> for all 569 * Levels of SBML, even if the corresponding SBML specification did not 570 * explicitly name the data type. 571 <p> 572 * This method works by looking at all attributes and (if appropriate) 573 * mathematical formulas in MathML content, comparing the referenced 574 * identifiers to the value of <code>oldid</code>. If any matches are found, the 575 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 576 * descend into child elements. 577 <p> 578 * @param oldid the old identifier 579 * @param newid the new identifier 580 */ public 581 void renameSIdRefs(String oldid, String newid) { 582 libsbmlJNI.EventAssignment_renameSIdRefs(swigCPtr, this, oldid, newid); 583 } 584 585 586/** 587 * <p> 588 * Replaces all uses of a given <code>UnitSIdRef</code> type attribute value with 589 * another value. 590 <p> 591 * <p> 592 * In SBML, unit definitions have identifiers of type <code>UnitSId</code>. In 593 * SBML Level 3, an explicit data type called <code>UnitSIdRef</code> was 594 * introduced for attribute values that refer to <code>UnitSId</code> values; in 595 * previous Levels of SBML, this data type did not exist and attributes were 596 * simply described to as 'referring to a unit identifier', but the effective 597 * data type was the same as <code>UnitSIdRef</code> in Level 3. These and 598 * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all 599 * Levels of SBML, even if the corresponding SBML specification did not 600 * explicitly name the data type. 601 <p> 602 * This method works by looking at all unit identifier attribute values 603 * (including, if appropriate, inside mathematical formulas), comparing the 604 * referenced unit identifiers to the value of <code>oldid</code>. If any matches 605 * are found, the matching values are replaced with <code>newid</code>. The method 606 * does <em>not</em> descend into child elements. 607 <p> 608 * @param oldid the old identifier 609 * @param newid the new identifier 610 */ public 611 void renameUnitSIdRefs(String oldid, String newid) { 612 libsbmlJNI.EventAssignment_renameUnitSIdRefs(swigCPtr, this, oldid, newid); 613 } 614 615 616/** * @internal */ public 617 void replaceSIDWithFunction(String id, ASTNode function) { 618 libsbmlJNI.EventAssignment_replaceSIDWithFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 619 } 620 621 622/** * @internal */ public 623 void divideAssignmentsToSIdByFunction(String id, ASTNode function) { 624 libsbmlJNI.EventAssignment_divideAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 625 } 626 627 628/** * @internal */ public 629 void multiplyAssignmentsToSIdByFunction(String id, ASTNode function) { 630 libsbmlJNI.EventAssignment_multiplyAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 631 } 632 633}