001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.8
004 *
005 * Do not make changes to this file unless you know what you are doing--modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.sbml.libsbml;
010
011/** 
012 *  A discontinuous SBML <em>event</em>.
013 <p>
014 * An SBML {@link Event} object defines when the event can occur, the variables
015 * that are affected by it, how the variables are affected, and the event's
016 * relationship to other events.  The effect of the event can optionally be
017 * delayed after the occurrence of the condition which invokes it.
018 <p>
019 * The operation of {@link Event} is divided into two phases (even when the event
020 * is not delayed): one when the event is <em>triggered</em>, and the other when
021 * the event is <em>executed</em>.  {@link Trigger} objects define the conditions for
022 * triggering an event, {@link Delay} objects define when the event is actually
023 * executed, {@link EventAssignment} objects define the effects of executing the
024 * event, and (in SBML Level&nbsp;3) {@link Priority} objects influence the order
025 * of {@link EventAssignment} performance in cases of simultaneous events.  Please
026 * consult the descriptions of {@link Trigger}, {@link Delay}, {@link EventAssignment} and {@link Priority}
027 * for more information.
028 <p>
029 * <h2>SBML Level/Version differences</h2>
030 <p>
031 * <h3>SBML Level 3</h3>
032 <p>
033 * SBML Level 3 introduces several changes to the structure and components
034 * of Events compared to SBML Level&nbsp;2.  These changes fall into two
035 * main categories: changes to what is optional or required, and additions
036 * of new attributes and elements.
037 * <ul>
038 * <li> The attribute 'useValuesFromTriggerTime' on {@link Event} is mandatory (it
039 * was optional in Level&nbsp;2);
040 * <li> {@link Event}'s 'listOfEventAssignments' element (of class
041 * {@link ListOfEventAssignments}) is optional (it was mandatory in Level&nbsp;2);
042 * <li> {@link Event}'s 'priority' element (of class {@link Priority}) is new in
043 * Level&nbsp;3; and
044 * <li> The {@link Trigger} object gains new mandatory attributes (described as part
045 * of the definition of {@link Trigger}).
046 * </ul>
047 <p>
048 * The changes to the attributes of {@link Event} are described below; the changes
049 * to {@link Trigger} and {@link Priority} are described in their respective sections.
050 <p>
051 * <h3>SBML Level 2</h3>
052 <p>
053 * In SBML Level&nbsp;2 versions before Version&nbsp;4, the semantics of
054 * {@link Event} time delays were defined such that the expressions in the event's
055 * assignments were always evaluated at the time the event was
056 * <em>triggered</em>.  This definition made it difficult to define an event
057 * whose assignment formulas were meant to be evaluated at the time the
058 * event was <em>executed</em> (i.e., after the time period defined by the
059 * value of the {@link Delay} element).  In SBML Level&nbsp;2 Version&nbsp;4 and in
060 * Level&nbsp;3, the attribute 'useValuesFromTriggerTime' on {@link Event} allows a
061 * model to indicate the time at which the event's assignments are intended
062 * the values of the assignment formulas are computed at the moment the
063 * event is triggered, not after the delay.  If 'useValuesFromTriggerTime'=
064 * <code>false</code>, it means that the formulas in the event's assignments are to be
065 * computed <em>after</em> the delay, at the time the event is executed.
066 <p>
067 * The definition of {@link Event} in SBML Level&nbsp;2 Versions 1 and 2 includes
068 * an additional attribute called 'timeUnits', which allowed the time units
069 * of the {@link Delay} to be set explicitly.  Later Versions of SBML Level&nbsp;2
070 * as well as SBML Level&nbsp;3 do not define this attribute.  LibSBML
071 * supports this attribute for compatibility with previous versions of SBML
072 * Level&nbsp;2; however, if a model in SBML Level&nbsp;3 or Level&nbsp;2
073 * Versions&nbsp;3&ndash;4 format sets the attribute, the
074 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report
075 * an error.
076 <p>
077 * The attribute 'useValuesFromTriggerTime' was introduced in SBML
078 * Level&nbsp;2 Version&nbsp;4.  Models defined in prior Versions of SBML
079 * Level&nbsp;2 cannot use this attribute, and
080 * {@link SBMLDocument#checkConsistency()} will report an error if they do.
081 <p>
082 * <h2>Semantics of events in SBML Level 3 Version&nbsp;1</h2>
083 <p>
084 * The detailed semantics of events are described in the specification
085 * documents for each SBML Level/Version.  Here we include the description
086 * from the SBML Level&nbsp;1 Version&nbsp;1.
087 * Any transition of a {@link Trigger} object's 'math' formula from the value 
088 * <code>false</code> to <code>true</code> will cause the enclosing {@link Event} object to
089 * <em>trigger</em>.  Such a transition is not possible at the very start
090 * of a simulation (i.e., at time <em>t = 0</em>) unless the {@link Trigger}
091 * object's 'initialValue' attribute has a value of <code>false</code>; this defines
092 * the value of the trigger formula to be <code>false</code> immediately prior to the
093 * start of simulation, thereby giving it the potential to change in value
094 * from <code>false</code> to <code>true</code> when the formula is evaluated at <em>t =
095 * 0</em>.  If 'initialValue'=<code>true</code>, then the trigger expression cannot
096 * transition from <code>false</code> to <code>true</code> at <em>t = 0</em> but may do so at
097 * some time <em>t > 0</em>.
098 <p>
099 * Consider an {@link Event} object definition <EM>E</EM> with delay <em>d</em> in
100 * which the {@link Trigger} object's 'math' formula makes a transition in value
101 * from <code>false</code> to <code>true</code> at times <em>t<sub>1</sub></em> and
102 * <em>t<sub>2</sub></em>.  The {@link EventAssignment} within the {@link Event} object
103 * will have effect at <em>t<sub>1</sub> + d</em> and
104 * <em>t<sub>2</sub> + d</em> irrespective of the relative times of
105 * <em>t<sub>1</sub></em> and <em>t<sub>2</sub></em>.  For example, events
106 * can 'overlap' so that <em>t<sub>1</sub> < t<sub>2</sub> <
107 * t<sub>1</sub> + d</em> still causes an event assignments to occur at
108 * <em>t<sub>1</sub> + d</em> and <em>t<sub>2</sub> + d</em>.
109 <p>
110 * It is entirely possible for two events to be executed simultaneously,
111 * and it is possible for events to trigger other events (i.e., an event
112 * assignment can cause an event to trigger).  This leads to several
113 * points:
114 * <ul>
115 <p>
116 * <li> A software package should retest all event triggers after executing
117 * an event assignment in order to account for the possibility that the
118 * assignment causes another event trigger to transition from <code>false</code> to
119 * <code>true.</code>  This check should be made after each individual {@link Event} object's
120 * execution, even when several events are to be executed simultaneously.
121 <p>
122 * <li> Any {@link Event} object whose {@link Trigger} 'persistent' attribute has the value
123 * <code>false</code> must have its trigger expression reevaluated continuously
124 * between when the event is triggered and when it is executed.  If
125 * its trigger expression ever evaluates to <code>false</code>, it must be removed
126 * from the queue of events pending execution and treated as any other
127 * event whose trigger expression evaluates to <code>false.</code>
128 <p>
129 * <li> Although the precise time at which events are executed is not
130 * resolved beyond the given execution point in simulated time, it is
131 * assumed that the order in which the events occur <em>is</em> resolved.
132 * This order can be significant in determining the overall outcome of a
133 * given simulation.  When an event <EM>X</EM> <em>triggers</em> another
134 * event <EM>Y</EM> and event <EM>Y</EM> has zero delay, then event
135 * <EM>Y</EM> is added to the existing set of simultaneous events that are
136 * pending <em>execution</em>.  Events <EM>X</EM> and <EM>Y</EM> form a
137 * cascade of events at the same point in simulation time.  An event such
138 * as <EM>Y</EM> may have a special priority if it contains a {@link Priority}
139 * subobject.
140 <p>
141 * <li> All events in a model are open to being in a cascade.  The position
142 * of an event in the event queue does not affect whether it can be in the
143 * cascade: event <EM>Y</EM> can be triggered whether it is before or after
144 * <EM>X</EM> in the queue of events pending execution.  A cascade of
145 * events can be potentially infinite (never terminate); when this occurs a
146 * simulator should indicate this has occurred&mdash;it is incorrect for a
147 * simulator to break a cascade arbitrarily and continue the simulation
148 * without at least indicating that the infinite cascade occurred.
149 <p>
150 * <li> Simultaneous events having no defined priorities are executed in an
151 * undefined order.  This does not mean that the behavior of the simulation
152 * is completely undefined; merely that the <em>order</em> of execution of
153 * these particular events is undefined.  A given simulator may use any
154 * algorithm to choose an order as long as every event is executed exactly
155 * once.
156 <p>
157 * <li> Events with defined priorities are executed in the order implied by
158 * their {@link Priority} 'math' formula values, with events having higher
159 * priorities being executed ahead of events with lower priorities, and
160 * events with identical priorities being executed in a random order with
161 * respect to one another (as determined at run-time by some random
162 * algorithm equivalent to coin-flipping).  Newly-triggered events that are
163 * to be executed immediately (i.e., if they define no delays) should be
164 * inserted into the queue of events pending execution according to their
165 * priorities: events with higher priority values value must be inserted
166 * ahead of events with lower priority values and after any pending events
167 * with even higher priorities, and inserted randomly among pending events
168 * with the same priority values.  Events without {@link Priority} objects must be
169 * inserted into the queue in some fashion, but the algorithm used to place
170 * it in the queue is undefined.  Similarly, there is no restriction on the
171 * order of a newly-inserted event with a defined {@link Priority} with respect to
172 * any other pending {@link Event} without a defined {@link Priority}.
173 <p>
174 * <li> A model variable that is the target of one or more event
175 * assignments can change more than once when simultaneous events are
176 * processed at some time point <em>t</em>.  The model's behavior (output)
177 * for such a variable is the value of the variable at the end of
178 * processing all the simultaneous events at time <em>t</em>.
179 <p>
180 * </ul>
181 <p>
182 * @see Trigger
183 * @see Priority
184 * @see Delay
185 * @see EventAssignment
186 */
187
188public class Event extends SBase {
189   private long swigCPtr;
190
191   protected Event(long cPtr, boolean cMemoryOwn)
192   {
193     super(libsbmlJNI.Event_SWIGUpcast(cPtr), cMemoryOwn);
194     swigCPtr = cPtr;
195   }
196
197   protected static long getCPtr(Event obj)
198   {
199     return (obj == null) ? 0 : obj.swigCPtr;
200   }
201
202   protected static long getCPtrAndDisown (Event obj)
203   {
204     long ptr = 0;
205
206     if (obj != null)
207     {
208       ptr             = obj.swigCPtr;
209       obj.swigCMemOwn = false;
210     }
211
212     return ptr;
213   }
214
215  protected void finalize() {
216    delete();
217  }
218
219  public synchronized void delete() {
220    if (swigCPtr != 0) {
221      if (swigCMemOwn) {
222        swigCMemOwn = false;
223        libsbmlJNI.delete_Event(swigCPtr);
224      }
225      swigCPtr = 0;
226    }
227    super.delete();
228  }
229
230  
231/**
232   * Creates a new {@link Event} using the given SBML <code>level</code> and <code>version</code>
233   * values.
234   <p>
235   * @param level a long integer, the SBML Level to assign to this {@link Event}
236   <p>
237   * @param version a long integer, the SBML Version to assign to this
238   * {@link Event}
239   <p>
240   * <p>
241 * @throws SBMLConstructorException
242 * Thrown if the given <code>level</code> and <code>version</code> combination are invalid
243 * or if this object is incompatible with the given level and version.
244   <p>
245   * <p>
246 * @note Attempting to add an object to an {@link SBMLDocument} having a different
247 * combination of SBML Level, Version and XML namespaces than the object
248 * itself will result in an error at the time a caller attempts to make the
249 * addition.  A parent object must have compatible Level, Version and XML
250 * namespaces.  (Strictly speaking, a parent may also have more XML
251 * namespaces than a child, but the reverse is not permitted.)  The
252 * restriction is necessary to ensure that an SBML model has a consistent
253 * overall structure.  This requires callers to manage their objects
254 * carefully, but the benefit is increased flexibility in how models can be
255 * created by permitting callers to create objects bottom-up if desired.  In
256 * situations where objects are not yet attached to parents (e.g.,
257 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
258 * libSBML determine such things as whether it is valid to assign a
259 * particular value to an attribute.
260   */ public
261 Event(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
262    this(libsbmlJNI.new_Event__SWIG_0(level, version), true);
263  }
264
265  
266/**
267   * Creates a new {@link Event} using the given {@link SBMLNamespaces} object
268   * <code>sbmlns</code>.
269   <p>
270   * <p>
271 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces
272 * information.  It is used to communicate the SBML Level, Version, and (in
273 * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
274 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an
275 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object
276 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 
277   <p>
278   * @param sbmlns an {@link SBMLNamespaces} object.
279   <p>
280   * <p>
281 * @throws SBMLConstructorException
282 * Thrown if the given <code>sbmlns</code> is inconsistent or incompatible
283 * with this object.
284   <p>
285   * <p>
286 * @note Attempting to add an object to an {@link SBMLDocument} having a different
287 * combination of SBML Level, Version and XML namespaces than the object
288 * itself will result in an error at the time a caller attempts to make the
289 * addition.  A parent object must have compatible Level, Version and XML
290 * namespaces.  (Strictly speaking, a parent may also have more XML
291 * namespaces than a child, but the reverse is not permitted.)  The
292 * restriction is necessary to ensure that an SBML model has a consistent
293 * overall structure.  This requires callers to manage their objects
294 * carefully, but the benefit is increased flexibility in how models can be
295 * created by permitting callers to create objects bottom-up if desired.  In
296 * situations where objects are not yet attached to parents (e.g.,
297 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
298 * libSBML determine such things as whether it is valid to assign a
299 * particular value to an attribute.
300   */ public
301 Event(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException {
302    this(libsbmlJNI.new_Event__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true);
303  }
304
305  
306/**
307   * Copy constructor; creates a copy of this {@link Event}.
308   <p>
309   * @param orig the object to copy.
310   */ public
311 Event(Event orig) throws org.sbml.libsbml.SBMLConstructorException {
312    this(libsbmlJNI.new_Event__SWIG_2(Event.getCPtr(orig), orig), true);
313  }
314
315  
316/**
317   * Creates and returns a deep copy of this {@link Event} object.
318   <p>
319   * @return the (deep) copy of this {@link Event} object.
320   */ public
321 Event cloneObject() {
322    long cPtr = libsbmlJNI.Event_cloneObject(swigCPtr, this);
323    return (cPtr == 0) ? null : new Event(cPtr, true);
324  }
325
326  
327/**
328   * Initializes the fields of this {@link Event} object to 'typical' default
329   * values.
330   <p>
331   * The SBML {@link Event} component has slightly different aspects and
332   * default attribute values in different SBML Levels and Versions.
333   * This method sets the values to certain common defaults, based
334   * mostly on what they are in SBML Level&nbsp;2.  Specifically:
335   <p>
336   * <ul>
337   * <li> Sets attribute 'spatialDimensions' to <code>3</code>
338   * </ul>
339   */ public
340 void initDefaults() {
341    libsbmlJNI.Event_initDefaults(swigCPtr, this);
342  }
343
344  
345/**
346   * Returns the first child element found that has the given <code>id</code> in the
347   * model-wide SId namespace, or <code>null</code> if no such object is found.
348   <p>
349   * @param id string representing the id of objects to find
350   <p>
351   * @return pointer to the first element found with the given <code>id</code>.
352   */ public
353 SBase getElementBySId(String id) {
354  return libsbml.DowncastSBase(libsbmlJNI.Event_getElementBySId(swigCPtr, this, id), false);
355}
356
357  
358/**
359   * Returns the first child element it can find with the given <code>metaid</code>, or
360   * <code>null</code> if no such object is found.
361   <p>
362   * @param metaid string representing the metaid of objects to find
363   <p>
364   * @return pointer to the first element found with the given <code>metaid</code>.
365   */ public
366 SBase getElementByMetaId(String metaid) {
367  return libsbml.DowncastSBase(libsbmlJNI.Event_getElementByMetaId(swigCPtr, this, metaid), false);
368}
369
370  
371/**
372   * Returns the value of the 'id' attribute of this {@link Event}.
373   <p>
374   * @return the id of this {@link Event}.
375   */ public
376 String getId() {
377    return libsbmlJNI.Event_getId(swigCPtr, this);
378  }
379
380  
381/**
382   * Returns the value of the 'name' attribute of this {@link Event}.
383   <p>
384   * @return the name of this {@link Event}.
385   */ public
386 String getName() {
387    return libsbmlJNI.Event_getName(swigCPtr, this);
388  }
389
390  
391/**
392   * Get the event trigger portion of this {@link Event}.
393   <p>
394   * @return the {@link Trigger} object of this {@link Event}.
395   */ public
396 Trigger getTrigger() {
397    long cPtr = libsbmlJNI.Event_getTrigger__SWIG_0(swigCPtr, this);
398    return (cPtr == 0) ? null : new Trigger(cPtr, false);
399  }
400
401  
402/**
403   * Get the assignment delay portion of this {@link Event}, if there is one.
404   <p>
405   * @return the delay of this {@link Event} if one is defined, or <code>null</code> if none
406   * is defined.
407   */ public
408 Delay getDelay() {
409    long cPtr = libsbmlJNI.Event_getDelay__SWIG_0(swigCPtr, this);
410    return (cPtr == 0) ? null : new Delay(cPtr, false);
411  }
412
413  
414/**
415   * (SBML Level&nbsp;3 only) Get the event priority portion of this
416   * {@link Event}.
417   <p>
418   * @return the {@link Priority} object of this {@link Event}.
419   <p>
420   * @note The element 'priority' is available in SBML Level&nbsp;3
421   * Version&nbsp;1 Core, but is not present in lower Levels of SBML.
422   */ public
423 Priority getPriority() {
424    long cPtr = libsbmlJNI.Event_getPriority__SWIG_0(swigCPtr, this);
425    return (cPtr == 0) ? null : new Priority(cPtr, false);
426  }
427
428  
429/**
430   * Get the value of the 'timeUnits' attribute of this {@link Event}, if it has one.
431   <p>
432   * @return the value of the attribute 'timeUnits' as a string.
433   <p>
434   * <p>
435 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2
436 * Versions&nbsp;1 and&nbsp;2 included the additional attribute called
437 * 'timeUnits', but it was removed in SBML Level&nbsp;2 Version&nbsp;3.
438 * LibSBML supports this attribute for compatibility with previous versions
439 * of SBML Level&nbsp;2, but its use is discouraged since models in
440 * Level&nbsp;2 Versions&nbsp;3 and&nbsp;4 cannot contain it.  If a
441 * Version&nbsp;3 or&nbsp;4 model sets the attribute, the
442 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report
443 * an error.</span>
444   */ public
445 String getTimeUnits() {
446    return libsbmlJNI.Event_getTimeUnits(swigCPtr, this);
447  }
448
449  
450/**
451   * Get the value of the 'useValuesFromTriggerTime' attribute of this {@link Event}.
452   <p>
453   * <p>
454 * The optional {@link Delay} on {@link Event} means there are two times to consider when
455 * computing the results of an event: the time at which the event is
456 * <em>triggered</em>, and the time at which assignments are
457 * <em>executed</em>.  It is also possible to distinguish between the
458 * time at which the {@link EventAssignment}'s expression is calculated, and the
459 * time at which the assignment is made: the expression could be
460 * evaluated at the same time the assignments are performed, i.e., when
461 * the event is <em>executed</em>, but it could also be defined to be
462 * evaluated at the time the event is <em>triggered</em>.
463 <p>
464 * In SBML Level&nbsp;2 versions prior to Version&nbsp;4, the semantics
465 * of {@link Event} time delays were defined such that the expressions in the
466 * event's assignments were always evaluated at the time the event was
467 * <em>triggered</em>.  This definition made it difficult to define an
468 * event whose assignment formulas were meant to be evaluated at the time
469 * the event was <em>executed</em> (i.e., after the time period defined
470 * by the value of the {@link Delay} element).  In SBML Level&nbsp;2
471 * Version&nbsp;4, the attribute 'useValuesFromTriggerTime' on {@link Event}
472 * allows a model to indicate the time at which the event's assignments
473 * are intended to be evaluated.  In SBML Level&nbsp;2, the attribute has
474 * a default value of <code>true</code>, which corresponds to the interpretation of
475 * event assignments prior to Version&nbsp;4: the values of the
476 * assignment formulas are computed at the moment the event is triggered,
477 * not after the delay.  If 'useValuesFromTriggerTime'=<code>false</code>, it means
478 * that the formulas in the event's assignments are to be computed after
479 * the delay, at the time the event is executed.  In SBML Level&nbsp;3,
480 * the attribute is mandatory, not optional, and all events must specify
481 * a value for it.
482   <p>
483   * @return the value of the attribute 'useValuesFromTriggerTime' as a boolean.
484   <p>
485   * <p>
486 * @warning <span class='warning'>The attribute 'useValuesFromTriggerTime'
487 * was introduced in SBML Level&nbsp;2 Version&nbsp;4.  It is not valid in
488 * models defined using SBML Level&nbsp;2 versions prior to Version&nbsp;4.
489 * If a Level&nbsp;2 Version&nbsp;1&ndash;3 model sets the attribute, the
490 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report
491 * an error.</span> 
492   */ public
493 boolean getUseValuesFromTriggerTime() {
494    return libsbmlJNI.Event_getUseValuesFromTriggerTime(swigCPtr, this);
495  }
496
497  
498/**
499   * Predicate returning <code>true</code> if this
500   * {@link Event}'s 'id' attribute is set.
501   <p>
502   * @return <code>true</code> if the 'id' attribute of this {@link Event} is
503   * set, <code>false</code> otherwise.
504   */ public
505 boolean isSetId() {
506    return libsbmlJNI.Event_isSetId(swigCPtr, this);
507  }
508
509  
510/**
511   * Predicate returning <code>true</code> if this
512   * {@link Event}'s 'name' attribute is set.
513   <p>
514   * @return <code>true</code> if the 'name' attribute of this {@link Event} is
515   * set, <code>false</code> otherwise.
516   */ public
517 boolean isSetName() {
518    return libsbmlJNI.Event_isSetName(swigCPtr, this);
519  }
520
521  
522/**
523   * Predicate for testing whether the trigger for this {@link Event} is set.
524   <p>
525   * @return <code>true</code> if the trigger of this {@link Event} is set, <code>false</code>
526   * otherwise.
527   */ public
528 boolean isSetTrigger() {
529    return libsbmlJNI.Event_isSetTrigger(swigCPtr, this);
530  }
531
532  
533/**
534   * Predicate for testing whether the delay for this {@link Event} is set.
535   <p>
536   * @return <code>true</code> if the delay of this {@link Event} is set, <code>false</code>
537   * otherwise.
538   */ public
539 boolean isSetDelay() {
540    return libsbmlJNI.Event_isSetDelay(swigCPtr, this);
541  }
542
543  
544/**
545   * (SBML Level&nbsp;3 only) Predicate for testing whether the priority
546   * for this {@link Event} is set.
547   <p>
548   * @return <code>true</code> if the priority of this {@link Event} is set, <code>false</code>
549   * otherwise.
550   <p>
551   * @note The element 'priority' is available in SBML Level&nbsp;3
552   * Version&nbsp;1 Core, but is not present in lower Levels of SBML.
553   */ public
554 boolean isSetPriority() {
555    return libsbmlJNI.Event_isSetPriority(swigCPtr, this);
556  }
557
558  
559/**
560   * Predicate for testing whether the 'timeUnits' attribute of this {@link Event}
561   * is set.
562   <p>
563   * @return <code>true</code> if the 'timeUnits' attribute of this {@link Event} is
564   * set, <code>false</code> otherwise.
565   <p>
566   * <p>
567 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2
568 * Versions&nbsp;1 and&nbsp;2 included the additional attribute called
569 * 'timeUnits', but it was removed in SBML Level&nbsp;2 Version&nbsp;3.
570 * LibSBML supports this attribute for compatibility with previous versions
571 * of SBML Level&nbsp;2, but its use is discouraged since models in
572 * Level&nbsp;2 Versions&nbsp;3 and&nbsp;4 cannot contain it.  If a
573 * Version&nbsp;3 or&nbsp;4 model sets the attribute, the
574 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report
575 * an error.</span>
576   */ public
577 boolean isSetTimeUnits() {
578    return libsbmlJNI.Event_isSetTimeUnits(swigCPtr, this);
579  }
580
581  
582/**
583   * Predicate for testing whether the 'useValuesFromTriggerTime' attribute of this {@link Event}
584   * is set.
585   <p>
586   * @return <code>true</code> if the 'useValuesFromTriggerTime' attribute of this {@link Event} is
587   * set, <code>false</code> otherwise.
588   <p>
589   * @note In SBML Level&nbsp;2, this attribute is optional and has a default value of
590   * <code>true</code>, whereas in Level&nbsp;3 Version&nbsp;1, this optional is mandatory and
591   * has no default value.
592   */ public
593 boolean isSetUseValuesFromTriggerTime() {
594    return libsbmlJNI.Event_isSetUseValuesFromTriggerTime(swigCPtr, this);
595  }
596
597  
598/**
599   * Sets the value of the 'id' attribute of this {@link Event}.
600   <p>
601   * The string <code>sid</code> is copied.
602   <p>
603   * <p>
604 * SBML has strict requirements for the syntax of identifiers, that is, the
605 * values of the 'id' attribute present on most types of SBML objects.
606 * The following is a summary of the definition of the SBML identifier type
607 * <code>SId</code>, which defines the permitted syntax of identifiers.  We
608 * express the syntax using an extended form of BNF notation:
609 * <pre style='margin-left: 2em; border: none; font-weight: bold; font-size: 13px; color: black'>
610 * letter .= 'a'..'z','A'..'Z'
611 * digit  .= '0'..'9'
612 * idChar .= letter | digit | '_'
613 * SId    .= ( letter | '_' ) idChar*</pre>
614 * The characters <code>(</code> and <code>)</code> are used for grouping, the
615 * character <code>*</code> 'zero or more times', and the character
616 * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers is
617 * determined by an exact character sequence match; i.e., comparisons must be
618 * performed in a case-sensitive manner.  In addition, there are a few
619 * conditions for the uniqueness of identifiers in an SBML model.  Please
620 * consult the SBML specifications for the exact details of the uniqueness
621 * requirements.
622   <p>
623   * @param sid the string to use as the identifier of this {@link Event}
624   <p>
625   * <p>
626 * @return integer value indicating success/failure of the
627 * function.   The possible values
628 * returned by this function are:
629   * <ul>
630   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
631   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
632   * </ul>
633   */ public
634 int setId(String sid) {
635    return libsbmlJNI.Event_setId(swigCPtr, this, sid);
636  }
637
638  
639/**
640   * Sets the value of the 'name' attribute of this {@link Event}.
641   <p>
642   * The string in <code>name</code> is copied.
643   <p>
644   * @param name the new name for the {@link Event}
645   <p>
646   * <p>
647 * @return integer value indicating success/failure of the
648 * function.   The possible values
649 * returned by this function are:
650   * <ul>
651   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
652   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
653   * </ul>
654   */ public
655 int setName(String name) {
656    return libsbmlJNI.Event_setName(swigCPtr, this, name);
657  }
658
659  
660/**
661   * Sets the trigger definition of this {@link Event} to a copy of the given
662   * {@link Trigger} object instance.
663   <p>
664   * @param trigger the {@link Trigger} object instance to use.
665   <p>
666   * <p>
667 * @return integer value indicating success/failure of the
668 * function.   The possible values
669 * returned by this function are:
670   * <ul>
671   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
672   * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH}
673   * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH}
674   * </ul>
675   */ public
676 int setTrigger(Trigger trigger) {
677    return libsbmlJNI.Event_setTrigger(swigCPtr, this, Trigger.getCPtr(trigger), trigger);
678  }
679
680  
681/**
682   * Sets the delay definition of this {@link Event} to a copy of the given {@link Delay}
683   * object instance.
684   <p>
685   * @param delay the {@link Delay} object instance to use
686   <p>
687   * <p>
688 * @return integer value indicating success/failure of the
689 * function.   The possible values
690 * returned by this function are:
691   * <ul>
692   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
693   * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH}
694   * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH}
695   * </ul>
696   */ public
697 int setDelay(Delay delay) {
698    return libsbmlJNI.Event_setDelay(swigCPtr, this, Delay.getCPtr(delay), delay);
699  }
700
701  
702/**
703   * (SBML Level&nbsp;3 only) Sets the priority definition of this {@link Event}
704   * to a copy of the given {@link Priority} object instance.
705   <p>
706   * @param priority the {@link Priority} object instance to use
707   <p>
708   * <p>
709 * @return integer value indicating success/failure of the
710 * function.   The possible values
711 * returned by this function are:
712   * <ul>
713   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
714   * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH}
715   * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH}
716   * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
717   *
718   * </ul> <p>
719   * @note The element 'priority' is available in SBML Level&nbsp;3
720   * Version&nbsp;1 Core, but is not present in lower Levels of SBML.
721   */ public
722 int setPriority(Priority priority) {
723    return libsbmlJNI.Event_setPriority(swigCPtr, this, Priority.getCPtr(priority), priority);
724  }
725
726  
727/**
728   * Sets the 'timeUnits' attribute of this {@link Event} to a copy of <code>sid</code>.
729   <p>
730   * @param sid the identifier of the time units to use.
731   <p>
732   * <p>
733 * @return integer value indicating success/failure of the
734 * function.   The possible values
735 * returned by this function are:
736   * <ul>
737   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
738   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
739   * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
740   *
741   * </ul> <p>
742   * <p>
743 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2
744 * Versions&nbsp;1 and&nbsp;2 included the additional attribute called
745 * 'timeUnits', but it was removed in SBML Level&nbsp;2 Version&nbsp;3.
746 * LibSBML supports this attribute for compatibility with previous versions
747 * of SBML Level&nbsp;2, but its use is discouraged since models in
748 * Level&nbsp;2 Versions&nbsp;3 and&nbsp;4 cannot contain it.  If a
749 * Version&nbsp;3 or&nbsp;4 model sets the attribute, the
750 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report
751 * an error.</span>
752   */ public
753 int setTimeUnits(String sid) {
754    return libsbmlJNI.Event_setTimeUnits(swigCPtr, this, sid);
755  }
756
757  
758/**
759   * Sets the 'useValuesFromTriggerTime' attribute of this {@link Event} to a <code>value</code>.
760   <p>
761   * <p>
762 * The optional {@link Delay} on {@link Event} means there are two times to consider when
763 * computing the results of an event: the time at which the event is
764 * <em>triggered</em>, and the time at which assignments are
765 * <em>executed</em>.  It is also possible to distinguish between the
766 * time at which the {@link EventAssignment}'s expression is calculated, and the
767 * time at which the assignment is made: the expression could be
768 * evaluated at the same time the assignments are performed, i.e., when
769 * the event is <em>executed</em>, but it could also be defined to be
770 * evaluated at the time the event is <em>triggered</em>.
771 <p>
772 * In SBML Level&nbsp;2 versions prior to Version&nbsp;4, the semantics
773 * of {@link Event} time delays were defined such that the expressions in the
774 * event's assignments were always evaluated at the time the event was
775 * <em>triggered</em>.  This definition made it difficult to define an
776 * event whose assignment formulas were meant to be evaluated at the time
777 * the event was <em>executed</em> (i.e., after the time period defined
778 * by the value of the {@link Delay} element).  In SBML Level&nbsp;2
779 * Version&nbsp;4, the attribute 'useValuesFromTriggerTime' on {@link Event}
780 * allows a model to indicate the time at which the event's assignments
781 * are intended to be evaluated.  In SBML Level&nbsp;2, the attribute has
782 * a default value of <code>true</code>, which corresponds to the interpretation of
783 * event assignments prior to Version&nbsp;4: the values of the
784 * assignment formulas are computed at the moment the event is triggered,
785 * not after the delay.  If 'useValuesFromTriggerTime'=<code>false</code>, it means
786 * that the formulas in the event's assignments are to be computed after
787 * the delay, at the time the event is executed.  In SBML Level&nbsp;3,
788 * the attribute is mandatory, not optional, and all events must specify
789 * a value for it.
790   <p>
791   * @param value the value of useValuesFromTriggerTime to use.
792   <p>
793   * <p>
794 * @return integer value indicating success/failure of the
795 * function.   The possible values
796 * returned by this function are:
797   * <ul>
798   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
799   * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
800   *
801   * </ul> <p>
802   * <p>
803 * @warning <span class='warning'>The attribute 'useValuesFromTriggerTime'
804 * was introduced in SBML Level&nbsp;2 Version&nbsp;4.  It is not valid in
805 * models defined using SBML Level&nbsp;2 versions prior to Version&nbsp;4.
806 * If a Level&nbsp;2 Version&nbsp;1&ndash;3 model sets the attribute, the
807 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report
808 * an error.</span>
809   */ public
810 int setUseValuesFromTriggerTime(boolean value) {
811    return libsbmlJNI.Event_setUseValuesFromTriggerTime(swigCPtr, this, value);
812  }
813
814  
815/**
816   * Unsets the value of the 'id' attribute of this {@link Event}.
817   <p>
818   * <p>
819 * @return integer value indicating success/failure of the
820 * function.   The possible values
821 * returned by this function are:
822   * <ul>
823   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
824   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
825   * </ul>
826   */ public
827 int unsetId() {
828    return libsbmlJNI.Event_unsetId(swigCPtr, this);
829  }
830
831  
832/**
833   * Unsets the value of the 'name' attribute of this {@link Event}.
834   <p>
835   * <p>
836 * @return integer value indicating success/failure of the
837 * function.   The possible values
838 * returned by this function are:
839   * <ul>
840   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
841   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
842   * </ul>
843   */ public
844 int unsetName() {
845    return libsbmlJNI.Event_unsetName(swigCPtr, this);
846  }
847
848  
849/**
850   * Unsets the value of the 'useValuesFromTriggerTime' attribute of this {@link Event}.
851   <p>
852   * <p>
853 * The optional {@link Delay} on {@link Event} means there are two times to consider when
854 * computing the results of an event: the time at which the event is
855 * <em>triggered</em>, and the time at which assignments are
856 * <em>executed</em>.  It is also possible to distinguish between the
857 * time at which the {@link EventAssignment}'s expression is calculated, and the
858 * time at which the assignment is made: the expression could be
859 * evaluated at the same time the assignments are performed, i.e., when
860 * the event is <em>executed</em>, but it could also be defined to be
861 * evaluated at the time the event is <em>triggered</em>.
862 <p>
863 * In SBML Level&nbsp;2 versions prior to Version&nbsp;4, the semantics
864 * of {@link Event} time delays were defined such that the expressions in the
865 * event's assignments were always evaluated at the time the event was
866 * <em>triggered</em>.  This definition made it difficult to define an
867 * event whose assignment formulas were meant to be evaluated at the time
868 * the event was <em>executed</em> (i.e., after the time period defined
869 * by the value of the {@link Delay} element).  In SBML Level&nbsp;2
870 * Version&nbsp;4, the attribute 'useValuesFromTriggerTime' on {@link Event}
871 * allows a model to indicate the time at which the event's assignments
872 * are intended to be evaluated.  In SBML Level&nbsp;2, the attribute has
873 * a default value of <code>true</code>, which corresponds to the interpretation of
874 * event assignments prior to Version&nbsp;4: the values of the
875 * assignment formulas are computed at the moment the event is triggered,
876 * not after the delay.  If 'useValuesFromTriggerTime'=<code>false</code>, it means
877 * that the formulas in the event's assignments are to be computed after
878 * the delay, at the time the event is executed.  In SBML Level&nbsp;3,
879 * the attribute is mandatory, not optional, and all events must specify
880 * a value for it.
881   <p>
882   * <p>
883 * @return integer value indicating success/failure of the
884 * function.   The possible values
885 * returned by this function are:
886   * <ul>
887   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
888   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
889   *
890   * </ul> <p>
891   * <p>
892 * @warning <span class='warning'>The attribute 'useValuesFromTriggerTime'
893 * was introduced in SBML Level&nbsp;2 Version&nbsp;4.  It is not valid in
894 * models defined using SBML Level&nbsp;2 versions prior to Version&nbsp;4.
895 * If a Level&nbsp;2 Version&nbsp;1&ndash;3 model sets the attribute, the
896 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report
897 * an error.</span>
898   */ public
899 int unsetUseValuesFromTriggerTime() {
900    return libsbmlJNI.Event_unsetUseValuesFromTriggerTime(swigCPtr, this);
901  }
902
903  
904/**
905   * Unsets the {@link Delay} of this {@link Event}.
906   <p>
907   * <p>
908 * @return integer value indicating success/failure of the
909 * function.   The possible values
910 * returned by this function are:
911   * <ul>
912   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
913   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
914   * </ul>
915   */ public
916 int unsetDelay() {
917    return libsbmlJNI.Event_unsetDelay(swigCPtr, this);
918  }
919
920  
921/**
922   * (SBML Level&nbsp;3 only) Unsets the {@link Priority} of this {@link Event}.
923   <p>
924   * <p>
925 * @return integer value indicating success/failure of the
926 * function.   The possible values
927 * returned by this function are:
928   * <ul>
929   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
930   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
931   *
932   * </ul> <p>
933   * @note The element 'priority' is available in SBML Level&nbsp;3
934   * Version&nbsp;1 Core, but is not present in lower Levels of SBML.
935   */ public
936 int unsetPriority() {
937    return libsbmlJNI.Event_unsetPriority(swigCPtr, this);
938  }
939
940  
941/**
942   * Unsets the {@link Trigger} of this {@link Event}.
943   <p>
944   * <p>
945 * @return integer value indicating success/failure of the
946 * function.   The possible values
947 * returned by this function are:
948   * <ul>
949   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
950   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
951   *
952   * </ul> <p>
953   * @note The element 'priority' is available in SBML Level&nbsp;3
954   * Version&nbsp;1 Core, but is not present in lower Levels of SBML.
955   */ public
956 int unsetTrigger() {
957    return libsbmlJNI.Event_unsetTrigger(swigCPtr, this);
958  }
959
960  
961/**
962   * Unsets the 'timeUnits' attribute of this {@link Event}.
963   <p>
964   * <p>
965 * @return integer value indicating success/failure of the
966 * function.   The possible values
967 * returned by this function are:
968   * <ul>
969   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
970   * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
971   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
972   *
973   * </ul> <p>
974   * <p>
975 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2
976 * Versions&nbsp;1 and&nbsp;2 included the additional attribute called
977 * 'timeUnits', but it was removed in SBML Level&nbsp;2 Version&nbsp;3.
978 * LibSBML supports this attribute for compatibility with previous versions
979 * of SBML Level&nbsp;2, but its use is discouraged since models in
980 * Level&nbsp;2 Versions&nbsp;3 and&nbsp;4 cannot contain it.  If a
981 * Version&nbsp;3 or&nbsp;4 model sets the attribute, the
982 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report
983 * an error.</span>
984   */ public
985 int unsetTimeUnits() {
986    return libsbmlJNI.Event_unsetTimeUnits(swigCPtr, this);
987  }
988
989  
990/**
991   * Appends a copy of the given {@link EventAssignment} to this {@link Event}.
992   <p>
993   * @param ea the {@link EventAssignment} object to add.
994   <p>
995   * <p>
996 * @return integer value indicating success/failure of the
997 * function.   The possible values
998 * returned by this function are:
999   * <ul>
1000   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1001   * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH}
1002   * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH}
1003   * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID}
1004   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
1005   *
1006   * </ul> <p>
1007   * <p>
1008 * @note This method should be used with some caution.  The fact that this
1009 * method <em>copies</em> the object passed to it means that the caller will be
1010 * left holding a physically different object instance than the one contained
1011 * inside this object.  Changes made to the original object instance (such as
1012 * resetting attribute values) will <em>not affect the instance in this
1013 * object</em>.  In addition, the caller should make sure to free the
1014 * original object if it is no longer being used, or else a memory leak will
1015 * result.  Please see other methods on this class (particularly a
1016 * corresponding method whose name begins with the word <code>create</code>)
1017 * for alternatives that do not lead to these issues. 
1018   <p>
1019   * @see #createEventAssignment()
1020   */ public
1021 int addEventAssignment(EventAssignment ea) {
1022    return libsbmlJNI.Event_addEventAssignment(swigCPtr, this, EventAssignment.getCPtr(ea), ea);
1023  }
1024
1025  
1026/**
1027   * Creates a new, empty {@link EventAssignment}, adds it to this {@link Event}'s list of
1028   * event assignments and returns the {@link EventAssignment}.
1029   <p>
1030   * @return the newly created {@link EventAssignment} object instance
1031   <p>
1032   * @see #addEventAssignment(EventAssignment ea)
1033   */ public
1034 EventAssignment createEventAssignment() {
1035    long cPtr = libsbmlJNI.Event_createEventAssignment(swigCPtr, this);
1036    return (cPtr == 0) ? null : new EventAssignment(cPtr, false);
1037  }
1038
1039  
1040/**
1041   * Creates a new, empty {@link Trigger}, adds it to this {@link Event} and 
1042   * returns the {@link Trigger}.
1043   <p>
1044   * @return the newly created {@link Trigger} object instance
1045   */ public
1046 Trigger createTrigger() {
1047    long cPtr = libsbmlJNI.Event_createTrigger(swigCPtr, this);
1048    return (cPtr == 0) ? null : new Trigger(cPtr, false);
1049  }
1050
1051  
1052/**
1053   * Creates a new, empty {@link Delay}, adds it to this {@link Event} and 
1054   * returns the {@link Delay}.
1055   <p>
1056   * @return the newly created {@link Delay} object instance
1057   */ public
1058 Delay createDelay() {
1059    long cPtr = libsbmlJNI.Event_createDelay(swigCPtr, this);
1060    return (cPtr == 0) ? null : new Delay(cPtr, false);
1061  }
1062
1063  
1064/**
1065   * (SBML Level&nbsp;3 only) Creates a new, empty {@link Priority}, adds it to this
1066   * {@link Event} and returns the {@link Priority}.
1067   <p>
1068   * @return the newly created {@link Priority} object instance
1069   <p>
1070   * @note The element 'priority' is available in SBML Level&nbsp;3
1071   * Version&nbsp;1 Core, but is not present in lower Levels of SBML.
1072   */ public
1073 Priority createPriority() {
1074    long cPtr = libsbmlJNI.Event_createPriority(swigCPtr, this);
1075    return (cPtr == 0) ? null : new Priority(cPtr, false);
1076  }
1077
1078  
1079/**
1080   * Returns the list of event assignments for this {@link Event}.
1081   <p>
1082   * @return the list of EventAssignments for this {@link Event}.
1083   */ public
1084 ListOfEventAssignments getListOfEventAssignments() {
1085    long cPtr = libsbmlJNI.Event_getListOfEventAssignments__SWIG_0(swigCPtr, this);
1086    return (cPtr == 0) ? null : new ListOfEventAssignments(cPtr, false);
1087  }
1088
1089  
1090/**
1091   * Return a specific {@link EventAssignment} object of this {@link Event}.
1092   <p>
1093   * @param n an integer, the index of the {@link EventAssignment} object to return
1094   <p>
1095   * @return the <code>n</code>th {@link EventAssignment} of this {@link Event}.
1096   */ public
1097 EventAssignment getEventAssignment(long n) {
1098    long cPtr = libsbmlJNI.Event_getEventAssignment__SWIG_0(swigCPtr, this, n);
1099    return (cPtr == 0) ? null : new EventAssignment(cPtr, false);
1100  }
1101
1102  
1103/**
1104   * Return the event assignment indicated by the given <code>variable</code>.
1105   <p>
1106   * @param variable a string, the identifier of the variable whose
1107   * {@link EventAssignment} is being sought.
1108   <p>
1109   * @return the {@link EventAssignment} for the given <code>variable</code>, or <code>null</code> if
1110   * no such {@link EventAssignment} exits.
1111   */ public
1112 EventAssignment getEventAssignment(String variable) {
1113    long cPtr = libsbmlJNI.Event_getEventAssignment__SWIG_2(swigCPtr, this, variable);
1114    return (cPtr == 0) ? null : new EventAssignment(cPtr, false);
1115  }
1116
1117  
1118/**
1119   * Returns the number of {@link EventAssignment} objects attached to this
1120   * {@link Event}.
1121   <p>
1122   * @return the number of EventAssignments in this {@link Event}.
1123   */ public
1124 long getNumEventAssignments() {
1125    return libsbmlJNI.Event_getNumEventAssignments(swigCPtr, this);
1126  }
1127
1128  
1129/**
1130   * Removes the nth {@link EventAssignment} object from this {@link Event} object and
1131   * returns a pointer to it.
1132   <p>
1133   * The caller owns the returned object and is responsible for deleting it.
1134   <p>
1135   * @param n the index of the {@link EventAssignment} object to remove
1136   <p>
1137   * @return the {@link EventAssignment} object removed.  As mentioned above, 
1138   * the caller owns the returned item. <code>null</code> is returned if the given index 
1139   * is out of range.
1140   */ public
1141 EventAssignment removeEventAssignment(long n) {
1142    long cPtr = libsbmlJNI.Event_removeEventAssignment__SWIG_0(swigCPtr, this, n);
1143    return (cPtr == 0) ? null : new EventAssignment(cPtr, true);
1144  }
1145
1146  
1147/**
1148   * Removes the {@link EventAssignment} object with the given 'variable' attribute 
1149   * from this {@link Event} object and returns a pointer to it.
1150   <p>
1151   * The caller owns the returned object and is responsible for deleting it.
1152   * If none of the {@link EventAssignment} objects in this {@link Event} object have the 
1153   * 'variable' attribute <code>variable</code>, then <code>null</code> is returned.
1154   <p>
1155   * @param variable the 'variable' attribute of the {@link EventAssignment} object 
1156   * to remove
1157   <p>
1158   * @return the {@link EventAssignment} object removed.  As mentioned above, the 
1159   * caller owns the returned object. <code>null</code> is returned if no {@link EventAssignment}
1160   * object with the 'variable' attribute exists in this {@link Event} object.
1161   */ public
1162 EventAssignment removeEventAssignment(String variable) {
1163    long cPtr = libsbmlJNI.Event_removeEventAssignment__SWIG_1(swigCPtr, this, variable);
1164    return (cPtr == 0) ? null : new EventAssignment(cPtr, true);
1165  }
1166
1167  public void connectToChild() {
1168    libsbmlJNI.Event_connectToChild(swigCPtr, this);
1169  }
1170
1171  
1172/** * @internal */ public
1173 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
1174    libsbmlJNI.Event_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
1175  }
1176
1177  
1178/**
1179   * Returns the libSBML type code of this object instance.
1180   <p>
1181   * <p>
1182 * LibSBML attaches an identifying code to every kind of SBML object.  These
1183 * are integer constants known as <em>SBML type codes</em>.  The names of all
1184 * the codes begin with the characters <code>SBML_</code>.
1185 * In the Java language interface for libSBML, the
1186 * type codes are defined as static integer constants in the interface class
1187 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
1188 * package plug-ins may use overlapping type codes; to identify the package
1189 * to which a given object belongs, call the <code>getPackageName()</code>
1190 * method on the object.
1191   <p>
1192   * @return the SBML type code for this object:
1193   * {@link libsbmlConstants#SBML_EVENT SBML_EVENT} (default).
1194   <p>
1195   * <p>
1196 * @warning <span class='warning'>The specific integer values of the possible
1197 * type codes may be reused by different Level&nbsp;3 package plug-ins.
1198 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
1199 * both getTypeCode() and getPackageName()</strong>.</span>
1200   <p>
1201   * @see #getElementName()
1202   * @see #getPackageName()
1203   */ public
1204 int getTypeCode() {
1205    return libsbmlJNI.Event_getTypeCode(swigCPtr, this);
1206  }
1207
1208  
1209/**
1210   * Returns the XML element name of this object, which for {@link Event}, is
1211   * always <code>'event'.</code>
1212   <p>
1213   * @return the name of this element, i.e., <code>'event'.</code> 
1214   */ public
1215 String getElementName() {
1216    return libsbmlJNI.Event_getElementName(swigCPtr, this);
1217  }
1218
1219  
1220/**
1221   * Predicate returning <code>true</code> if all the required attributes for this
1222   * {@link Event} object have been set.
1223   <p>
1224   * The required attributes for an {@link Event} object are:
1225   * <ul>
1226   * <li> 'useValuesfromTriggerTime' (required in SBML Level&nbsp;3)
1227   *
1228   * </ul> <p>
1229   * @return <code>true</code> if the required attributes have been set, <code>false</code>
1230   * otherwise.
1231   */ public
1232 boolean hasRequiredAttributes() {
1233    return libsbmlJNI.Event_hasRequiredAttributes(swigCPtr, this);
1234  }
1235
1236  
1237/**
1238   * Predicate returning <code>true</code> if all the required elements for this {@link Event}
1239   * object have been set.
1240   <p>
1241   * @note The required elements for an {@link Event} object are:
1242   * <ul>
1243   * <li> 'trigger'
1244   * <li> 'listOfEventAssignments' (required in SBML Level&nbsp;2, optional in Level&nbsp;3)
1245   * </ul>
1246   */ public
1247 boolean hasRequiredElements() {
1248    return libsbmlJNI.Event_hasRequiredElements(swigCPtr, this);
1249  }
1250
1251}