001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 2.0.12
004 *
005 * Do not make changes to this file unless you know what you are doing--modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.sbml.libsbml;
010
011/** 
012 *  Implementation of SBML's InitialAssignment construct.
013 <p>
014 * SBML Level 2 Versions 2&ndash;4 and SBML Level&nbsp;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 &#8804; 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&nbsp;2
061 * Version&nbsp;4 and in SBML Level&nbsp;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&nbsp;2 Version&nbsp;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&nbsp;2 Version&nbsp;4 and in SBML Level&nbsp;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&nbsp;2 Version&nbsp;4 and in SBML Level&nbsp;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&nbsp;2 Version&nbsp;4 and SBML Level&nbsp;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 &#8804; 0</em>.  Section 3.4.8 in the SBML Level 2
109 * Version 4  and SBML Level&nbsp;3 Version&nbsp;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&mdash;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   * @throws SBMLConstructorException 
204   * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind
205   * of SBML object, are either invalid or mismatched with respect to the
206   * parent {@link SBMLDocument} object.
207   <p>
208   * <p>
209 * @note Upon the addition of a {@link InitialAssignment} object to an {@link SBMLDocument}
210 * (e.g., using {@link Model#addInitialAssignment(InitialAssignment
211 * ia)}), the SBML Level, SBML Version and XML namespace of the document
212 * <em>override</em> the values used when creating the {@link InitialAssignment} object
213 * via this constructor.  This is necessary to ensure that an SBML document
214 * is a consistent structure.  Nevertheless, the ability to supply the values
215 * at the time of creation of a {@link InitialAssignment} is an important aid to
216 * producing valid SBML.  Knowledge of the intented SBML Level and Version
217 * determine whether it is valid to assign a particular value to an
218 * attribute, or whether it is valid to add an object to an existing
219 * {@link SBMLDocument}.
220   */ public
221 InitialAssignment(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
222    this(libsbmlJNI.new_InitialAssignment__SWIG_0(level, version), true);
223  }
224
225  
226/**
227   * Creates a new {@link InitialAssignment} using the given {@link SBMLNamespaces} object
228   * <code>sbmlns</code>.
229   <p>
230   * <p>
231 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces
232 * information.  It is used to communicate the SBML Level, Version, and (in
233 * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
234 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an
235 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object
236 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 
237   <p>
238   * @param sbmlns an {@link SBMLNamespaces} object.
239   <p>
240   * @throws SBMLConstructorException 
241   * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind
242   * of SBML object, are either invalid or mismatched with respect to the
243   * parent {@link SBMLDocument} object.
244   <p>
245   * <p>
246 * @note Upon the addition of a {@link InitialAssignment} object to an {@link SBMLDocument}
247 * (e.g., using {@link Model#addInitialAssignment(InitialAssignment
248 * ia)}), the SBML Level, SBML Version and XML namespace of the document
249 * <em>override</em> the values used when creating the {@link InitialAssignment} object
250 * via this constructor.  This is necessary to ensure that an SBML document
251 * is a consistent structure.  Nevertheless, the ability to supply the values
252 * at the time of creation of a {@link InitialAssignment} is an important aid to
253 * producing valid SBML.  Knowledge of the intented SBML Level and Version
254 * determine whether it is valid to assign a particular value to an
255 * attribute, or whether it is valid to add an object to an existing
256 * {@link SBMLDocument}. 
257   */ public
258 InitialAssignment(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException {
259    this(libsbmlJNI.new_InitialAssignment__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true);
260  }
261
262  
263/**
264   * Copy constructor; creates a copy of this {@link InitialAssignment}.
265   <p>
266   * @param orig the object to copy.
267   <p>
268   * @throws SBMLConstructorException 
269   * Thrown if the argument <code>orig</code> is <code>null.</code>
270   */ public
271 InitialAssignment(InitialAssignment orig) throws org.sbml.libsbml.SBMLConstructorException {
272    this(libsbmlJNI.new_InitialAssignment__SWIG_2(InitialAssignment.getCPtr(orig), orig), true);
273  }
274
275  
276/**
277   * Creates and returns a deep copy of this {@link InitialAssignment}.
278   <p>
279   * @return a (deep) copy of this {@link InitialAssignment}.
280   */ public
281 InitialAssignment cloneObject() {
282    long cPtr = libsbmlJNI.InitialAssignment_cloneObject(swigCPtr, this);
283    return (cPtr == 0) ? null : new InitialAssignment(cPtr, true);
284  }
285
286  
287/**
288   * Get the value of the 'symbol' attribute of this {@link InitialAssignment}.
289   <p>
290   * @return the identifier string stored as the 'symbol' attribute value
291   * in this {@link InitialAssignment}.
292   */ public
293 String getSymbol() {
294    return libsbmlJNI.InitialAssignment_getSymbol(swigCPtr, this);
295  }
296
297  
298/**
299   * Get the mathematical formula of this {@link InitialAssignment}.
300   <p>
301   * @return an {@link ASTNode}, the value of the 'math' subelement of this
302   * {@link InitialAssignment}
303   */ public
304 ASTNode getMath() {
305    long cPtr = libsbmlJNI.InitialAssignment_getMath(swigCPtr, this);
306    return (cPtr == 0) ? null : new ASTNode(cPtr, false);
307  }
308
309  
310/**
311   * Predicate returning <code>true</code> if this
312   * {@link InitialAssignment}'s 'symbol' attribute is set.
313   <p>
314   * @return <code>true</code> if the 'symbol' attribute of this {@link InitialAssignment}
315   * is set, <code>false</code> otherwise.
316   */ public
317 boolean isSetSymbol() {
318    return libsbmlJNI.InitialAssignment_isSetSymbol(swigCPtr, this);
319  }
320
321  
322/**
323   * Predicate returning <code>true</code> if this
324   * {@link InitialAssignment}'s 'math' subelement contains a value.
325   <p>
326   * @return <code>true</code> if the 'math' for this {@link InitialAssignment} is set,
327   * <code>false</code> otherwise.
328   */ public
329 boolean isSetMath() {
330    return libsbmlJNI.InitialAssignment_isSetMath(swigCPtr, this);
331  }
332
333  
334/**
335   * Sets the 'symbol' attribute value of this {@link InitialAssignment}.
336   <p>
337   * @param sid the identifier of a {@link Species}, {@link Compartment} or {@link Parameter}
338   * object defined elsewhere in this {@link Model}.
339   <p>
340   * @return integer value indicating success/failure of the
341   * function.  The possible values
342   * returned by this function are:
343   * <ul>
344   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
345   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
346   * </ul>
347   */ public
348 int setSymbol(String sid) {
349    return libsbmlJNI.InitialAssignment_setSymbol(swigCPtr, this, sid);
350  }
351
352  
353/**
354   * Sets the 'math' subelement of this {@link InitialAssignment}.
355   <p>
356   * The AST passed in <code>math</code> is copied.
357   <p>
358   * @param math an AST containing the mathematical expression to
359   * be used as the formula for this {@link InitialAssignment}.
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_OBJECT LIBSBML_INVALID_OBJECT }
367   * </ul>
368   */ public
369 int setMath(ASTNode math) {
370    return libsbmlJNI.InitialAssignment_setMath(swigCPtr, this, ASTNode.getCPtr(math), math);
371  }
372
373  
374/**
375   * Calculates and returns a {@link UnitDefinition} that expresses the units
376   * of measurement assumed for the 'math' expression of this
377   * {@link InitialAssignment}.
378   <p>
379   * <p>
380 * The units are calculated based on the mathematical expression in the
381 * {@link InitialAssignment} and the model quantities referenced by
382 * <code>&lt;ci&gt;</code> elements used within that expression.  The method
383 * {@link InitialAssignment#getDerivedUnitDefinition()} returns the calculated
384 * units, to the extent that libSBML can compute them.
385   <p>
386   * <p>
387 * @note The functionality that facilitates unit analysis depends on the
388 * model as a whole.  Thus, in cases where the object has not been added to
389 * a model or the model itself is incomplete, unit analysis is not possible
390 * and this method will return <code>null.</code> 
391   <p>
392   * <p>
393 * @warning <span class='warning'>Note that it is possible the 'math'
394 * expression in the {@link InitialAssignment} contains literal numbers or parameters
395 * with undeclared units.  In those cases, it is not possible to calculate
396 * the units of the overall expression without making assumptions.  LibSBML
397 * does not make assumptions about the units, and
398 * {@link InitialAssignment#getDerivedUnitDefinition()} only returns the units as
399 * far as it is able to determine them.  For example, in an expression <em>X
400 * + Y</em>, if <em>X</em> has unambiguously-defined units and <em>Y</em>
401 * does not, it will return the units of <em>X</em>.  When using this method,
402 * <strong>it is critical that callers also invoke the method</strong>
403 * {@link InitialAssignment#containsUndeclaredUnits()} <strong>to determine whether
404 * this situation holds</strong>.  Callers should take suitable action in
405 * those situations.</span>
406   <p>
407   * @return a {@link UnitDefinition} that expresses the units of the math 
408   * expression of this {@link InitialAssignment}, or <code>null</code> if one cannot be constructed.
409   <p>
410   * @see #containsUndeclaredUnits()
411   */ public
412 UnitDefinition getDerivedUnitDefinition() {
413    long cPtr = libsbmlJNI.InitialAssignment_getDerivedUnitDefinition__SWIG_0(swigCPtr, this);
414    return (cPtr == 0) ? null : new UnitDefinition(cPtr, false);
415  }
416
417  
418/**
419   * Predicate returning <code>true</code> if the math expression of this
420   * {@link InitialAssignment} contains parameters/numbers with undeclared units.
421   <p>
422   * @return <code>true</code> if the math expression of this {@link InitialAssignment}
423   * includes parameters/numbers 
424   * with undeclared units, <code>false</code> otherwise.
425   <p>
426   * @note A return value of <code>true</code> indicates that the {@link UnitDefinition}
427   * returned by InitialAssignment.getDerivedUnitDefinition may not
428   * accurately represent the units of the expression.
429   <p>
430   * @see #getDerivedUnitDefinition()
431   */ public
432 boolean containsUndeclaredUnits() {
433    return libsbmlJNI.InitialAssignment_containsUndeclaredUnits__SWIG_0(swigCPtr, this);
434  }
435
436  
437/**
438   * Returns the libSBML type code for this SBML object.
439   <p>
440   * <p>
441 * LibSBML attaches an identifying code to every kind of SBML object.  These
442 * are integer constants known as <em>SBML type codes</em>.  The names of all
443 * the codes begin with the characters &ldquo;<code>SBML_</code>&rdquo;. 
444 * In the Java language interface for libSBML, the
445 * type codes are defined as static integer constants in the interface class
446 * {@link libsbmlConstants}.    Note that different Level&nbsp;3 
447 * package plug-ins may use overlapping type codes; to identify the package
448 * to which a given object belongs, call the <code>getPackageName()</code>
449 * method on the object.
450   <p>
451   * @return the SBML type code for this object:
452   * {@link  libsbmlConstants#SBML_INITIAL_ASSIGNMENT SBML_INITIAL_ASSIGNMENT} (default).
453   <p>
454   * <p>
455 * @warning <span class='warning'>The specific integer values of the possible
456 * type codes may be reused by different Level&nbsp;3 package plug-ins.
457 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
458 * both getTypeCode() and getPackageName()</strong>.</span>
459   <p>
460   * @see #getElementName()
461   * @see #getPackageName()
462   */ public
463 int getTypeCode() {
464    return libsbmlJNI.InitialAssignment_getTypeCode(swigCPtr, this);
465  }
466
467  
468/**
469   * Returns the XML element name of this object, which for
470   * {@link InitialAssignment}, is always <code>'initialAssignment'.</code>
471   <p>
472   * @return the name of this element, i.e., <code>'initialAssignment'.</code>
473   */ public
474 String getElementName() {
475    return libsbmlJNI.InitialAssignment_getElementName(swigCPtr, this);
476  }
477
478  
479/**
480   * Predicate returning <code>true</code> if all the required attributes for this
481   * {@link InitialAssignment} object have been set.
482   <p>
483   * @note The required attributes for an {@link InitialAssignment} object are:
484   * <ul>
485   * <li> 'symbol'
486   *
487   * </ul> <p>
488   * @return a boolean value indicating whether all the required
489   * attributes for this object have been defined.
490   */ public
491 boolean hasRequiredAttributes() {
492    return libsbmlJNI.InitialAssignment_hasRequiredAttributes(swigCPtr, this);
493  }
494
495  
496/**
497   * Predicate returning <code>true</code> if all the required elements for this
498   * {@link InitialAssignment} object have been set.
499   <p>
500   * @note The required elements for a {@link InitialAssignment} object are:
501   * <ul>
502   * <li> 'math'
503   *
504   * </ul> <p>
505   * @return a boolean value indicating whether all the required
506   * elements for this object have been defined.
507   */ public
508 boolean hasRequiredElements() {
509    return libsbmlJNI.InitialAssignment_hasRequiredElements(swigCPtr, this);
510  }
511
512  
513/** * @internal */ public
514 String getId() {
515    return libsbmlJNI.InitialAssignment_getId(swigCPtr, this);
516  }
517
518  
519/**
520   * Renames all the <code>SIdRef</code> attributes on this element, including any
521   * found in MathML.
522   <p>
523   * <p>
524 * In SBML, object identifiers are of a data type called <code>SId</code>.
525 * In SBML Level&nbsp;3, an explicit data type called <code>SIdRef</code> was
526 * introduced for attribute values that refer to <code>SId</code> values; in
527 * previous Levels of SBML, this data type did not exist and attributes were
528 * simply described to as 'referring to an identifier', but the effective
529 * data type was the same as <code>SIdRef</code>in Level&nbsp;3.  These and
530 * other methods of libSBML refer to the type <code>SIdRef</code> for all
531 * Levels of SBML, even if the corresponding SBML specification did not
532 * explicitly name the data type.
533   <p>
534   * This method works by looking at all attributes and (if appropriate)
535   * mathematical formulas, comparing the identifiers to the value of 
536   * <code>oldid</code>.  If any matches are found, the matching identifiers are replaced
537   * with <code>newid</code>.  The method does <em>not</em> descend into child elements.
538   <p>
539   * @param oldid the old identifier
540   * @param newid the new identifier
541   */ public
542 void renameSIdRefs(String oldid, String newid) {
543    libsbmlJNI.InitialAssignment_renameSIdRefs(swigCPtr, this, oldid, newid);
544  }
545
546  
547/**
548   * Renames all the <code>UnitSIdRef</code> attributes on this element.
549   <p>
550   * <p>
551 * In SBML, unit definitions have identifiers of type <code>UnitSId</code>.  In
552 * SBML Level&nbsp;3, an explicit data type called <code>UnitSIdRef</code> was
553 * introduced for attribute values that refer to <code>UnitSId</code> values; in
554 * previous Levels of SBML, this data type did not exist and attributes were
555 * simply described to as 'referring to a unit identifier', but the effective
556 * data type was the same as <code>UnitSIdRef</code> in Level&nbsp;3.  These and
557 * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all
558 * Levels of SBML, even if the corresponding SBML specification did not
559 * explicitly name the data type.
560   <p>
561   * This method works by looking at all unit identifier attribute values
562   * (including, if appropriate, inside mathematical formulas), comparing the
563   * unit identifiers to the value of <code>oldid</code>.  If any matches are found,
564   * the matching identifiers are replaced with <code>newid</code>.  The method does
565   * <em>not</em> descend into child elements.
566   <p>
567   * @param oldid the old identifier
568   * @param newid the new identifier
569   */ public
570 void renameUnitSIdRefs(String oldid, String newid) {
571    libsbmlJNI.InitialAssignment_renameUnitSIdRefs(swigCPtr, this, oldid, newid);
572  }
573
574  
575/**
576   * Replace all nodes with the name 'id' from the child 'math' object with the provided function. 
577   <p>
578   * @internal
579   */ public
580 void replaceSIDWithFunction(String id, ASTNode function) {
581    libsbmlJNI.InitialAssignment_replaceSIDWithFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function);
582  }
583
584  
585/**
586   * If this assignment assigns a value to the 'id' element, replace the 'math' object with the function (existing/function). 
587   * @internal 
588   */ public
589 void divideAssignmentsToSIdByFunction(String id, ASTNode function) {
590    libsbmlJNI.InitialAssignment_divideAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function);
591  }
592
593  
594/**
595   * If this assignment assigns a value to the 'id' element, replace the 'math' object with the function (existing*function). 
596   * @internal 
597   */ public
598 void multiplyAssignmentsToSIdByFunction(String id, ASTNode function) {
599    libsbmlJNI.InitialAssignment_multiplyAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function);
600  }
601
602}