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 Event construct. 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 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 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 2); 040 * <li> {@link Event}'s 'listOfEventAssignments' element (of class 041 * {@link ListOfEventAssignments}) is optional (it was mandatory in Level 2); 042 * <li> {@link Event}'s 'priority' element (of class {@link Priority}) is new in 043 * Level 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 2 versions before Version 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 2 Version 4 and in 060 * Level 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 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 2 070 * as well as SBML Level 3 do not define this attribute. LibSBML 071 * supports this attribute for compatibility with previous versions of SBML 072 * Level 2; however, if a model in SBML Level 3 or Level 2 073 * Versions 3–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 2 Version 4. Models defined in prior Versions of SBML 079 * Level 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 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 1 Version 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—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 * @throws SBMLConstructorException 241 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 242 * of SBML object, are either invalid or mismatched with respect to the 243 * parent {@link SBMLDocument} object. 244 <p> 245 * <p> 246 * @note Upon the addition of an {@link Event} object to an {@link SBMLDocument} (e.g., using 247 * {@link Model#addEvent(Event e)}), the SBML Level, SBML Version and 248 * XML namespace of the document <em>override</em> the values used when creating 249 * the {@link Event} object via this constructor. This is necessary to ensure that 250 * an SBML document is a consistent structure. Nevertheless, the ability to 251 * supply the values at the time of creation of an {@link Event} is an important aid 252 * to producing valid SBML. Knowledge of the intented SBML Level and Version 253 * determine whether it is valid to assign a particular value to an 254 * attribute, or whether it is valid to add an object to an existing 255 * {@link SBMLDocument}. 256 */ public 257 Event(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 258 this(libsbmlJNI.new_Event__SWIG_0(level, version), true); 259 } 260 261 262/** 263 * Creates a new {@link Event} using the given {@link SBMLNamespaces} object 264 * <code>sbmlns</code>. 265 <p> 266 * <p> 267 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 268 * information. It is used to communicate the SBML Level, Version, and (in 269 * Level 3) packages used in addition to SBML Level 3 Core. A 270 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 271 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object 272 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 273 <p> 274 * @param sbmlns an {@link SBMLNamespaces} object. 275 <p> 276 * @throws SBMLConstructorException 277 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 278 * of SBML object, are either invalid or mismatched with respect to the 279 * parent {@link SBMLDocument} object. 280 <p> 281 * <p> 282 * @note Upon the addition of an {@link Event} object to an {@link SBMLDocument} (e.g., using 283 * {@link Model#addEvent(Event e)}), the SBML Level, SBML Version and 284 * XML namespace of the document <em>override</em> the values used when creating 285 * the {@link Event} object via this constructor. This is necessary to ensure that 286 * an SBML document is a consistent structure. Nevertheless, the ability to 287 * supply the values at the time of creation of an {@link Event} is an important aid 288 * to producing valid SBML. Knowledge of the intented SBML Level and Version 289 * determine whether it is valid to assign a particular value to an 290 * attribute, or whether it is valid to add an object to an existing 291 * {@link SBMLDocument}. 292 */ public 293 Event(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 294 this(libsbmlJNI.new_Event__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 295 } 296 297 298/** 299 * Copy constructor; creates a copy of this {@link Event}. 300 <p> 301 * @param orig the object to copy. 302 <p> 303 * @throws SBMLConstructorException 304 * Thrown if the argument <code>orig</code> is <code>null.</code> 305 */ public 306 Event(Event orig) throws org.sbml.libsbml.SBMLConstructorException { 307 this(libsbmlJNI.new_Event__SWIG_2(Event.getCPtr(orig), orig), true); 308 } 309 310 311/** 312 * Creates and returns a deep copy of this {@link Event}. 313 <p> 314 * @return a (deep) copy of this {@link Event}. 315 */ public 316 Event cloneObject() { 317 long cPtr = libsbmlJNI.Event_cloneObject(swigCPtr, this); 318 return (cPtr == 0) ? null : new Event(cPtr, true); 319 } 320 321 322/** 323 * Returns the first child element found that has the given <code>id</code> in the 324 * model-wide SId namespace, or <code>null</code> if no such object is found. 325 <p> 326 * @param id string representing the id of objects to find 327 <p> 328 * @return pointer to the first element found with the given <code>id</code>. 329 */ public 330 SBase getElementBySId(String id) { 331 return libsbml.DowncastSBase(libsbmlJNI.Event_getElementBySId(swigCPtr, this, id), false); 332} 333 334 335/** 336 * Returns the first child element it can find with the given <code>metaid</code>, or 337 * <code>null</code> if no such object is found. 338 <p> 339 * @param metaid string representing the metaid of objects to find 340 <p> 341 * @return pointer to the first element found with the given <code>metaid</code>. 342 */ public 343 SBase getElementByMetaId(String metaid) { 344 return libsbml.DowncastSBase(libsbmlJNI.Event_getElementByMetaId(swigCPtr, this, metaid), false); 345} 346 347 348/** 349 * Returns the value of the 'id' attribute of this {@link Event}. 350 <p> 351 * @return the id of this {@link Event}. 352 */ public 353 String getId() { 354 return libsbmlJNI.Event_getId(swigCPtr, this); 355 } 356 357 358/** 359 * Returns the value of the 'name' attribute of this {@link Event}. 360 <p> 361 * @return the name of this {@link Event}. 362 */ public 363 String getName() { 364 return libsbmlJNI.Event_getName(swigCPtr, this); 365 } 366 367 368/** 369 * Get the event trigger portion of this {@link Event}. 370 <p> 371 * @return the {@link Trigger} object of this {@link Event}. 372 */ public 373 Trigger getTrigger() { 374 long cPtr = libsbmlJNI.Event_getTrigger__SWIG_0(swigCPtr, this); 375 return (cPtr == 0) ? null : new Trigger(cPtr, false); 376 } 377 378 379/** 380 * Get the assignment delay portion of this {@link Event}, if there is one. 381 <p> 382 * @return the delay of this {@link Event} if one is defined, or <code>null</code> if none 383 * is defined. 384 */ public 385 Delay getDelay() { 386 long cPtr = libsbmlJNI.Event_getDelay__SWIG_0(swigCPtr, this); 387 return (cPtr == 0) ? null : new Delay(cPtr, false); 388 } 389 390 391/** 392 * (SBML Level 3 only) Get the event priority portion of this 393 * {@link Event}. 394 <p> 395 * @return the {@link Priority} object of this {@link Event}. 396 <p> 397 * @note The element 'priority' is available in SBML Level 3 398 * Version 1 Core, but is not present in lower Levels of SBML. 399 */ public 400 Priority getPriority() { 401 long cPtr = libsbmlJNI.Event_getPriority__SWIG_0(swigCPtr, this); 402 return (cPtr == 0) ? null : new Priority(cPtr, false); 403 } 404 405 406/** 407 * Get the value of the 'timeUnits' attribute of this {@link Event}, if it has one. 408 <p> 409 * @return the value of the attribute 'timeUnits' as a string. 410 <p> 411 * <p> 412 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2 413 * Versions 1 and 2 included the additional attribute called 414 * 'timeUnits', but it was removed in SBML Level 2 Version 3. 415 * LibSBML supports this attribute for compatibility with previous versions 416 * of SBML Level 2, but its use is discouraged since models in 417 * Level 2 Versions 3 and 4 cannot contain it. If a 418 * Version 3 or 4 model sets the attribute, the 419 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 420 * an error.</span> 421 */ public 422 String getTimeUnits() { 423 return libsbmlJNI.Event_getTimeUnits(swigCPtr, this); 424 } 425 426 427/** 428 * Get the value of the 'useValuesFromTriggerTime' attribute of this {@link Event}. 429 <p> 430 * <p> 431 * The optional {@link Delay} on {@link Event} means there are two times to consider when 432 * computing the results of an event: the time at which the event is 433 * <em>triggered</em>, and the time at which assignments are 434 * <em>executed</em>. It is also possible to distinguish between the 435 * time at which the {@link EventAssignment}'s expression is calculated, and the 436 * time at which the assignment is made: the expression could be 437 * evaluated at the same time the assignments are performed, i.e., when 438 * the event is <em>executed</em>, but it could also be defined to be 439 * evaluated at the time the event is <em>triggered</em>. 440 <p> 441 * In SBML Level 2 versions prior to Version 4, the semantics 442 * of {@link Event} time delays were defined such that the expressions in the 443 * event's assignments were always evaluated at the time the event was 444 * <em>triggered</em>. This definition made it difficult to define an 445 * event whose assignment formulas were meant to be evaluated at the time 446 * the event was <em>executed</em> (i.e., after the time period defined 447 * by the value of the {@link Delay} element). In SBML Level 2 448 * Version 4, the attribute 'useValuesFromTriggerTime' on {@link Event} 449 * allows a model to indicate the time at which the event's assignments 450 * are intended to be evaluated. In SBML Level 2, the attribute has 451 * a default value of <code>true</code>, which corresponds to the interpretation of 452 * event assignments prior to Version 4: the values of the 453 * assignment formulas are computed at the moment the event is triggered, 454 * not after the delay. If 'useValuesFromTriggerTime'=<code>false</code>, it means 455 * that the formulas in the event's assignments are to be computed after 456 * the delay, at the time the event is executed. In SBML Level 3, 457 * the attribute is mandatory, not optional, and all events must specify 458 * a value for it. 459 <p> 460 * @return the value of the attribute 'useValuesFromTriggerTime' as a boolean. 461 <p> 462 * <p> 463 * @warning <span class='warning'>The attribute 'useValuesFromTriggerTime' 464 * was introduced in SBML Level 2 Version 4. It is not valid in 465 * models defined using SBML Level 2 versions prior to Version 4. 466 * If a Level 2 Version 1–3 model sets the attribute, the 467 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 468 * an error.</span> 469 */ public 470 boolean getUseValuesFromTriggerTime() { 471 return libsbmlJNI.Event_getUseValuesFromTriggerTime(swigCPtr, this); 472 } 473 474 475/** 476 * Predicate returning <code>true</code> if this 477 * {@link Event}'s 'id' attribute is set. 478 <p> 479 * @return <code>true</code> if the 'id' attribute of this {@link Event} is 480 * set, <code>false</code> otherwise. 481 */ public 482 boolean isSetId() { 483 return libsbmlJNI.Event_isSetId(swigCPtr, this); 484 } 485 486 487/** 488 * Predicate returning <code>true</code> if this 489 * {@link Event}'s 'name' attribute is set. 490 <p> 491 * @return <code>true</code> if the 'name' attribute of this {@link Event} is 492 * set, <code>false</code> otherwise. 493 */ public 494 boolean isSetName() { 495 return libsbmlJNI.Event_isSetName(swigCPtr, this); 496 } 497 498 499/** 500 * Predicate for testing whether the trigger for this {@link Event} is set. 501 <p> 502 * @return <code>true</code> if the trigger of this {@link Event} is set, <code>false</code> 503 * otherwise. 504 */ public 505 boolean isSetTrigger() { 506 return libsbmlJNI.Event_isSetTrigger(swigCPtr, this); 507 } 508 509 510/** 511 * Predicate for testing whether the delay for this {@link Event} is set. 512 <p> 513 * @return <code>true</code> if the delay of this {@link Event} is set, <code>false</code> 514 * otherwise. 515 */ public 516 boolean isSetDelay() { 517 return libsbmlJNI.Event_isSetDelay(swigCPtr, this); 518 } 519 520 521/** 522 * (SBML Level 3 only) Predicate for testing whether the priority 523 * for this {@link Event} is set. 524 <p> 525 * @return <code>true</code> if the priority of this {@link Event} is set, <code>false</code> 526 * otherwise. 527 <p> 528 * @note The element 'priority' is available in SBML Level 3 529 * Version 1 Core, but is not present in lower Levels of SBML. 530 */ public 531 boolean isSetPriority() { 532 return libsbmlJNI.Event_isSetPriority(swigCPtr, this); 533 } 534 535 536/** 537 * Predicate for testing whether the 'timeUnits' attribute of this {@link Event} 538 * is set. 539 <p> 540 * @return <code>true</code> if the 'timeUnits' attribute of this {@link Event} is 541 * set, <code>false</code> otherwise. 542 <p> 543 * <p> 544 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2 545 * Versions 1 and 2 included the additional attribute called 546 * 'timeUnits', but it was removed in SBML Level 2 Version 3. 547 * LibSBML supports this attribute for compatibility with previous versions 548 * of SBML Level 2, but its use is discouraged since models in 549 * Level 2 Versions 3 and 4 cannot contain it. If a 550 * Version 3 or 4 model sets the attribute, the 551 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 552 * an error.</span> 553 */ public 554 boolean isSetTimeUnits() { 555 return libsbmlJNI.Event_isSetTimeUnits(swigCPtr, this); 556 } 557 558 559/** 560 * Predicate for testing whether the 'useValuesFromTriggerTime' attribute of this {@link Event} 561 * is set. 562 <p> 563 * @return <code>true</code> if the 'useValuesFromTriggerTime' attribute of this {@link Event} is 564 * set, <code>false</code> otherwise. 565 <p> 566 * @note In SBML Level 2, this attribute is optional and has a default value of 567 * <code>true</code>, whereas in Level 3 Version 1, this optional is mandatory and 568 * has no default value. 569 */ public 570 boolean isSetUseValuesFromTriggerTime() { 571 return libsbmlJNI.Event_isSetUseValuesFromTriggerTime(swigCPtr, this); 572 } 573 574 575/** 576 * Sets the value of the 'id' attribute of this {@link Event}. 577 <p> 578 * The string <code>sid</code> is copied. 579 <p> 580 * <p> 581 * SBML has strict requirements for the syntax of identifiers, that is, the 582 * values of the 'id' attribute present on most types of SBML objects. 583 * The following is a summary of the definition of the SBML identifier type 584 * <code>SId</code>, which defines the permitted syntax of identifiers. We 585 * express the syntax using an extended form of BNF notation: 586 * <pre style='margin-left: 2em; border: none; font-weight: bold; font-size: 13px; color: black'> 587 * letter .= 'a'..'z','A'..'Z' 588 * digit .= '0'..'9' 589 * idChar .= letter | digit | '_' 590 * SId .= ( letter | '_' ) idChar* 591 * </pre> 592 * The characters <code>(</code> and <code>)</code> are used for grouping, the 593 * character <code>*</code> 'zero or more times', and the character 594 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 595 * determined by an exact character sequence match; i.e., comparisons must be 596 * performed in a case-sensitive manner. In addition, there are a few 597 * conditions for the uniqueness of identifiers in an SBML model. Please 598 * consult the SBML specifications for the exact details of the uniqueness 599 * requirements. 600 <p> 601 * @param sid the string to use as the identifier of this {@link Event} 602 <p> 603 * @return integer value indicating success/failure of the 604 * function. The possible values 605 * returned by this function are: 606 * <ul> 607 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 608 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 609 * </ul> 610 */ public 611 int setId(String sid) { 612 return libsbmlJNI.Event_setId(swigCPtr, this, sid); 613 } 614 615 616/** 617 * Sets the value of the 'name' attribute of this {@link Event}. 618 <p> 619 * The string in <code>name</code> is copied. 620 <p> 621 * @param name the new name for the {@link Event} 622 <p> 623 * @return integer value indicating success/failure of the 624 * function. The possible values 625 * returned by this function are: 626 * <ul> 627 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 628 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 629 * </ul> 630 */ public 631 int setName(String name) { 632 return libsbmlJNI.Event_setName(swigCPtr, this, name); 633 } 634 635 636/** 637 * Sets the trigger definition of this {@link Event} to a copy of the given 638 * {@link Trigger} object instance. 639 <p> 640 * @param trigger the {@link Trigger} object instance to use. 641 <p> 642 * @return integer value indicating success/failure of the 643 * function. The possible values 644 * returned by this function are: 645 * <ul> 646 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 647 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH } 648 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH } 649 * </ul> 650 */ public 651 int setTrigger(Trigger trigger) { 652 return libsbmlJNI.Event_setTrigger(swigCPtr, this, Trigger.getCPtr(trigger), trigger); 653 } 654 655 656/** 657 * Sets the delay definition of this {@link Event} to a copy of the given {@link Delay} 658 * object instance. 659 <p> 660 * @param delay the {@link Delay} object instance to use 661 <p> 662 * @return integer value indicating success/failure of the 663 * function. The possible values 664 * returned by this function are: 665 * <ul> 666 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 667 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH } 668 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH } 669 * </ul> 670 */ public 671 int setDelay(Delay delay) { 672 return libsbmlJNI.Event_setDelay(swigCPtr, this, Delay.getCPtr(delay), delay); 673 } 674 675 676/** 677 * (SBML Level 3 only) Sets the priority definition of this {@link Event} 678 * to a copy of the given {@link Priority} object instance. 679 <p> 680 * @param priority the {@link Priority} object instance to use 681 <p> 682 * @return integer value indicating success/failure of the 683 * function. The possible values 684 * returned by this function are: 685 * <ul> 686 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 687 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH } 688 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH } 689 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 690 * 691 * </ul> <p> 692 * @note The element 'priority' is available in SBML Level 3 693 * Version 1 Core, but is not present in lower Levels of SBML. 694 */ public 695 int setPriority(Priority priority) { 696 return libsbmlJNI.Event_setPriority(swigCPtr, this, Priority.getCPtr(priority), priority); 697 } 698 699 700/** 701 * Sets the 'timeUnits' attribute of this {@link Event} to a copy of <code>sid</code>. 702 <p> 703 * @param sid the identifier of the time units to use. 704 <p> 705 * @return integer value indicating success/failure of the 706 * function. The possible values 707 * returned by this function are: 708 * <ul> 709 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 710 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 711 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 712 * 713 * </ul> <p> 714 * <p> 715 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2 716 * Versions 1 and 2 included the additional attribute called 717 * 'timeUnits', but it was removed in SBML Level 2 Version 3. 718 * LibSBML supports this attribute for compatibility with previous versions 719 * of SBML Level 2, but its use is discouraged since models in 720 * Level 2 Versions 3 and 4 cannot contain it. If a 721 * Version 3 or 4 model sets the attribute, the 722 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 723 * an error.</span> 724 */ public 725 int setTimeUnits(String sid) { 726 return libsbmlJNI.Event_setTimeUnits(swigCPtr, this, sid); 727 } 728 729 730/** 731 * Sets the 'useValuesFromTriggerTime' attribute of this {@link Event} to a <code>value</code>. 732 <p> 733 * <p> 734 * The optional {@link Delay} on {@link Event} means there are two times to consider when 735 * computing the results of an event: the time at which the event is 736 * <em>triggered</em>, and the time at which assignments are 737 * <em>executed</em>. It is also possible to distinguish between the 738 * time at which the {@link EventAssignment}'s expression is calculated, and the 739 * time at which the assignment is made: the expression could be 740 * evaluated at the same time the assignments are performed, i.e., when 741 * the event is <em>executed</em>, but it could also be defined to be 742 * evaluated at the time the event is <em>triggered</em>. 743 <p> 744 * In SBML Level 2 versions prior to Version 4, the semantics 745 * of {@link Event} time delays were defined such that the expressions in the 746 * event's assignments were always evaluated at the time the event was 747 * <em>triggered</em>. This definition made it difficult to define an 748 * event whose assignment formulas were meant to be evaluated at the time 749 * the event was <em>executed</em> (i.e., after the time period defined 750 * by the value of the {@link Delay} element). In SBML Level 2 751 * Version 4, the attribute 'useValuesFromTriggerTime' on {@link Event} 752 * allows a model to indicate the time at which the event's assignments 753 * are intended to be evaluated. In SBML Level 2, the attribute has 754 * a default value of <code>true</code>, which corresponds to the interpretation of 755 * event assignments prior to Version 4: the values of the 756 * assignment formulas are computed at the moment the event is triggered, 757 * not after the delay. If 'useValuesFromTriggerTime'=<code>false</code>, it means 758 * that the formulas in the event's assignments are to be computed after 759 * the delay, at the time the event is executed. In SBML Level 3, 760 * the attribute is mandatory, not optional, and all events must specify 761 * a value for it. 762 <p> 763 * @param value the value of useValuesFromTriggerTime to use. 764 <p> 765 * @return integer value indicating success/failure of the 766 * function. The possible values 767 * returned by this function are: 768 * <ul> 769 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 770 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 771 * 772 * </ul> <p> 773 * <p> 774 * @warning <span class='warning'>The attribute 'useValuesFromTriggerTime' 775 * was introduced in SBML Level 2 Version 4. It is not valid in 776 * models defined using SBML Level 2 versions prior to Version 4. 777 * If a Level 2 Version 1–3 model sets the attribute, the 778 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 779 * an error.</span> 780 */ public 781 int setUseValuesFromTriggerTime(boolean value) { 782 return libsbmlJNI.Event_setUseValuesFromTriggerTime(swigCPtr, this, value); 783 } 784 785 786/** 787 * Unsets the value of the 'id' attribute of this {@link Event}. 788 <p> 789 * @return integer value indicating success/failure of the 790 * function. The possible values 791 * returned by this function are: 792 * <ul> 793 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 794 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 795 * </ul> 796 */ public 797 int unsetId() { 798 return libsbmlJNI.Event_unsetId(swigCPtr, this); 799 } 800 801 802/** 803 * Unsets the value of the 'name' attribute of this {@link Event}. 804 <p> 805 * @return integer value indicating success/failure of the 806 * function. The possible values 807 * returned by this function are: 808 * <ul> 809 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 810 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 811 * </ul> 812 */ public 813 int unsetName() { 814 return libsbmlJNI.Event_unsetName(swigCPtr, this); 815 } 816 817 818/** 819 * Unsets the {@link Delay} of this {@link Event}. 820 <p> 821 * @return integer value indicating success/failure of the 822 * function. The possible values 823 * returned by this function are: 824 * <ul> 825 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 826 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 827 * </ul> 828 */ public 829 int unsetDelay() { 830 return libsbmlJNI.Event_unsetDelay(swigCPtr, this); 831 } 832 833 834/** 835 * (SBML Level 3 only) Unsets the {@link Priority} of this {@link Event}. 836 <p> 837 * @return integer value indicating success/failure of the 838 * function. The possible values 839 * returned by this function are: 840 * <ul> 841 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 842 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 843 * 844 * </ul> <p> 845 * @note The element 'priority' is available in SBML Level 3 846 * Version 1 Core, but is not present in lower Levels of SBML. 847 */ public 848 int unsetPriority() { 849 return libsbmlJNI.Event_unsetPriority(swigCPtr, this); 850 } 851 852 853/** 854 * Unsets the {@link Trigger} of this {@link Event}. 855 <p> 856 * @return integer value indicating success/failure of the 857 * function. The possible values 858 * returned by this function are: 859 * <ul> 860 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 861 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 862 * 863 * </ul> <p> 864 * @note The element 'priority' is available in SBML Level 3 865 * Version 1 Core, but is not present in lower Levels of SBML. 866 */ public 867 int unsetTrigger() { 868 return libsbmlJNI.Event_unsetTrigger(swigCPtr, this); 869 } 870 871 872/** 873 * Unsets the 'timeUnits' attribute of this {@link Event}. 874 <p> 875 * @return integer value indicating success/failure of the 876 * function. The possible values 877 * returned by this function are: 878 * <ul> 879 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 880 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 881 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 882 * 883 * </ul> <p> 884 * <p> 885 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2 886 * Versions 1 and 2 included the additional attribute called 887 * 'timeUnits', but it was removed in SBML Level 2 Version 3. 888 * LibSBML supports this attribute for compatibility with previous versions 889 * of SBML Level 2, but its use is discouraged since models in 890 * Level 2 Versions 3 and 4 cannot contain it. If a 891 * Version 3 or 4 model sets the attribute, the 892 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 893 * an error.</span> 894 */ public 895 int unsetTimeUnits() { 896 return libsbmlJNI.Event_unsetTimeUnits(swigCPtr, this); 897 } 898 899 900/** 901 * Appends a copy of the given {@link EventAssignment} to this {@link Event}. 902 <p> 903 * @param ea the {@link EventAssignment} object to add. 904 <p> 905 * @return integer value indicating success/failure of the 906 * function. The possible values 907 * returned by this function are: 908 * <ul> 909 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 910 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH } 911 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH } 912 * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID } 913 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 914 * 915 * </ul> <p> 916 * <p> 917 * @note This method should be used with some caution. The fact that this 918 * method <em>copies</em> the object passed to it means that the caller will be 919 * left holding a physically different object instance than the one contained 920 * inside this object. Changes made to the original object instance (such as 921 * resetting attribute values) will <em>not affect the instance in this 922 * object</em>. In addition, the caller should make sure to free the 923 * original object if it is no longer being used, or else a memory leak will 924 * result. Please see other methods on this class (particularly a 925 * corresponding method whose name begins with the word <code>create</code>) 926 * for alternatives that do not lead to these issues. 927 <p> 928 * @see #createEventAssignment() 929 */ public 930 int addEventAssignment(EventAssignment ea) { 931 return libsbmlJNI.Event_addEventAssignment(swigCPtr, this, EventAssignment.getCPtr(ea), ea); 932 } 933 934 935/** 936 * Creates a new, empty {@link EventAssignment}, adds it to this {@link Event}'s list of 937 * event assignments and returns the {@link EventAssignment}. 938 <p> 939 * @return the newly created {@link EventAssignment} object instance 940 <p> 941 * @see #addEventAssignment(EventAssignment ea) 942 */ public 943 EventAssignment createEventAssignment() { 944 long cPtr = libsbmlJNI.Event_createEventAssignment(swigCPtr, this); 945 return (cPtr == 0) ? null : new EventAssignment(cPtr, false); 946 } 947 948 949/** 950 * Creates a new, empty {@link Trigger}, adds it to this {@link Event} and 951 * returns the {@link Trigger}. 952 <p> 953 * @return the newly created {@link Trigger} object instance 954 */ public 955 Trigger createTrigger() { 956 long cPtr = libsbmlJNI.Event_createTrigger(swigCPtr, this); 957 return (cPtr == 0) ? null : new Trigger(cPtr, false); 958 } 959 960 961/** 962 * Creates a new, empty {@link Delay}, adds it to this {@link Event} and 963 * returns the {@link Delay}. 964 <p> 965 * @return the newly created {@link Delay} object instance 966 */ public 967 Delay createDelay() { 968 long cPtr = libsbmlJNI.Event_createDelay(swigCPtr, this); 969 return (cPtr == 0) ? null : new Delay(cPtr, false); 970 } 971 972 973/** 974 * (SBML Level 3 only) Creates a new, empty {@link Priority}, adds it to this 975 * {@link Event} and returns the {@link Priority}. 976 <p> 977 * @return the newly created {@link Priority} object instance 978 <p> 979 * @note The element 'priority' is available in SBML Level 3 980 * Version 1 Core, but is not present in lower Levels of SBML. 981 */ public 982 Priority createPriority() { 983 long cPtr = libsbmlJNI.Event_createPriority(swigCPtr, this); 984 return (cPtr == 0) ? null : new Priority(cPtr, false); 985 } 986 987 988/** 989 * Returns the list of event assignments for this {@link Event}. 990 <p> 991 * @return the list of EventAssignments for this {@link Event}. 992 */ public 993 ListOfEventAssignments getListOfEventAssignments() { 994 long cPtr = libsbmlJNI.Event_getListOfEventAssignments__SWIG_0(swigCPtr, this); 995 return (cPtr == 0) ? null : new ListOfEventAssignments(cPtr, false); 996 } 997 998 999/** 1000 * Return a specific {@link EventAssignment} object of this {@link Event}. 1001 <p> 1002 * @param n an integer, the index of the {@link EventAssignment} object to return 1003 <p> 1004 * @return the <code>n</code>th {@link EventAssignment} of this {@link Event}. 1005 */ public 1006 EventAssignment getEventAssignment(long n) { 1007 long cPtr = libsbmlJNI.Event_getEventAssignment__SWIG_0(swigCPtr, this, n); 1008 return (cPtr == 0) ? null : new EventAssignment(cPtr, false); 1009 } 1010 1011 1012/** 1013 * Return the event assignment indicated by the given <code>variable</code>. 1014 <p> 1015 * @param variable a string, the identifier of the variable whose 1016 * {@link EventAssignment} is being sought. 1017 <p> 1018 * @return the {@link EventAssignment} for the given <code>variable</code>, or <code>null</code> if 1019 * no such {@link EventAssignment} exits. 1020 */ public 1021 EventAssignment getEventAssignment(String variable) { 1022 long cPtr = libsbmlJNI.Event_getEventAssignment__SWIG_2(swigCPtr, this, variable); 1023 return (cPtr == 0) ? null : new EventAssignment(cPtr, false); 1024 } 1025 1026 1027/** 1028 * Returns the number of {@link EventAssignment} objects attached to this 1029 * {@link Event}. 1030 <p> 1031 * @return the number of EventAssignments in this {@link Event}. 1032 */ public 1033 long getNumEventAssignments() { 1034 return libsbmlJNI.Event_getNumEventAssignments(swigCPtr, this); 1035 } 1036 1037 1038/** 1039 * Removes the nth {@link EventAssignment} object from this {@link Event} object and 1040 * returns a pointer to it. 1041 <p> 1042 * The caller owns the returned object and is responsible for deleting it. 1043 <p> 1044 * @param n the index of the {@link EventAssignment} object to remove 1045 <p> 1046 * @return the {@link EventAssignment} object removed. As mentioned above, 1047 * the caller owns the returned item. <code>null</code> is returned if the given index 1048 * is out of range. 1049 */ public 1050 EventAssignment removeEventAssignment(long n) { 1051 long cPtr = libsbmlJNI.Event_removeEventAssignment__SWIG_0(swigCPtr, this, n); 1052 return (cPtr == 0) ? null : new EventAssignment(cPtr, true); 1053 } 1054 1055 1056/** 1057 * Removes the {@link EventAssignment} object with the given 'variable' attribute 1058 * from this {@link Event} object and returns a pointer to it. 1059 <p> 1060 * The caller owns the returned object and is responsible for deleting it. 1061 * If none of the {@link EventAssignment} objects in this {@link Event} object have the 1062 * 'variable' attribute <code>variable</code>, then <code>null</code> is returned. 1063 <p> 1064 * @param variable the 'variable' attribute of the {@link EventAssignment} object 1065 * to remove 1066 <p> 1067 * @return the {@link EventAssignment} object removed. As mentioned above, the 1068 * caller owns the returned object. <code>null</code> is returned if no {@link EventAssignment} 1069 * object with the 'variable' attribute exists in this {@link Event} object. 1070 */ public 1071 EventAssignment removeEventAssignment(String variable) { 1072 long cPtr = libsbmlJNI.Event_removeEventAssignment__SWIG_1(swigCPtr, this, variable); 1073 return (cPtr == 0) ? null : new EventAssignment(cPtr, true); 1074 } 1075 1076 1077/** 1078 * Sets this SBML object to child SBML objects (if any). 1079 * (Creates a child-parent relationship by the parent) 1080 <p> 1081 * Subclasses must override this function if they define 1082 * one ore more child elements. 1083 * Basically, this function needs to be called in 1084 * constructor, copy constructor and assignment operator. 1085 <p> 1086 * @see setSBMLDocument 1087 * @see enablePackageInternal 1088 * @internal 1089 */ public 1090 void connectToChild() { 1091 libsbmlJNI.Event_connectToChild(swigCPtr, this); 1092 } 1093 1094 1095/** 1096 * Enables/Disables the given package with this element and child 1097 * elements (if any). 1098 * (This is an internal implementation for enablePackage function) 1099 <p> 1100 * @note Subclasses of the SBML Core package in which one or more child 1101 * elements are defined must override this function. 1102 * @internal 1103 */ public 1104 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 1105 libsbmlJNI.Event_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 1106 } 1107 1108 1109/** 1110 * Returns the libSBML type code of this object instance. 1111 <p> 1112 * <p> 1113 * LibSBML attaches an identifying code to every kind of SBML object. These 1114 * are integer constants known as <em>SBML type codes</em>. The names of all 1115 * the codes begin with the characters “<code>SBML_</code>”. 1116 * In the Java language interface for libSBML, the 1117 * type codes are defined as static integer constants in the interface class 1118 * {@link libsbmlConstants}. Note that different Level 3 1119 * package plug-ins may use overlapping type codes; to identify the package 1120 * to which a given object belongs, call the <code>getPackageName()</code> 1121 * method on the object. 1122 <p> 1123 * @return the SBML type code for this object: 1124 * {@link libsbmlConstants#SBML_EVENT SBML_EVENT} (default). 1125 <p> 1126 * <p> 1127 * @warning <span class='warning'>The specific integer values of the possible 1128 * type codes may be reused by different Level 3 package plug-ins. 1129 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 1130 * both getTypeCode() and getPackageName()</strong>.</span> 1131 <p> 1132 * @see #getElementName() 1133 * @see #getPackageName() 1134 */ public 1135 int getTypeCode() { 1136 return libsbmlJNI.Event_getTypeCode(swigCPtr, this); 1137 } 1138 1139 1140/** 1141 * Returns the XML element name of this object, which for {@link Event}, is 1142 * always <code>'event'.</code> 1143 <p> 1144 * @return the name of this element, i.e., <code>'event'.</code> 1145 */ public 1146 String getElementName() { 1147 return libsbmlJNI.Event_getElementName(swigCPtr, this); 1148 } 1149 1150 1151/** 1152 * Predicate returning <code>true</code> if all the required attributes for this 1153 * {@link Event} object have been set. 1154 <p> 1155 * @note The required attributes for an {@link Event} object are: 1156 * <ul> 1157 * <li> 'useValuesfromTriggerTime' (required in SBML Level 3) 1158 * </ul> 1159 */ public 1160 boolean hasRequiredAttributes() { 1161 return libsbmlJNI.Event_hasRequiredAttributes(swigCPtr, this); 1162 } 1163 1164 1165/** 1166 * Predicate returning <code>true</code> if 1167 * all the required elements for the given Event_t structure 1168 * have been set. 1169 <p> 1170 * @note The required elements for an {@link Event} object are: 1171 * <ul> 1172 * <li> 'trigger' 1173 * <li> 'listOfEventAssignments' (required in SBML Level 2, optional in Level 3) 1174 * </ul> 1175 */ public 1176 boolean hasRequiredElements() { 1177 return libsbmlJNI.Event_hasRequiredElements(swigCPtr, this); 1178 } 1179 1180}