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