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