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 EventAssignment construct for
013 * Event.
014 <p>
015 * {@link Event} contains an optional element called 'listOfEventAssignments', of
016 * class {@link ListOfEventAssignments}.  In every instance of an event definition
017 * in a model, the object's 'listOfEventAssignments' element must have a
018 * non-empty list of one or more 'eventAssignment' elements of class
019 * {@link EventAssignment}.  The object class {@link EventAssignment} has one required
020 * attribute, 'variable', and a required element, 'math'.  Being derived
021 * from {@link SBase}, it also has all the usual attributes and elements of its
022 * parent class.
023 <p>
024 * An {@link Event} object defines when the event can occur, the variables that are
025 * affected by the event, and how the variables are affected.  The purpose
026 * of the {@link EventAssignment} object class is to define how variables are
027 * affected by an {@link Event}.  In SBML Level&nbsp;2, every {@link Event} object instance
028 * must have a nonempty list of event assignments; in SBML Level&nbsp;3,
029 * the list of assignments is optional.
030 <p>
031 * The operation of an {@link Event} is divided into two phases (regardless of
032 * whether a delay is involved): one phase when the event is <em>triggered</em>,
033 * and the other when the event is <em>executed</em>.   {@link EventAssignment} objects
034 * are interpreted when an event is executed.  The effects are described
035 * below.
036 <p>
037 * <h2>The attribute 'variable'</h2>
038 <p>
039 * The {@link EventAssignment} attribute 'variable' must be the identifier of an
040 * existing {@link Compartment}, {@link Species}, {@link SpeciesReference}, or {@link Parameter}
041 * instance defined in the model.  When the event is executed, the value of
042 * the model component identified by 'variable' is changed by the
043 * {@link EventAssignment} to the value computed by the 'math' element; that is, a
044 * species' quantity, species reference's stoichiometry, compartment's size
045 * or parameter's value are reset to the value computed by 'math'.
046 <p>
047 * Certain restrictions are placed on what can appear in 'variable':
048 * <ul>
049 * <li> The object identified by the value of the {@link EventAssignment} attribute
050 * 'variable' must not have its 'constant' attribute set to or default to
051 * <code>true.</code>  (Constants cannot be affected by events.)
052 <p>
053 * <li> The 'variable' attribute must not contain the identifier of a
054 * reaction; only species, species references, compartment and parameter
055 * values may be set by an {@link Event}.
056 <p>
057 * <li> The value of every 'variable' attribute must be unique among the set
058 * of {@link EventAssignment} structures within a given {@link Event} structure.  In other
059 * words, a single event cannot have multiple {@link EventAssignment} objects
060 * assigning the same variable.  (All of them would be performed at the
061 * same time when that particular {@link Event} triggers, resulting in
062 * indeterminacy.)  However, <em>separate</em> {@link Event} instances can refer to the
063 * same variable.
064 <p>
065 * <li> A variable cannot be assigned a value in an {@link EventAssignment} object
066 * instance and also be assigned a value by an {@link AssignmentRule}; i.e., the
067 * value of an {@link EventAssignment}'s 'variable' attribute cannot be the same as
068 * the value of a {@link AssignmentRule}' 'variable' attribute.  (Assignment rules
069 * hold at all times, therefore it would be inconsistent to also define an
070 * event that reassigns the value of the same variable.)
071 * </ul>
072 <p>
073 * Note that the time of assignment of the object identified by the
074 * value of the 'variable' attribute is always the time at which the {@link Event}
075 * is <em>executed</em>, not when it is <em>triggered</em>.  The timing is
076 * controlled by the optional {@link Delay} in an {@link Event}.  The time of
077 * assignment is not affected by the 'useValuesFromTriggerTime'
078 * attribute on Eventmdash;that attribute affects the time at which the
079 * {@link EventAssignment}'s 'math' expression is <em>evaluated</em>.  In other
080 * words, SBML allows decoupling the time at which the
081 * 'variable' is assigned from the time at which its value
082 * expression is calculated.
083 <p>
084 * <h2>The 'math' subelement in an {@link EventAssignment}</h2>
085 <p>
086 * The MathML expression contained in an {@link EventAssignment} defines the new
087 * value of the variable being assigned by the {@link Event}.
088 <p>
089 * As mentioned above, the time at which the expression in 'math' is
090 * evaluated is determined by the attribute 'useValuesFromTriggerTime' on
091 * {@link Event}.  If the attribute value is <code>true</code>, the expression must be
092 * evaluated when the event is <em>triggered</em>; more precisely, the values of
093 * identifiers occurring in MathML <code>&lt;ci&gt;</code> elements in the
094 * {@link EventAssignment}'s 'math' expression are the values they have at the
095 * point when the event <em>triggered</em>.  If, instead,
096 * 'useValuesFromTriggerTime''s value is <code>false</code>, it means the values at
097 * <em>execution</em> time should be used; that is, the values of identifiers
098 * occurring in MathML <code>&lt;ci&gt;</code> elements in the
099 * {@link EventAssignment}'s 'math' expression are the values they have at the
100 * point when the event <em>executed</em>.
101 <p>
102 * <h2>SBML Level/Version differences</h2>
103 <p>
104 * Between Version&nbsp;4 and previous versions of SBML Level&nbsp;2, the
105 * requirements regarding the matching of units between an
106 * EvengAssignment's formula and the units of the object identified by the
107 * 'variable' attribute changed.  Previous versions required consistency,
108 * but in SBML Level&nbsp;2 Version&nbsp;4 and in SBML Level&nbsp;3, unit
109 * consistency is only <em>recommended</em>.  More precisely:
110 * <ul>
111 <p>
112 * <li> In the case of a species, an {@link EventAssignment} sets the referenced
113 * species' quantity (concentration or amount of substance) to the value
114 * determined by the formula in the {@link EventAssignment}'s 'math' subelement.
115 * The units of the 'math' formula should (in SBML Level&nbsp;2
116 * Version&nbsp;4 and in Level&nbsp;3) or must (in previous Versions of
117 * Level&nbsp;2) be identical to the units of the species.
118 <p>
119 * <li> (SBML Level&nbsp;3 only.) In the case of a species reference, an
120 * {@link EventAssignment} sets the stoichiometry of the reactant or product
121 * referenced by the {@link SpeciesReference} object to the value determined by the
122 * formula in the 'math' element.  The unit associated with the value
123 * produced by the 'math' formula should be <code>dimensionless</code>, because
124 * reactant and product stoichiometries in reactions are dimensionless
125 * quantities.
126 <p>
127 * <li> In the case of a compartment, an {@link EventAssignment} sets the
128 * referenced compartment's size to the size determined by the formula in
129 * the 'math' subelement of the {@link EventAssignment}.  The overall units of the
130 * formula should (in SBML Level&nbsp;2 Version&nbsp;4 and in Level&nbsp;3)
131 * or must (in previous Versions of Level&nbsp;2) be identical to the units
132 * specified for the size of the compartment identified by the
133 * {@link EventAssignment}'s 'variable' attribute.
134 <p>
135 * <li> In the case of a parameter, an {@link EventAssignment} sets the referenced
136 * parameter's value to that determined by the formula in 'math'.  The
137 * overall units of the formula should (in SBML Level&nbsp;2 Version&nbsp;4
138 * and Level&nbsp;3) or must (in previous Versions of Level&nbsp;2) be
139 * identical to the units defined for the parameter.
140 * </ul>
141 <p>
142 * Note that the formula placed in the 'math' element <em>has no assumed
143 * units</em>.  The consistency of the units of the formula, and the units
144 * of the entity which the assignment affects, must be explicitly
145 * established just as in the case of the value of the {@link Delay} subelement.
146 * An approach similar to the one discussed in the context of {@link Delay} may be
147 * used for the formula of an {@link EventAssignment}.
148 <p>
149 * @see Event
150 */
151
152public class EventAssignment extends SBase {
153   private long swigCPtr;
154
155   protected EventAssignment(long cPtr, boolean cMemoryOwn)
156   {
157     super(libsbmlJNI.EventAssignment_SWIGUpcast(cPtr), cMemoryOwn);
158     swigCPtr = cPtr;
159   }
160
161   protected static long getCPtr(EventAssignment obj)
162   {
163     return (obj == null) ? 0 : obj.swigCPtr;
164   }
165
166   protected static long getCPtrAndDisown (EventAssignment obj)
167   {
168     long ptr = 0;
169
170     if (obj != null)
171     {
172       ptr             = obj.swigCPtr;
173       obj.swigCMemOwn = false;
174     }
175
176     return ptr;
177   }
178
179  protected void finalize() {
180    delete();
181  }
182
183  public synchronized void delete() {
184    if (swigCPtr != 0) {
185      if (swigCMemOwn) {
186        swigCMemOwn = false;
187        libsbmlJNI.delete_EventAssignment(swigCPtr);
188      }
189      swigCPtr = 0;
190    }
191    super.delete();
192  }
193
194  
195/**
196   * Creates a new {@link EventAssignment} using the given SBML <code>level</code> and <code>version</code>
197   * values.
198   <p>
199   * @param level a long integer, the SBML Level to assign to this {@link EventAssignment}
200   <p>
201   * @param version a long integer, the SBML Version to assign to this
202   * {@link EventAssignment}
203   <p>
204   * @throws SBMLConstructorException 
205   * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind
206   * of SBML object, are either invalid or mismatched with respect to the
207   * parent {@link SBMLDocument} object.
208   <p>
209   * <p>
210 * @note Upon the addition of a {@link EventAssignment} object to an {@link SBMLDocument}
211 * (e.g., using {@link Event#addEventAssignment(EventAssignment ea)}), 
212 * the SBML Level, SBML Version and XML namespace of the document 
213 * <em>override</em> the values used when creating the {@link EventAssignment} object via
214 * this constructor.  This is necessary to ensure that an SBML document
215 * is a consistent structure.  Nevertheless, the ability to supply the
216 * values at the time of creation of a {@link EventAssignment} is an important
217 * aid to producing valid SBML.  Knowledge of the intented SBML Level and
218 * Version determine whether it is valid to assign a particular value to
219 * an attribute, or whether it is valid to add an object to an existing
220 * {@link SBMLDocument}.
221   */ public
222 EventAssignment(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
223    this(libsbmlJNI.new_EventAssignment__SWIG_0(level, version), true);
224  }
225
226  
227/**
228   * Creates a new {@link EventAssignment} using the given {@link SBMLNamespaces} object
229   * <code>sbmlns</code>.
230   <p>
231   * <p>
232 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces
233 * information.  It is used to communicate the SBML Level, Version, and (in
234 * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
235 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an
236 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object
237 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 
238   <p>
239   * @param sbmlns an {@link SBMLNamespaces} object.
240   <p>
241   * @throws SBMLConstructorException 
242   * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind
243   * of SBML object, are either invalid or mismatched with respect to the
244   * parent {@link SBMLDocument} object.
245   <p>
246   * <p>
247 * @note Upon the addition of a {@link EventAssignment} object to an {@link SBMLDocument}
248 * (e.g., using {@link Event#addEventAssignment(EventAssignment ea)}), 
249 * the SBML Level, SBML Version and XML namespace of the document 
250 * <em>override</em> the values used when creating the {@link EventAssignment} object via
251 * this constructor.  This is necessary to ensure that an SBML document
252 * is a consistent structure.  Nevertheless, the ability to supply the
253 * values at the time of creation of a {@link EventAssignment} is an important
254 * aid to producing valid SBML.  Knowledge of the intented SBML Level and
255 * Version determine whether it is valid to assign a particular value to
256 * an attribute, or whether it is valid to add an object to an existing
257 * {@link SBMLDocument}.
258   */ public
259 EventAssignment(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException {
260    this(libsbmlJNI.new_EventAssignment__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true);
261  }
262
263  
264/**
265   * Copy constructor; creates a copy of this {@link EventAssignment}.
266   <p>
267   * @param orig the object to copy.
268   <p>
269   * @throws SBMLConstructorException 
270   * Thrown if the argument <code>orig</code> is <code>null.</code>
271   */ public
272 EventAssignment(EventAssignment orig) throws org.sbml.libsbml.SBMLConstructorException {
273    this(libsbmlJNI.new_EventAssignment__SWIG_2(EventAssignment.getCPtr(orig), orig), true);
274  }
275
276  
277/**
278   * Creates and returns a deep copy of this {@link EventAssignment}.
279   <p>
280   * @return a (deep) copy of this {@link EventAssignment}.
281   */ public
282 EventAssignment cloneObject() {
283    long cPtr = libsbmlJNI.EventAssignment_cloneObject(swigCPtr, this);
284    return (cPtr == 0) ? null : new EventAssignment(cPtr, true);
285  }
286
287  
288/**
289   * Get the value of this {@link EventAssignment}'s 'variable' attribute.
290   <p>
291   * @return the identifier stored in the 'variable' attribute of this
292   * {@link EventAssignment}.
293   */ public
294 String getVariable() {
295    return libsbmlJNI.EventAssignment_getVariable(swigCPtr, this);
296  }
297
298  
299/**
300   * Get the mathematical expression in this {@link EventAssignment}'s 'math'
301   * subelement.
302   <p>
303   * @return the top {@link ASTNode} of an abstract syntax tree representing the
304   * mathematical formula in this {@link EventAssignment}.
305   */ public
306 ASTNode getMath() {
307    long cPtr = libsbmlJNI.EventAssignment_getMath(swigCPtr, this);
308    return (cPtr == 0) ? null : new ASTNode(cPtr, false);
309  }
310
311  
312/**
313   * Predicate for testing whether the attribute 'variable' of this
314   * {@link EventAssignment} is set.
315   <p>
316   * @return <code>true</code> if the 'variable' attribute of this {@link EventAssignment}
317   * is set, <code>false</code> otherwise.
318   */ public
319 boolean isSetVariable() {
320    return libsbmlJNI.EventAssignment_isSetVariable(swigCPtr, this);
321  }
322
323  
324/**
325   * Predicate for testing whether the 'math' subelement of this
326   * {@link EventAssignment} is set.
327   <p>
328   * @return <code>true</code> if this {@link EventAssignment} has a 'math' subelement,
329   * <code>false</code> otherwise.
330   */ public
331 boolean isSetMath() {
332    return libsbmlJNI.EventAssignment_isSetMath(swigCPtr, this);
333  }
334
335  
336/**
337   * Sets the attribute 'variable' of this {@link EventAssignment} to a copy of
338   * the given identifier string.
339   <p>
340   * @param sid the identifier of a {@link Compartment}, {@link Species} or (global)
341   * {@link Parameter} defined in this model.
342   <p>
343   * @return integer value indicating success/failure of the
344   * function.   The possible values
345   * returned by this function are:
346   * <ul>
347   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
348   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
349   * </ul>
350   */ public
351 int setVariable(String sid) {
352    return libsbmlJNI.EventAssignment_setVariable(swigCPtr, this, sid);
353  }
354
355  
356/**
357   * Sets the 'math' subelement of this {@link EventAssignment} to a copy of the
358   * given {@link ASTNode}.
359   <p>
360   * @param math an {@link ASTNode} that will be copied and stored as the
361   * mathematical formula for this {@link EventAssignment}.
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_OBJECT LIBSBML_INVALID_OBJECT }
369   * </ul>
370   */ public
371 int setMath(ASTNode math) {
372    return libsbmlJNI.EventAssignment_setMath(swigCPtr, this, ASTNode.getCPtr(math), math);
373  }
374
375  
376/**
377   * Calculates and returns a {@link UnitDefinition} that expresses the units of
378   * measurement assumed for the 'math' expression of this {@link EventAssignment}.
379   <p>
380   * <p>
381 * The units are calculated based on the mathematical expression in the
382 * {@link EventAssignment} and the model quantities referenced by
383 * <code>&lt;ci&gt;</code> elements used within that expression.  The method
384 * {@link EventAssignment#getDerivedUnitDefinition()} returns the calculated units,
385 * to the extent that libSBML can compute them. 
386   <p>
387   * <p>
388 * @note The functionality that facilitates unit analysis depends on the
389 * model as a whole.  Thus, in cases where the object has not been added to
390 * a model or the model itself is incomplete, unit analysis is not possible
391 * and this method will return <code>null.</code> 
392   <p>
393   * <p>
394 * @warning <span class='warning'>Note that it is possible the 'math'
395 * expression in the {@link EventAssignment} contains literal numbers or parameters
396 * with undeclared units.  In those cases, it is not possible to calculate
397 * the units of the overall expression without making assumptions.  LibSBML
398 * does not make assumptions about the units, and
399 * {@link EventAssignment#getDerivedUnitDefinition()} only returns the units as far
400 * as it is able to determine them.  For example, in an expression <em>X +
401 * Y</em>, if <em>X</em> has unambiguously-defined units and <em>Y</em> does
402 * not, it will return the units of <em>X</em>.  When using this method,
403 * <strong>it is critical that callers also invoke the method</strong>
404 * {@link EventAssignment#containsUndeclaredUnits()} <strong>to determine whether
405 * this situation holds</strong>.  Callers should take suitable action in
406 * those situations.</span>
407   <p>
408   * @return a {@link UnitDefinition} that expresses the units of the math 
409   * expression of this {@link EventAssignment}, or <code>null</code> if one cannot be constructed.
410   <p>
411   * @see #containsUndeclaredUnits()
412   */ public
413 UnitDefinition getDerivedUnitDefinition() {
414    long cPtr = libsbmlJNI.EventAssignment_getDerivedUnitDefinition__SWIG_0(swigCPtr, this);
415    return (cPtr == 0) ? null : new UnitDefinition(cPtr, false);
416  }
417
418  
419/**
420   * Predicate returning <code>true</code> if the math expression of this
421   * {@link EventAssignment} contains literal numbers or parameters with undeclared
422   * units.
423   <p>
424   * <p>
425 * The units are calculated based on the mathematical expression in the
426 * {@link EventAssignment} and the model quantities referenced by
427 * <code>&lt;ci&gt;</code> elements used within that expression.  The method
428 * {@link EventAssignment#getDerivedUnitDefinition()} returns the calculated units,
429 * to the extent that libSBML can compute them.
430   <p>
431   * If the expression contains literal numbers or parameters with undeclared
432   * units, libSBML may not be able to compute the full units of the
433   * expression and will only return what it can compute.  Callers should
434   * always use {@link EventAssignment#containsUndeclaredUnits()} when using
435   * {@link EventAssignment#getDerivedUnitDefinition()} to decide whether the
436   * returned units may be incomplete.
437   <p>
438   * @return <code>true</code> if the math expression of this {@link EventAssignment}
439   * includes parameters/numbers 
440   * with undeclared units, <code>false</code> otherwise.
441   <p>
442   * @note A return value of <code>true</code> indicates that the {@link UnitDefinition}
443   * returned by {@link EventAssignment#getDerivedUnitDefinition()} may not
444   * accurately represent the units of the expression.
445   <p>
446   * @see #getDerivedUnitDefinition()
447   */ public
448 boolean containsUndeclaredUnits() {
449    return libsbmlJNI.EventAssignment_containsUndeclaredUnits__SWIG_0(swigCPtr, this);
450  }
451
452  
453/**
454   * Returns the libSBML type code of this object instance.
455   <p>
456   * <p>
457 * LibSBML attaches an identifying code to every kind of SBML object.  These
458 * are integer constants known as <em>SBML type codes</em>.  The names of all
459 * the codes begin with the characters &ldquo;<code>SBML_</code>&rdquo;. 
460 * In the Java language interface for libSBML, the
461 * type codes are defined as static integer constants in the interface class
462 * {@link libsbmlConstants}.    Note that different Level&nbsp;3 
463 * package plug-ins may use overlapping type codes; to identify the package
464 * to which a given object belongs, call the <code>getPackageName()</code>
465 * method on the object.
466   <p>
467   * @return the SBML type code for this object:
468   * {@link  libsbmlConstants#SBML_EVENT_ASSIGNMENT SBML_EVENT_ASSIGNMENT} (default).
469   <p>
470   * <p>
471 * @warning <span class='warning'>The specific integer values of the possible
472 * type codes may be reused by different Level&nbsp;3 package plug-ins.
473 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
474 * both getTypeCode() and getPackageName()</strong>.</span>
475   <p>
476   * @see #getElementName()
477   * @see #getPackageName()
478   */ public
479 int getTypeCode() {
480    return libsbmlJNI.EventAssignment_getTypeCode(swigCPtr, this);
481  }
482
483  
484/**
485   * Returns the XML element name of this object, which for
486   * {@link EventAssignment}, is always <code>'eventAssignment'.</code>
487   <p>
488   * @return the name of this element, i.e., <code>'eventAssignment'.</code> 
489   */ public
490 String getElementName() {
491    return libsbmlJNI.EventAssignment_getElementName(swigCPtr, this);
492  }
493
494  
495/**
496   * Predicate returning <code>true</code> if all the required attributes for this
497   * {@link EventAssignment} object have been set.
498   <p>
499   * @note The required attributes for a {@link EventAssignment} object are:
500   * <ul>
501   * <li> 'variable'
502   *
503   * </ul> <p>
504   * @return a boolean value indicating whether all the required
505   * attributes for this object have been defined.
506   */ public
507 boolean hasRequiredAttributes() {
508    return libsbmlJNI.EventAssignment_hasRequiredAttributes(swigCPtr, this);
509  }
510
511  
512/**
513   * Predicate returning <code>true</code> if all the required elements for this
514   * {@link EventAssignment} object have been set.
515   <p>
516   * @note The required elements for a {@link EventAssignment} object are:
517   * <ul>
518   * <li> 'math'
519   *
520   * </ul> <p>
521   * @return a boolean value indicating whether all the required
522   * elements for this object have been defined.
523   */ public
524 boolean hasRequiredElements() {
525    return libsbmlJNI.EventAssignment_hasRequiredElements(swigCPtr, this);
526  }
527
528  
529/** * @internal */ public
530 String getId() {
531    return libsbmlJNI.EventAssignment_getId(swigCPtr, this);
532  }
533
534  
535/**
536   * Renames all the <code>SIdRef</code> attributes on this element, including any
537   * found in MathML.
538   <p>
539   * <p>
540 * In SBML, object identifiers are of a data type called <code>SId</code>.
541 * In SBML Level&nbsp;3, an explicit data type called <code>SIdRef</code> was
542 * introduced for attribute values that refer to <code>SId</code> values; in
543 * previous Levels of SBML, this data type did not exist and attributes were
544 * simply described to as 'referring to an identifier', but the effective
545 * data type was the same as <code>SIdRef</code>in Level&nbsp;3.  These and
546 * other methods of libSBML refer to the type <code>SIdRef</code> for all
547 * Levels of SBML, even if the corresponding SBML specification did not
548 * explicitly name the data type.
549   <p>
550   * This method works by looking at all attributes and (if appropriate)
551   * mathematical formulas, comparing the identifiers to the value of 
552   * <code>oldid</code>.  If any matches are found, the matching identifiers are replaced
553   * with <code>newid</code>.  The method does <em>not</em> descend into child elements.
554   <p>
555   * @param oldid the old identifier
556   * @param newid the new identifier
557   */ public
558 void renameSIdRefs(String oldid, String newid) {
559    libsbmlJNI.EventAssignment_renameSIdRefs(swigCPtr, this, oldid, newid);
560  }
561
562  
563/**
564   * Renames all the <code>UnitSIdRef</code> attributes on this element.
565   <p>
566   * <p>
567 * In SBML, unit definitions have identifiers of type <code>UnitSId</code>.  In
568 * SBML Level&nbsp;3, an explicit data type called <code>UnitSIdRef</code> was
569 * introduced for attribute values that refer to <code>UnitSId</code> values; in
570 * previous Levels of SBML, this data type did not exist and attributes were
571 * simply described to as 'referring to a unit identifier', but the effective
572 * data type was the same as <code>UnitSIdRef</code> in Level&nbsp;3.  These and
573 * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all
574 * Levels of SBML, even if the corresponding SBML specification did not
575 * explicitly name the data type.
576   <p>
577   * This method works by looking at all unit identifier attribute values
578   * (including, if appropriate, inside mathematical formulas), comparing the
579   * unit identifiers to the value of <code>oldid</code>.  If any matches are found,
580   * the matching identifiers are replaced with <code>newid</code>.  The method does
581   * <em>not</em> descend into child elements.
582   <p>
583   * @param oldid the old identifier
584   * @param newid the new identifier
585   */ public
586 void renameUnitSIdRefs(String oldid, String newid) {
587    libsbmlJNI.EventAssignment_renameUnitSIdRefs(swigCPtr, this, oldid, newid);
588  }
589
590  
591/**
592   * Replace all nodes with the name 'id' from the child 'math' object with the provided function. 
593   * @internal 
594   */ public
595 void replaceSIDWithFunction(String id, ASTNode function) {
596    libsbmlJNI.EventAssignment_replaceSIDWithFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function);
597  }
598
599  
600/**
601   * If this assignment assigns a value to the 'id' element, replace the 'math' object with the function (existing/function). 
602   * @internal 
603   */ public
604 void divideAssignmentsToSIdByFunction(String id, ASTNode function) {
605    libsbmlJNI.EventAssignment_divideAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function);
606  }
607
608  
609/**
610   * If this assignment assigns a value to the 'id' element, replace the 'math' object with the function (existing*function). 
611   * @internal 
612   */ public
613 void multiplyAssignmentsToSIdByFunction(String id, ASTNode function) {
614    libsbmlJNI.EventAssignment_multiplyAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function);
615  }
616
617}