001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.10 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 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 2</h3> 032 <p> 033 * In SBML Level 2 versions before Version 4, the semantics of 034 * {@link Event} time delays were defined such that the expressions in the event's 035 * assignments were always evaluated at the time the event was 036 * <em>triggered</em>. This definition made it difficult to define an event 037 * whose assignment formulas were meant to be evaluated at the time the 038 * event was <em>executed</em> (i.e., after the time period defined 039 * by the value of the {@link Delay} element, or after any other simultaneous 040 * event may have been <em>executed</em> and changed the model state). 041 * In SBML Level 2 Version 4 and in 042 * Level 3, the attribute 'useValuesFromTriggerTime' on {@link Event} was added 043 * to allow a model to indicate the time at which the event's assignments 044 * are to be calculated, whether at the moment the event is triggered (if 045 * the value of the attribute is <code>true</code>), or at the moment of execution 046 * (if 'useValuesFromTriggerTime'=<code>false</code>). If the event has a delay, 047 * the 'useValuesFromTriggerTime' is likely to make a significant difference 048 * in the values used in the assignment, but the possibility of simultaneous 049 * events mean that even zero-delay events can have different results 050 * depending on the value of this attribute. 051 <p> 052 * The definition of {@link Event} in SBML Level 2 Versions 1 and 2 includes 053 * an additional attribute called 'timeUnits', which allowed the time units 054 * of the {@link Delay} to be set explicitly. Later Versions of SBML Level 2 055 * as well as SBML Level 3 do not define this attribute. LibSBML 056 * supports this attribute for compatibility with previous versions of SBML 057 * Level 2; however, if a model in SBML Level 3 or Level 2 058 * Versions 3–4 format sets the attribute, the 059 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 060 * an error. 061 <p> 062 * The attribute 'useValuesFromTriggerTime' was introduced in SBML 063 * Level 2 Version 4. Models defined in prior Versions of SBML 064 * Level 2 cannot use this attribute, and 065 * {@link SBMLDocument#checkConsistency()} will report an error if they do. 066 <p> 067 * <h3>SBML Level 3</h3> 068 <p> 069 * SBML Level 3 introduces several changes to the structure and components 070 * of Events compared to SBML Level 2. These changes fall into two 071 * main categories: changes to what is optional or required, and additions 072 * of new attributes and elements. 073 * <ul> 074 * <li> The attribute 'useValuesFromTriggerTime' on {@link Event} is mandatory (it 075 * was optional in Level 2 and had a default value of <code>true</code>); 076 * <li> {@link Event}'s 'listOfEventAssignments' element (of class 077 * {@link ListOfEventAssignments}) is optional (it was mandatory in Level 2); 078 * <li> {@link Event}'s 'priority' element (of class {@link Priority}) is new in 079 * Level 3; and 080 * <li> The {@link Trigger} object gains new mandatory attributes (described as part 081 * of the definition of {@link Trigger}). 082 * <li> In SBML Level 3 Version 2, the {@link Trigger} object became 083 * optional. An {@link Event} with no {@link Trigger} will simply not fire. 084 * </ul> 085 <p> 086 * The changes to the attributes of {@link Event} are described below; the changes 087 * to {@link Trigger} and {@link Priority} are described in their respective sections. 088 <p> 089 * <h2>Semantics of events in SBML Level 3 Version 1</h2> 090 <p> 091 * The detailed semantics of events are described in the specification 092 * documents for each SBML Level/Version. Here we include the description 093 * from the SBML Level 1 Version 1. 094 * Any transition of a {@link Trigger} object's 'math' formula from the value 095 * <code>false</code> to <code>true</code> will cause the enclosing {@link Event} object to 096 * <em>trigger</em>. Such a transition is not possible at the very start 097 * of a simulation (i.e., at time <em>t = 0</em>) unless the {@link Trigger} 098 * object's 'initialValue' attribute has a value of <code>false</code>; this defines 099 * the value of the trigger formula to be <code>false</code> immediately prior to the 100 * start of simulation, thereby giving it the potential to change in value 101 * from <code>false</code> to <code>true</code> when the formula is evaluated at <em>t = 102 * 0</em>. If 'initialValue'=<code>true</code>, then the trigger expression cannot 103 * transition from <code>false</code> to <code>true</code> at <em>t = 0</em> but may do so at 104 * some time <em>t > 0</em>. 105 <p> 106 * Consider an {@link Event} object definition <EM>E</EM> with delay <em>d</em> in 107 * which the {@link Trigger} object's 'math' formula makes a transition in value 108 * from <code>false</code> to <code>true</code> at times <em>t<sub>1</sub></em> and 109 * <em>t<sub>2</sub></em>. The {@link EventAssignment} within the {@link Event} object 110 * will have effect at <em>t<sub>1</sub> + d</em> and 111 * <em>t<sub>2</sub> + d</em> irrespective of the relative times of 112 * <em>t<sub>1</sub></em> and <em>t<sub>2</sub></em>. For example, events 113 * can 'overlap' so that <em>t<sub>1</sub> < t<sub>2</sub> < 114 * t<sub>1</sub> + d</em> still causes an event assignments to occur at 115 * <em>t<sub>1</sub> + d</em> and <em>t<sub>2</sub> + d</em>. 116 <p> 117 * It is entirely possible for two events to be executed simultaneously, 118 * and it is possible for events to trigger other events (i.e., an event 119 * assignment can cause an event to trigger). This leads to several 120 * points: 121 * <ul> 122 <p> 123 * <li> A software package should retest all event triggers after executing 124 * an event assignment in order to account for the possibility that the 125 * assignment causes another event trigger to transition from <code>false</code> to 126 * <code>true.</code> This check should be made after each individual {@link Event} object's 127 * execution, even when several events are to be executed simultaneously. 128 <p> 129 * <li> Any {@link Event} object whose {@link Trigger} 'persistent' attribute has the value 130 * <code>false</code> must have its trigger expression reevaluated continuously 131 * between when the event is triggered and when it is executed. If 132 * its trigger expression ever evaluates to <code>false</code>, it must be removed 133 * from the queue of events pending execution and treated as any other 134 * event whose trigger expression evaluates to <code>false.</code> 135 <p> 136 * <li> Although the precise time at which events are executed is not 137 * resolved beyond the given execution point in simulated time, it is 138 * assumed that the order in which the events occur <em>is</em> resolved. 139 * This order can be significant in determining the overall outcome of a 140 * given simulation. When an event <EM>X</EM> <em>triggers</em> another 141 * event <EM>Y</EM> and event <EM>Y</EM> has zero delay, then event 142 * <EM>Y</EM> is added to the existing set of simultaneous events that are 143 * pending <em>execution</em>. Events <EM>X</EM> and <EM>Y</EM> form a 144 * cascade of events at the same point in simulation time. An event such 145 * as <EM>Y</EM> may have a special priority if it contains a {@link Priority} 146 * subobject. 147 <p> 148 * <li> All events in a model are open to being in a cascade. The position 149 * of an event in the event queue does not affect whether it can be in the 150 * cascade: event <EM>Y</EM> can be triggered whether it is before or after 151 * <EM>X</EM> in the queue of events pending execution. A cascade of 152 * events can be potentially infinite (never terminate); when this occurs a 153 * simulator should indicate this has occurred—it is incorrect for a 154 * simulator to break a cascade arbitrarily and continue the simulation 155 * without at least indicating that the infinite cascade occurred. 156 <p> 157 * <li> Simultaneous events having no defined priorities are executed in an 158 * undefined order. This does not mean that the behavior of the simulation 159 * is completely undefined; merely that the <em>order</em> of execution of 160 * these particular events is undefined. A given simulator may use any 161 * algorithm to choose an order as long as every event is executed exactly 162 * once. 163 <p> 164 * <li> Events with defined priorities are executed in the order implied by 165 * their {@link Priority} 'math' formula values, with events having higher 166 * priorities being executed ahead of events with lower priorities, and 167 * events with identical priorities being executed in a random order with 168 * respect to one another (as determined at run-time by some random 169 * algorithm equivalent to coin-flipping). Newly-triggered events that are 170 * to be executed immediately (i.e., if they define no delays) should be 171 * inserted into the queue of events pending execution according to their 172 * priorities: events with higher priority values value must be inserted 173 * ahead of events with lower priority values and after any pending events 174 * with even higher priorities, and inserted randomly among pending events 175 * with the same priority values. Events without {@link Priority} objects must be 176 * inserted into the queue in some fashion, but the algorithm used to place 177 * it in the queue is undefined. Similarly, there is no restriction on the 178 * order of a newly-inserted event with a defined {@link Priority} with respect to 179 * any other pending {@link Event} without a defined {@link Priority}. 180 <p> 181 * <li> A model variable that is the target of one or more event 182 * assignments can change more than once when simultaneous events are 183 * processed at some time point <em>t</em>. The model's behavior (output) 184 * for such a variable is the value of the variable at the end of 185 * processing all the simultaneous events at time <em>t</em>. 186 <p> 187 * </ul> 188 <p> 189 * <h2>Restrictions relaxed in SBML Level 3 Version 2</h2> 190 <p> 191 * In SBML Level 3 Version 2, several restrictions were lifted 192 * that have the potential to affect the semantics of an Event: 193 <p> 194 * <ul> 195 * <li> The {@link Trigger} subobject of an {@link Event} is optional. If missing, 196 * an {@link Event} is never <em>triggered</em>, unless an alternate triggering 197 * scheme is introduced by an SBML Level 3 package. 198 <p> 199 * <li> The 'math' subelements of an {@link Event} Trigger, {@link Delay}, {@link Priority}, 200 * and {@link EventAssignment} are all optional. If any of these elements lack 201 * a 'math' subelement, and that information is not supplied in an SBML 202 * Level 3 package, it is mathematically equivalent to the {@link Trigger}, 203 * {@link Delay}, {@link Priority}, or {@link EventAssignment} not being present at all. 204 <p> 205 * <li> The {@link ListOfEventAssignments} may be empty, which is mathematically 206 * equivalent to the {@link Event} not having a {@link ListOfEventAssignments} at all. 207 <p> 208 * <li> Any 'math' subelement may return a Boolean or a numeric value 209 * in any context. If a numeric value is used in a Boolean context, 210 * a '0' is interpreted as <code>false</code>, and all other values are 211 * interpreted as <code>true.</code> If a Boolean value is used in a numeric 212 * context, a <code>true</code> is interpreted as a 1, and a <code>false</code> is 213 * interpreted as a 0. This means (for example) that a {@link Trigger} value 214 * that changes from 0.0 to anything else is equivalent to changing 215 * from <code>false</code> to <code>true.</code> 216 * </ul> 217 <p> 218 * @see Trigger 219 * @see Priority 220 * @see Delay 221 * @see EventAssignment 222 */ 223 224public class Event extends SBase { 225 private long swigCPtr; 226 227 protected Event(long cPtr, boolean cMemoryOwn) 228 { 229 super(libsbmlJNI.Event_SWIGUpcast(cPtr), cMemoryOwn); 230 swigCPtr = cPtr; 231 } 232 233 protected static long getCPtr(Event obj) 234 { 235 return (obj == null) ? 0 : obj.swigCPtr; 236 } 237 238 protected static long getCPtrAndDisown (Event obj) 239 { 240 long ptr = 0; 241 242 if (obj != null) 243 { 244 ptr = obj.swigCPtr; 245 obj.swigCMemOwn = false; 246 } 247 248 return ptr; 249 } 250 251 protected void finalize() { 252 delete(); 253 } 254 255 public synchronized void delete() { 256 if (swigCPtr != 0) { 257 if (swigCMemOwn) { 258 swigCMemOwn = false; 259 libsbmlJNI.delete_Event(swigCPtr); 260 } 261 swigCPtr = 0; 262 } 263 super.delete(); 264 } 265 266 267/** 268 * Creates a new {@link Event} using the given SBML <code>level</code> and <code>version</code> 269 * values. 270 <p> 271 * @param level a long integer, the SBML Level to assign to this {@link Event}. 272 <p> 273 * @param version a long integer, the SBML Version to assign to this 274 * {@link Event}. 275 <p> 276 * <p> 277 * @throws SBMLConstructorException 278 * Thrown if the given <code>level</code> and <code>version</code> combination are invalid 279 * or if this object is incompatible with the given level and version. 280 <p> 281 * <p> 282 * @note Attempting to add an object to an {@link SBMLDocument} having a different 283 * combination of SBML Level, Version and XML namespaces than the object 284 * itself will result in an error at the time a caller attempts to make the 285 * addition. A parent object must have compatible Level, Version and XML 286 * namespaces. (Strictly speaking, a parent may also have more XML 287 * namespaces than a child, but the reverse is not permitted.) The 288 * restriction is necessary to ensure that an SBML model has a consistent 289 * overall structure. This requires callers to manage their objects 290 * carefully, but the benefit is increased flexibility in how models can be 291 * created by permitting callers to create objects bottom-up if desired. In 292 * situations where objects are not yet attached to parents (e.g., 293 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 294 * libSBML determine such things as whether it is valid to assign a 295 * particular value to an attribute. 296 */ public 297 Event(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 298 this(libsbmlJNI.new_Event__SWIG_0(level, version), true); 299 } 300 301 302/** 303 * Creates a new {@link Event} using the given {@link SBMLNamespaces} object 304 * <code>sbmlns</code>. 305 <p> 306 * <p> 307 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 308 * information. It is used to communicate the SBML Level, Version, and (in 309 * Level 3) packages used in addition to SBML Level 3 Core. A 310 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 311 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object 312 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 313 <p> 314 * @param sbmlns an {@link SBMLNamespaces} object. 315 <p> 316 * <p> 317 * @throws SBMLConstructorException 318 * Thrown if the given <code>sbmlns</code> is inconsistent or incompatible 319 * with this object. 320 <p> 321 * <p> 322 * @note Attempting to add an object to an {@link SBMLDocument} having a different 323 * combination of SBML Level, Version and XML namespaces than the object 324 * itself will result in an error at the time a caller attempts to make the 325 * addition. A parent object must have compatible Level, Version and XML 326 * namespaces. (Strictly speaking, a parent may also have more XML 327 * namespaces than a child, but the reverse is not permitted.) The 328 * restriction is necessary to ensure that an SBML model has a consistent 329 * overall structure. This requires callers to manage their objects 330 * carefully, but the benefit is increased flexibility in how models can be 331 * created by permitting callers to create objects bottom-up if desired. In 332 * situations where objects are not yet attached to parents (e.g., 333 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 334 * libSBML determine such things as whether it is valid to assign a 335 * particular value to an attribute. 336 */ public 337 Event(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 338 this(libsbmlJNI.new_Event__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 339 } 340 341 342/** 343 * Copy constructor; creates a copy of this {@link Event}. 344 <p> 345 * @param orig the object to copy. 346 */ public 347 Event(Event orig) throws org.sbml.libsbml.SBMLConstructorException { 348 this(libsbmlJNI.new_Event__SWIG_2(Event.getCPtr(orig), orig), true); 349 } 350 351 352/** 353 * Creates and returns a deep copy of this {@link Event} object. 354 <p> 355 * @return the (deep) copy of this {@link Event} object. 356 */ public 357 Event cloneObject() { 358 long cPtr = libsbmlJNI.Event_cloneObject(swigCPtr, this); 359 return (cPtr == 0) ? null : new Event(cPtr, true); 360 } 361 362 363/** 364 * Initializes the fields of this {@link Event} object to 'typical' default 365 * values. 366 <p> 367 * The SBML {@link Event} component has slightly different aspects and 368 * default attribute values in different SBML Levels and Versions. 369 * This method sets the values to certain common defaults, based 370 * mostly on what they are in SBML Level 2. Specifically: 371 <p> 372 * <ul> 373 * <li> Sets attribute 'useValuesFromTriggerTime' to <code>true</code> 374 * </ul> 375 */ public 376 void initDefaults() { 377 libsbmlJNI.Event_initDefaults(swigCPtr, this); 378 } 379 380 381/** 382 * Returns the first child element found that has the given <code>id</code> in the 383 * model-wide SId namespace, or <code>null</code> if no such object is found. 384 <p> 385 * @param id string representing the id of the object to find. 386 <p> 387 * @return pointer to the first element found with the given <code>id</code>. 388 */ public 389 SBase getElementBySId(String id) { 390 return libsbml.DowncastSBase(libsbmlJNI.Event_getElementBySId(swigCPtr, this, id), false); 391} 392 393 394/** 395 * Returns the first child element it can find with the given <code>metaid</code>, or 396 * <code>null</code> if no such object is found. 397 <p> 398 * @param metaid string representing the metaid of the object to find. 399 <p> 400 * @return pointer to the first element found with the given <code>metaid</code>. 401 */ public 402 SBase getElementByMetaId(String metaid) { 403 return libsbml.DowncastSBase(libsbmlJNI.Event_getElementByMetaId(swigCPtr, this, metaid), false); 404} 405 406 407/** 408 * Returns the value of the 'id' attribute of this {@link Event}. 409 <p> 410 * @note Because of the inconsistent behavior of this function with 411 * respect to assignments and rules, it is now recommended to 412 * use the getIdAttribute() function instead. 413 <p> 414 * <p> 415 * The identifier given by an object's 'id' attribute value 416 * is used to identify the object within the SBML model definition. 417 * Other objects can refer to the component using this identifier. The 418 * data type of 'id' is always <code>SId</code> or a type derived 419 * from that, such as <code>UnitSId</code>, depending on the object in 420 * question. All data types are defined as follows: 421 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 422 * letter .= 'a'..'z','A'..'Z' 423 * digit .= '0'..'9' 424 * idChar .= letter | digit | '_' 425 * SId .= ( letter | '_' ) idChar* 426 * </pre> 427 <p> 428 * The characters <code>(</code> and <code>)</code> are used for grouping, the 429 * character <code>*</code> 'zero or more times', and the character 430 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 431 * determined by an exact character sequence match; i.e., comparisons must be 432 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 433 * <code>SIdRef</code>, and derived types. 434 <p> 435 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 436 * moved to {@link SBase} directly, instead of being defined individually for many 437 * (but not all) objects. Libsbml has for a long time provided functions 438 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 439 * would fail or otherwise return empty strings if executed on any object 440 * for which those attributes were not defined. Now that all {@link SBase} objects 441 * define those attributes, those functions now succeed for any object with 442 * the appropriate level and version. 443 <p> 444 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 445 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 446 * functions (though not the setId() or unsetId() functions) would instead 447 * reference the value of the 'variable' attribute (for the rules and event 448 * assignments) or the 'symbol' attribute (for initial assignments). 449 * The {@link AlgebraicRule} fell into this category as well, though because it 450 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 451 * always return an empty string, and isSetId() would always return <code>false.</code> 452 * For this reason, four new functions are now provided 453 * (getIdAttribute(), setIdAttribute(String), 454 * isSetIdAttribute(), and unsetIdAttribute()) that will always 455 * act on the actual 'id' attribute, regardless of the object's type. The 456 * new functions should be used instead of the old ones unless the old behavior 457 * is somehow necessary. 458 <p> 459 * Regardless of the level and version of the SBML, these functions allow 460 * client applications to use more generalized code in some situations 461 * (for instance, when manipulating objects that are all known to have 462 * identifiers). If the object in question does not posess an 'id' attribute 463 * according to the SBML specification for the Level and Version in use, 464 * libSBML will not allow the identifier to be set, nor will it read or 465 * write 'id' attributes for those objects. 466 <p> 467 * @return the id of this {@link Event}. 468 <p> 469 * @see #getIdAttribute() 470 * @see #setIdAttribute(String sid) 471 * @see #isSetIdAttribute() 472 * @see #unsetIdAttribute() 473 */ public 474 String getId() { 475 return libsbmlJNI.Event_getId(swigCPtr, this); 476 } 477 478 479/** 480 * Returns the value of the 'name' attribute of this {@link Event}. 481 <p> 482 * <p> 483 * <p> 484 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 485 * moved to {@link SBase} directly, instead of being defined individually for many 486 * (but not all) objects. Libsbml has for a long time provided functions 487 * defined on {@link SBase} itself to get, set, and unset those attributes, which 488 * would fail or otherwise return empty strings if executed on any object 489 * for which those attributes were not defined. Now that all {@link SBase} objects 490 * define those attributes, those functions now succeed for any object with 491 * the appropriate level and version. 492 <p> 493 * The 'name' attribute is 494 * optional and is not intended to be used for cross-referencing purposes 495 * within a model. Its purpose instead is to provide a human-readable 496 * label for the component. The data type of 'name' is the type 497 * <code>string</code> defined in XML Schema. SBML imposes no 498 * restrictions as to the content of 'name' attributes beyond those 499 * restrictions defined by the <code>string</code> type in XML Schema. 500 <p> 501 * The recommended practice for handling 'name' is as follows. If a 502 * software tool has the capability for displaying the content of 'name' 503 * attributes, it should display this content to the user as a 504 * component's label instead of the component's 'id'. If the user 505 * interface does not have this capability (e.g., because it cannot 506 * display or use special characters in symbol names), or if the 'name' 507 * attribute is missing on a given component, then the user interface 508 * should display the value of the 'id' attribute instead. (Script 509 * language interpreters are especially likely to display 'id' instead of 510 * 'name'.) 511 <p> 512 * As a consequence of the above, authors of systems that automatically 513 * generate the values of 'id' attributes should be aware some systems 514 * may display the 'id''s to the user. Authors therefore may wish to 515 * take some care to have their software create 'id' values that are: (a) 516 * reasonably easy for humans to type and read; and (b) likely to be 517 * meaningful, for example by making the 'id' attribute be an abbreviated 518 * form of the name attribute value. 519 <p> 520 * An additional point worth mentioning is although there are 521 * restrictions on the uniqueness of 'id' values, there are no 522 * restrictions on the uniqueness of 'name' values in a model. This 523 * allows software applications leeway in assigning component identifiers. 524 <p> 525 * Regardless of the level and version of the SBML, these functions allow 526 * client applications to use more generalized code in some situations 527 * (for instance, when manipulating objects that are all known to have 528 * names). If the object in question does not posess a 'name' attribute 529 * according to the SBML specification for the Level and Version in use, 530 * libSBML will not allow the name to be set, nor will it read or 531 * write 'name' attributes for those objects. 532 <p> 533 * @return the name of this SBML object, or the empty string if not set or unsettable. 534 <p> 535 * @see #getIdAttribute() 536 * @see #isSetName() 537 * @see #setName(String sid) 538 * @see #unsetName() 539 */ public 540 String getName() { 541 return libsbmlJNI.Event_getName(swigCPtr, this); 542 } 543 544 545/** 546 * Get the event trigger portion of this {@link Event}. 547 <p> 548 * @return the {@link Trigger} object of this {@link Event}, or <code>null</code> if the trigger is not set. 549 */ public 550 Trigger getTrigger() { 551 long cPtr = libsbmlJNI.Event_getTrigger__SWIG_0(swigCPtr, this); 552 return (cPtr == 0) ? null : new Trigger(cPtr, false); 553 } 554 555 556/** 557 * Get the assignment delay portion of this {@link Event}, if there is one. 558 <p> 559 * @return the delay of this {@link Event} if one is defined, or <code>null</code> if none 560 * is defined. 561 */ public 562 Delay getDelay() { 563 long cPtr = libsbmlJNI.Event_getDelay__SWIG_0(swigCPtr, this); 564 return (cPtr == 0) ? null : new Delay(cPtr, false); 565 } 566 567 568/** 569 * (SBML Level 3 only) Get the event priority portion of this 570 * {@link Event}. 571 <p> 572 * @return the {@link Priority} object of this {@link Event}, or null if the {@link Priority} 573 * has not been set. 574 <p> 575 * @note The element 'priority' is available in SBML Level 3, 576 * but is not present in lower Levels of SBML. 577 */ public 578 Priority getPriority() { 579 long cPtr = libsbmlJNI.Event_getPriority__SWIG_0(swigCPtr, this); 580 return (cPtr == 0) ? null : new Priority(cPtr, false); 581 } 582 583 584/** 585 * Get the value of the 'timeUnits' attribute of this {@link Event}, if it has one. 586 <p> 587 * @return the value of the attribute 'timeUnits' as a string. 588 <p> 589 * <p> 590 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2 591 * Versions 1 and 2 included the additional attribute called 592 * 'timeUnits', but it was removed in SBML Level 2 Version 3. 593 * LibSBML supports this attribute for compatibility with previous versions 594 * of SBML Level 2, but its use is discouraged since models in 595 * Level 2 Versions 3 and 4 cannot contain it. If a 596 * Version 3 or 4 model sets the attribute, the 597 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 598 * an error.</span> 599 */ public 600 String getTimeUnits() { 601 return libsbmlJNI.Event_getTimeUnits(swigCPtr, this); 602 } 603 604 605/** 606 * Get the value of the 'useValuesFromTriggerTime' attribute of this {@link Event}. 607 <p> 608 * <p> 609 * The optional {@link Delay} on {@link Event} and the fact that multiple events may be 610 * simultaneously executed means there are two times to consider when 611 * computing the results of an event: the time at which the event is 612 * <em>triggered</em>, and the time at which assignments are 613 * <em>executed</em>. It is also possible to distinguish between the 614 * time at which the {@link EventAssignment}'s expression is calculated, and the 615 * time at which the assignment is made: the expression could be 616 * evaluated at the same time the assignments are performed, i.e., when 617 * the event is <em>executed</em>, but it could also be defined to be 618 * evaluated at the time the event is <em>triggered</em>. 619 <p> 620 * In SBML Level 2 versions prior to Version 4, the semantics 621 * of {@link Event} time delays were defined such that the expressions in the 622 * event's assignments were always evaluated at the time the event was 623 * <em>triggered</em>. This definition made it difficult to define an 624 * event whose assignment formulas were meant to be evaluated at the time 625 * the event was <em>executed</em> (i.e., after the time period defined 626 * by the value of the {@link Delay} element, or after any other simultaneous 627 * event may have been <em>executed</em> and changed the model state). 628 * In SBML Level 2 629 * Version 4, the attribute 'useValuesFromTriggerTime' on {@link Event} 630 * allows a model to indicate the time at which the event's assignments 631 * are intended to be evaluated. In SBML Level 2, the attribute has 632 * a default value of <code>true</code>, which corresponds to the interpretation of 633 * event assignments prior to Version 4: the values of the 634 * assignment formulas are computed at the moment the event is triggered, 635 * not after the delay. If 'useValuesFromTriggerTime'=<code>false</code>, it means 636 * that the formulas in the event's assignments are to be computed after 637 * the delay, at the time the event is executed. In SBML Level 3, 638 * the attribute is mandatory, not optional, and all events must specify 639 * a value for it. 640 <p> 641 * @return the value of the attribute 'useValuesFromTriggerTime' as a boolean. 642 <p> 643 * <p> 644 * @warning <span class='warning'>The attribute 'useValuesFromTriggerTime' 645 * was introduced in SBML Level 2 Version 4. It is not valid in 646 * models defined using SBML Level 2 versions prior to Version 4. 647 * If a Level 2 Version 1–3 model sets the attribute, the 648 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 649 * an error.</span> 650 */ public 651 boolean getUseValuesFromTriggerTime() { 652 return libsbmlJNI.Event_getUseValuesFromTriggerTime(swigCPtr, this); 653 } 654 655 656/** 657 * Predicate returning <code>true</code> if this 658 * {@link Event}'s 'id' attribute is set. 659 <p> 660 * <p> 661 * @note Because of the inconsistent behavior of this function with 662 * respect to assignments and rules, it is now recommended to 663 * use the isSetIdAttribute() function instead. 664 <p> 665 * <p> 666 * The identifier given by an object's 'id' attribute value 667 * is used to identify the object within the SBML model definition. 668 * Other objects can refer to the component using this identifier. The 669 * data type of 'id' is always <code>SId</code> or a type derived 670 * from that, such as <code>UnitSId</code>, depending on the object in 671 * question. All data types are defined as follows: 672 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 673 * letter .= 'a'..'z','A'..'Z' 674 * digit .= '0'..'9' 675 * idChar .= letter | digit | '_' 676 * SId .= ( letter | '_' ) idChar* 677 * </pre> 678 <p> 679 * The characters <code>(</code> and <code>)</code> are used for grouping, the 680 * character <code>*</code> 'zero or more times', and the character 681 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 682 * determined by an exact character sequence match; i.e., comparisons must be 683 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 684 * <code>SIdRef</code>, and derived types. 685 <p> 686 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 687 * moved to {@link SBase} directly, instead of being defined individually for many 688 * (but not all) objects. Libsbml has for a long time provided functions 689 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 690 * would fail or otherwise return empty strings if executed on any object 691 * for which those attributes were not defined. Now that all {@link SBase} objects 692 * define those attributes, those functions now succeed for any object with 693 * the appropriate level and version. 694 <p> 695 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 696 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 697 * functions (though not the setId() or unsetId() functions) would instead 698 * reference the value of the 'variable' attribute (for the rules and event 699 * assignments) or the 'symbol' attribute (for initial assignments). 700 * The {@link AlgebraicRule} fell into this category as well, though because it 701 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 702 * always return an empty string, and isSetId() would always return <code>false.</code> 703 * For this reason, four new functions are now provided 704 * (getIdAttribute(), setIdAttribute(String), 705 * isSetIdAttribute(), and unsetIdAttribute()) that will always 706 * act on the actual 'id' attribute, regardless of the object's type. The 707 * new functions should be used instead of the old ones unless the old behavior 708 * is somehow necessary. 709 <p> 710 * Regardless of the level and version of the SBML, these functions allow 711 * client applications to use more generalized code in some situations 712 * (for instance, when manipulating objects that are all known to have 713 * identifiers). If the object in question does not posess an 'id' attribute 714 * according to the SBML specification for the Level and Version in use, 715 * libSBML will not allow the identifier to be set, nor will it read or 716 * write 'id' attributes for those objects. 717 <p> 718 * @return <code>true</code> if the 'id' attribute of this SBML object is 719 * set, <code>false</code> otherwise. 720 <p> 721 * @see #getIdAttribute() 722 * @see #setIdAttribute(String sid) 723 * @see #unsetIdAttribute() 724 * @see #isSetIdAttribute() 725 */ public 726 boolean isSetId() { 727 return libsbmlJNI.Event_isSetId(swigCPtr, this); 728 } 729 730 731/** 732 * Predicate returning <code>true</code> if this 733 * {@link Event}'s 'name' attribute is set. 734 <p> 735 * <p> 736 * <p> 737 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 738 * moved to {@link SBase} directly, instead of being defined individually for many 739 * (but not all) objects. Libsbml has for a long time provided functions 740 * defined on {@link SBase} itself to get, set, and unset those attributes, which 741 * would fail or otherwise return empty strings if executed on any object 742 * for which those attributes were not defined. Now that all {@link SBase} objects 743 * define those attributes, those functions now succeed for any object with 744 * the appropriate level and version. 745 <p> 746 * The 'name' attribute is 747 * optional and is not intended to be used for cross-referencing purposes 748 * within a model. Its purpose instead is to provide a human-readable 749 * label for the component. The data type of 'name' is the type 750 * <code>string</code> defined in XML Schema. SBML imposes no 751 * restrictions as to the content of 'name' attributes beyond those 752 * restrictions defined by the <code>string</code> type in XML Schema. 753 <p> 754 * The recommended practice for handling 'name' is as follows. If a 755 * software tool has the capability for displaying the content of 'name' 756 * attributes, it should display this content to the user as a 757 * component's label instead of the component's 'id'. If the user 758 * interface does not have this capability (e.g., because it cannot 759 * display or use special characters in symbol names), or if the 'name' 760 * attribute is missing on a given component, then the user interface 761 * should display the value of the 'id' attribute instead. (Script 762 * language interpreters are especially likely to display 'id' instead of 763 * 'name'.) 764 <p> 765 * As a consequence of the above, authors of systems that automatically 766 * generate the values of 'id' attributes should be aware some systems 767 * may display the 'id''s to the user. Authors therefore may wish to 768 * take some care to have their software create 'id' values that are: (a) 769 * reasonably easy for humans to type and read; and (b) likely to be 770 * meaningful, for example by making the 'id' attribute be an abbreviated 771 * form of the name attribute value. 772 <p> 773 * An additional point worth mentioning is although there are 774 * restrictions on the uniqueness of 'id' values, there are no 775 * restrictions on the uniqueness of 'name' values in a model. This 776 * allows software applications leeway in assigning component identifiers. 777 <p> 778 * Regardless of the level and version of the SBML, these functions allow 779 * client applications to use more generalized code in some situations 780 * (for instance, when manipulating objects that are all known to have 781 * names). If the object in question does not posess a 'name' attribute 782 * according to the SBML specification for the Level and Version in use, 783 * libSBML will not allow the name to be set, nor will it read or 784 * write 'name' attributes for those objects. 785 <p> 786 * @return <code>true</code> if the 'name' attribute of this SBML object is 787 * set, <code>false</code> otherwise. 788 <p> 789 * @see #getName() 790 * @see #setName(String sid) 791 * @see #unsetName() 792 */ public 793 boolean isSetName() { 794 return libsbmlJNI.Event_isSetName(swigCPtr, this); 795 } 796 797 798/** 799 * Predicate for testing whether the trigger for this {@link Event} is set. 800 <p> 801 * @return <code>true</code> if the trigger of this {@link Event} is set, <code>false</code> 802 * otherwise. 803 */ public 804 boolean isSetTrigger() { 805 return libsbmlJNI.Event_isSetTrigger(swigCPtr, this); 806 } 807 808 809/** 810 * Predicate for testing whether the delay for this {@link Event} is set. 811 <p> 812 * @return <code>true</code> if the delay of this {@link Event} is set, <code>false</code> 813 * otherwise. 814 */ public 815 boolean isSetDelay() { 816 return libsbmlJNI.Event_isSetDelay(swigCPtr, this); 817 } 818 819 820/** 821 * (SBML Level 3 only) Predicate for testing whether the priority 822 * for this {@link Event} is set. 823 <p> 824 * @return <code>true</code> if the priority of this {@link Event} is set, <code>false</code> 825 * otherwise. 826 <p> 827 * @note The element 'priority' is available in SBML Level 3, 828 * but is not present in lower Levels of SBML. 829 */ public 830 boolean isSetPriority() { 831 return libsbmlJNI.Event_isSetPriority(swigCPtr, this); 832 } 833 834 835/** 836 * Predicate for testing whether the 'timeUnits' attribute of this {@link Event} 837 * is set. 838 <p> 839 * @return <code>true</code> if the 'timeUnits' attribute of this {@link Event} is 840 * set, <code>false</code> otherwise. 841 <p> 842 * <p> 843 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2 844 * Versions 1 and 2 included the additional attribute called 845 * 'timeUnits', but it was removed in SBML Level 2 Version 3. 846 * LibSBML supports this attribute for compatibility with previous versions 847 * of SBML Level 2, but its use is discouraged since models in 848 * Level 2 Versions 3 and 4 cannot contain it. If a 849 * Version 3 or 4 model sets the attribute, the 850 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 851 * an error.</span> 852 */ public 853 boolean isSetTimeUnits() { 854 return libsbmlJNI.Event_isSetTimeUnits(swigCPtr, this); 855 } 856 857 858/** 859 * Predicate for testing whether the 'useValuesFromTriggerTime' attribute of this {@link Event} 860 * is set. 861 <p> 862 * @return <code>true</code> if the 'useValuesFromTriggerTime' attribute of this {@link Event} is 863 * set, <code>false</code> otherwise. 864 <p> 865 * @note In SBML Level 2, this attribute is optional and has a default value of 866 * <code>true</code>, whereas in Level 3, this optional is mandatory and 867 * has no default value. 868 */ public 869 boolean isSetUseValuesFromTriggerTime() { 870 return libsbmlJNI.Event_isSetUseValuesFromTriggerTime(swigCPtr, this); 871 } 872 873 874/** 875 * Sets the value of the 'id' attribute of this {@link Event}. 876 <p> 877 * <p> 878 * The string <code>sid</code> is copied. 879 <p> 880 * <p> 881 * The identifier given by an object's 'id' attribute value 882 * is used to identify the object within the SBML model definition. 883 * Other objects can refer to the component using this identifier. The 884 * data type of 'id' is always <code>SId</code> or a type derived 885 * from that, such as <code>UnitSId</code>, depending on the object in 886 * question. All data types are defined as follows: 887 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 888 * letter .= 'a'..'z','A'..'Z' 889 * digit .= '0'..'9' 890 * idChar .= letter | digit | '_' 891 * SId .= ( letter | '_' ) idChar* 892 * </pre> 893 <p> 894 * The characters <code>(</code> and <code>)</code> are used for grouping, the 895 * character <code>*</code> 'zero or more times', and the character 896 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 897 * determined by an exact character sequence match; i.e., comparisons must be 898 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 899 * <code>SIdRef</code>, and derived types. 900 <p> 901 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 902 * moved to {@link SBase} directly, instead of being defined individually for many 903 * (but not all) objects. Libsbml has for a long time provided functions 904 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 905 * would fail or otherwise return empty strings if executed on any object 906 * for which those attributes were not defined. Now that all {@link SBase} objects 907 * define those attributes, those functions now succeed for any object with 908 * the appropriate level and version. 909 <p> 910 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 911 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 912 * functions (though not the setId() or unsetId() functions) would instead 913 * reference the value of the 'variable' attribute (for the rules and event 914 * assignments) or the 'symbol' attribute (for initial assignments). 915 * The {@link AlgebraicRule} fell into this category as well, though because it 916 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 917 * always return an empty string, and isSetId() would always return <code>false.</code> 918 * For this reason, four new functions are now provided 919 * (getIdAttribute(), setIdAttribute(String), 920 * isSetIdAttribute(), and unsetIdAttribute()) that will always 921 * act on the actual 'id' attribute, regardless of the object's type. The 922 * new functions should be used instead of the old ones unless the old behavior 923 * is somehow necessary. 924 <p> 925 * Regardless of the level and version of the SBML, these functions allow 926 * client applications to use more generalized code in some situations 927 * (for instance, when manipulating objects that are all known to have 928 * identifiers). If the object in question does not posess an 'id' attribute 929 * according to the SBML specification for the Level and Version in use, 930 * libSBML will not allow the identifier to be set, nor will it read or 931 * write 'id' attributes for those objects. 932 <p> 933 * @param sid the string to use as the identifier of this object. 934 <p> 935 * <p> 936 * @return integer value indicating success/failure of the 937 * function. The possible values 938 * returned by this function are: 939 * <ul> 940 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 941 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 942 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 943 * 944 * </ul> <p> 945 * @see #getIdAttribute() 946 * @see #setIdAttribute(String sid) 947 * @see #isSetIdAttribute() 948 * @see #unsetIdAttribute() 949 */ public 950 int setId(String sid) { 951 return libsbmlJNI.Event_setId(swigCPtr, this, sid); 952 } 953 954 955/** 956 * Sets the value of the 'name' attribute of this {@link Event}. 957 <p> 958 * <p> 959 * The string in <code>name</code> is copied. 960 <p> 961 * @param name the new name for the SBML object. 962 <p> 963 * <p> 964 * @return integer value indicating success/failure of the 965 * function. The possible values 966 * returned by this function are: 967 * <ul> 968 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 969 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 970 * 971 * </ul> 972 */ public 973 int setName(String name) { 974 return libsbmlJNI.Event_setName(swigCPtr, this, name); 975 } 976 977 978/** 979 * Sets the trigger definition of this {@link Event} to a copy of the given 980 * {@link Trigger} object instance. 981 <p> 982 * @param trigger the {@link Trigger} object instance to use. 983 <p> 984 * <p> 985 * @return integer value indicating success/failure of the 986 * function. The possible values 987 * returned by this function are: 988 * <ul> 989 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 990 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 991 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 992 * </ul> 993 */ public 994 int setTrigger(Trigger trigger) { 995 return libsbmlJNI.Event_setTrigger(swigCPtr, this, Trigger.getCPtr(trigger), trigger); 996 } 997 998 999/** 1000 * Sets the delay definition of this {@link Event} to a copy of the given {@link Delay} 1001 * object instance. 1002 <p> 1003 * @param delay the {@link Delay} object instance to use. 1004 <p> 1005 * <p> 1006 * @return integer value indicating success/failure of the 1007 * function. The possible values 1008 * returned by this function are: 1009 * <ul> 1010 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1011 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 1012 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 1013 * </ul> 1014 */ public 1015 int setDelay(Delay delay) { 1016 return libsbmlJNI.Event_setDelay(swigCPtr, this, Delay.getCPtr(delay), delay); 1017 } 1018 1019 1020/** 1021 * (SBML Level 3 only) Sets the priority definition of this {@link Event} 1022 * to a copy of the given {@link Priority} object instance. 1023 <p> 1024 * @param priority the {@link Priority} object instance to use. 1025 <p> 1026 * <p> 1027 * @return integer value indicating success/failure of the 1028 * function. The possible values 1029 * returned by this function are: 1030 * <ul> 1031 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1032 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 1033 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 1034 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1035 * 1036 * </ul> <p> 1037 * @note The element 'priority' is available in SBML Level 3, 1038 * but is not present in lower Levels of SBML. 1039 */ public 1040 int setPriority(Priority priority) { 1041 return libsbmlJNI.Event_setPriority(swigCPtr, this, Priority.getCPtr(priority), priority); 1042 } 1043 1044 1045/** 1046 * Sets the 'timeUnits' attribute of this {@link Event} to a copy of <code>sid</code>. 1047 <p> 1048 * @param sid the identifier of the time units to use. 1049 <p> 1050 * <p> 1051 * @return integer value indicating success/failure of the 1052 * function. The possible values 1053 * returned by this function are: 1054 * <ul> 1055 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1056 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1057 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1058 * 1059 * </ul> <p> 1060 * <p> 1061 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2 1062 * Versions 1 and 2 included the additional attribute called 1063 * 'timeUnits', but it was removed in SBML Level 2 Version 3. 1064 * LibSBML supports this attribute for compatibility with previous versions 1065 * of SBML Level 2, but its use is discouraged since models in 1066 * Level 2 Versions 3 and 4 cannot contain it. If a 1067 * Version 3 or 4 model sets the attribute, the 1068 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 1069 * an error.</span> 1070 */ public 1071 int setTimeUnits(String sid) { 1072 return libsbmlJNI.Event_setTimeUnits(swigCPtr, this, sid); 1073 } 1074 1075 1076/** 1077 * Sets the 'useValuesFromTriggerTime' attribute of this {@link Event} to a <code>value</code>. 1078 <p> 1079 * <p> 1080 * The optional {@link Delay} on {@link Event} and the fact that multiple events may be 1081 * simultaneously executed means there are two times to consider when 1082 * computing the results of an event: the time at which the event is 1083 * <em>triggered</em>, and the time at which assignments are 1084 * <em>executed</em>. It is also possible to distinguish between the 1085 * time at which the {@link EventAssignment}'s expression is calculated, and the 1086 * time at which the assignment is made: the expression could be 1087 * evaluated at the same time the assignments are performed, i.e., when 1088 * the event is <em>executed</em>, but it could also be defined to be 1089 * evaluated at the time the event is <em>triggered</em>. 1090 <p> 1091 * In SBML Level 2 versions prior to Version 4, the semantics 1092 * of {@link Event} time delays were defined such that the expressions in the 1093 * event's assignments were always evaluated at the time the event was 1094 * <em>triggered</em>. This definition made it difficult to define an 1095 * event whose assignment formulas were meant to be evaluated at the time 1096 * the event was <em>executed</em> (i.e., after the time period defined 1097 * by the value of the {@link Delay} element, or after any other simultaneous 1098 * event may have been <em>executed</em> and changed the model state). 1099 * In SBML Level 2 1100 * Version 4, the attribute 'useValuesFromTriggerTime' on {@link Event} 1101 * allows a model to indicate the time at which the event's assignments 1102 * are intended to be evaluated. In SBML Level 2, the attribute has 1103 * a default value of <code>true</code>, which corresponds to the interpretation of 1104 * event assignments prior to Version 4: the values of the 1105 * assignment formulas are computed at the moment the event is triggered, 1106 * not after the delay. If 'useValuesFromTriggerTime'=<code>false</code>, it means 1107 * that the formulas in the event's assignments are to be computed after 1108 * the delay, at the time the event is executed. In SBML Level 3, 1109 * the attribute is mandatory, not optional, and all events must specify 1110 * a value for it. 1111 <p> 1112 * @param value the value of useValuesFromTriggerTime to use. 1113 <p> 1114 * <p> 1115 * @return integer value indicating success/failure of the 1116 * function. The possible values 1117 * returned by this function are: 1118 * <ul> 1119 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1120 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1121 * 1122 * </ul> <p> 1123 * <p> 1124 * @warning <span class='warning'>The attribute 'useValuesFromTriggerTime' 1125 * was introduced in SBML Level 2 Version 4. It is not valid in 1126 * models defined using SBML Level 2 versions prior to Version 4. 1127 * If a Level 2 Version 1–3 model sets the attribute, the 1128 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 1129 * an error.</span> 1130 */ public 1131 int setUseValuesFromTriggerTime(boolean value) { 1132 return libsbmlJNI.Event_setUseValuesFromTriggerTime(swigCPtr, this, value); 1133 } 1134 1135 1136/** 1137 * Unsets the value of the 'id' attribute of this {@link Event}. 1138 <p> 1139 * <p> 1140 * <p> 1141 * The identifier given by an object's 'id' attribute value 1142 * is used to identify the object within the SBML model definition. 1143 * Other objects can refer to the component using this identifier. The 1144 * data type of 'id' is always <code>SId</code> or a type derived 1145 * from that, such as <code>UnitSId</code>, depending on the object in 1146 * question. All data types are defined as follows: 1147 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 1148 * letter .= 'a'..'z','A'..'Z' 1149 * digit .= '0'..'9' 1150 * idChar .= letter | digit | '_' 1151 * SId .= ( letter | '_' ) idChar* 1152 * </pre> 1153 <p> 1154 * The characters <code>(</code> and <code>)</code> are used for grouping, the 1155 * character <code>*</code> 'zero or more times', and the character 1156 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 1157 * determined by an exact character sequence match; i.e., comparisons must be 1158 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 1159 * <code>SIdRef</code>, and derived types. 1160 <p> 1161 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 1162 * moved to {@link SBase} directly, instead of being defined individually for many 1163 * (but not all) objects. Libsbml has for a long time provided functions 1164 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 1165 * would fail or otherwise return empty strings if executed on any object 1166 * for which those attributes were not defined. Now that all {@link SBase} objects 1167 * define those attributes, those functions now succeed for any object with 1168 * the appropriate level and version. 1169 <p> 1170 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 1171 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 1172 * functions (though not the setId() or unsetId() functions) would instead 1173 * reference the value of the 'variable' attribute (for the rules and event 1174 * assignments) or the 'symbol' attribute (for initial assignments). 1175 * The {@link AlgebraicRule} fell into this category as well, though because it 1176 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 1177 * always return an empty string, and isSetId() would always return <code>false.</code> 1178 * For this reason, four new functions are now provided 1179 * (getIdAttribute(), setIdAttribute(String), 1180 * isSetIdAttribute(), and unsetIdAttribute()) that will always 1181 * act on the actual 'id' attribute, regardless of the object's type. The 1182 * new functions should be used instead of the old ones unless the old behavior 1183 * is somehow necessary. 1184 <p> 1185 * Regardless of the level and version of the SBML, these functions allow 1186 * client applications to use more generalized code in some situations 1187 * (for instance, when manipulating objects that are all known to have 1188 * identifiers). If the object in question does not posess an 'id' attribute 1189 * according to the SBML specification for the Level and Version in use, 1190 * libSBML will not allow the identifier to be set, nor will it read or 1191 * write 'id' attributes for those objects. 1192 <p> 1193 * <p> 1194 * @return integer value indicating success/failure of the 1195 * function. The possible values 1196 * returned by this function are: 1197 * <ul> 1198 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1199 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1200 * 1201 * </ul> <p> 1202 * @see #getIdAttribute() 1203 * @see #setIdAttribute(String sid) 1204 * @see #isSetIdAttribute() 1205 * @see #unsetIdAttribute() 1206 */ public 1207 int unsetId() { 1208 return libsbmlJNI.Event_unsetId(swigCPtr, this); 1209 } 1210 1211 1212/** 1213 * Unsets the value of the 'name' attribute of this {@link Event}. 1214 <p> 1215 * <p> 1216 * <p> 1217 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 1218 * moved to {@link SBase} directly, instead of being defined individually for many 1219 * (but not all) objects. Libsbml has for a long time provided functions 1220 * defined on {@link SBase} itself to get, set, and unset those attributes, which 1221 * would fail or otherwise return empty strings if executed on any object 1222 * for which those attributes were not defined. Now that all {@link SBase} objects 1223 * define those attributes, those functions now succeed for any object with 1224 * the appropriate level and version. 1225 <p> 1226 * The 'name' attribute is 1227 * optional and is not intended to be used for cross-referencing purposes 1228 * within a model. Its purpose instead is to provide a human-readable 1229 * label for the component. The data type of 'name' is the type 1230 * <code>string</code> defined in XML Schema. SBML imposes no 1231 * restrictions as to the content of 'name' attributes beyond those 1232 * restrictions defined by the <code>string</code> type in XML Schema. 1233 <p> 1234 * The recommended practice for handling 'name' is as follows. If a 1235 * software tool has the capability for displaying the content of 'name' 1236 * attributes, it should display this content to the user as a 1237 * component's label instead of the component's 'id'. If the user 1238 * interface does not have this capability (e.g., because it cannot 1239 * display or use special characters in symbol names), or if the 'name' 1240 * attribute is missing on a given component, then the user interface 1241 * should display the value of the 'id' attribute instead. (Script 1242 * language interpreters are especially likely to display 'id' instead of 1243 * 'name'.) 1244 <p> 1245 * As a consequence of the above, authors of systems that automatically 1246 * generate the values of 'id' attributes should be aware some systems 1247 * may display the 'id''s to the user. Authors therefore may wish to 1248 * take some care to have their software create 'id' values that are: (a) 1249 * reasonably easy for humans to type and read; and (b) likely to be 1250 * meaningful, for example by making the 'id' attribute be an abbreviated 1251 * form of the name attribute value. 1252 <p> 1253 * An additional point worth mentioning is although there are 1254 * restrictions on the uniqueness of 'id' values, there are no 1255 * restrictions on the uniqueness of 'name' values in a model. This 1256 * allows software applications leeway in assigning component identifiers. 1257 <p> 1258 * Regardless of the level and version of the SBML, these functions allow 1259 * client applications to use more generalized code in some situations 1260 * (for instance, when manipulating objects that are all known to have 1261 * names). If the object in question does not posess a 'name' attribute 1262 * according to the SBML specification for the Level and Version in use, 1263 * libSBML will not allow the name to be set, nor will it read or 1264 * write 'name' attributes for those objects. 1265 <p> 1266 * <p> 1267 * @return integer value indicating success/failure of the 1268 * function. The possible values 1269 * returned by this function are: 1270 * <ul> 1271 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1272 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1273 * 1274 * </ul> <p> 1275 * @see #getName() 1276 * @see #setName(String sid) 1277 * @see #isSetName() 1278 */ public 1279 int unsetName() { 1280 return libsbmlJNI.Event_unsetName(swigCPtr, this); 1281 } 1282 1283 1284/** 1285 * Unsets the value of the 'useValuesFromTriggerTime' attribute of this {@link Event}. 1286 <p> 1287 * <p> 1288 * The optional {@link Delay} on {@link Event} and the fact that multiple events may be 1289 * simultaneously executed means there are two times to consider when 1290 * computing the results of an event: the time at which the event is 1291 * <em>triggered</em>, and the time at which assignments are 1292 * <em>executed</em>. It is also possible to distinguish between the 1293 * time at which the {@link EventAssignment}'s expression is calculated, and the 1294 * time at which the assignment is made: the expression could be 1295 * evaluated at the same time the assignments are performed, i.e., when 1296 * the event is <em>executed</em>, but it could also be defined to be 1297 * evaluated at the time the event is <em>triggered</em>. 1298 <p> 1299 * In SBML Level 2 versions prior to Version 4, the semantics 1300 * of {@link Event} time delays were defined such that the expressions in the 1301 * event's assignments were always evaluated at the time the event was 1302 * <em>triggered</em>. This definition made it difficult to define an 1303 * event whose assignment formulas were meant to be evaluated at the time 1304 * the event was <em>executed</em> (i.e., after the time period defined 1305 * by the value of the {@link Delay} element, or after any other simultaneous 1306 * event may have been <em>executed</em> and changed the model state). 1307 * In SBML Level 2 1308 * Version 4, the attribute 'useValuesFromTriggerTime' on {@link Event} 1309 * allows a model to indicate the time at which the event's assignments 1310 * are intended to be evaluated. In SBML Level 2, the attribute has 1311 * a default value of <code>true</code>, which corresponds to the interpretation of 1312 * event assignments prior to Version 4: the values of the 1313 * assignment formulas are computed at the moment the event is triggered, 1314 * not after the delay. If 'useValuesFromTriggerTime'=<code>false</code>, it means 1315 * that the formulas in the event's assignments are to be computed after 1316 * the delay, at the time the event is executed. In SBML Level 3, 1317 * the attribute is mandatory, not optional, and all events must specify 1318 * a value for it. 1319 <p> 1320 * <p> 1321 * @return integer value indicating success/failure of the 1322 * function. The possible values 1323 * returned by this function are: 1324 * <ul> 1325 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1326 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1327 * 1328 * </ul> <p> 1329 * <p> 1330 * @warning <span class='warning'>The attribute 'useValuesFromTriggerTime' 1331 * was introduced in SBML Level 2 Version 4. It is not valid in 1332 * models defined using SBML Level 2 versions prior to Version 4. 1333 * If a Level 2 Version 1–3 model sets the attribute, the 1334 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 1335 * an error.</span> 1336 */ public 1337 int unsetUseValuesFromTriggerTime() { 1338 return libsbmlJNI.Event_unsetUseValuesFromTriggerTime(swigCPtr, this); 1339 } 1340 1341 1342/** 1343 * Unsets the {@link Delay} of this {@link Event}. 1344 <p> 1345 * <p> 1346 * @return integer value indicating success/failure of the 1347 * function. The possible values 1348 * returned by this function are: 1349 * <ul> 1350 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1351 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1352 * </ul> 1353 */ public 1354 int unsetDelay() { 1355 return libsbmlJNI.Event_unsetDelay(swigCPtr, this); 1356 } 1357 1358 1359/** 1360 * (SBML Level 3 only) Unsets the {@link Priority} of this {@link Event}. 1361 <p> 1362 * <p> 1363 * @return integer value indicating success/failure of the 1364 * function. The possible values 1365 * returned by this function are: 1366 * <ul> 1367 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1368 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1369 * 1370 * </ul> <p> 1371 * @note The element 'priority' is available in SBML Level 3, 1372 * but is not present in lower Levels of SBML. 1373 */ public 1374 int unsetPriority() { 1375 return libsbmlJNI.Event_unsetPriority(swigCPtr, this); 1376 } 1377 1378 1379/** 1380 * Unsets the {@link Trigger} of this {@link Event}. 1381 <p> 1382 * <p> 1383 * @return integer value indicating success/failure of the 1384 * function. The possible values 1385 * returned by this function are: 1386 * <ul> 1387 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1388 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1389 * 1390 * </ul> <p> 1391 * @note The element 'priority' is available in SBML Level 3, 1392 * but is not present in lower Levels of SBML. 1393 */ public 1394 int unsetTrigger() { 1395 return libsbmlJNI.Event_unsetTrigger(swigCPtr, this); 1396 } 1397 1398 1399/** 1400 * Unsets the 'timeUnits' attribute of this {@link Event}. 1401 <p> 1402 * <p> 1403 * @return integer value indicating success/failure of the 1404 * function. The possible values 1405 * returned by this function are: 1406 * <ul> 1407 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1408 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1409 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1410 * 1411 * </ul> <p> 1412 * <p> 1413 * @warning <span class='warning'>Definitions of {@link Event} in SBML Level 2 1414 * Versions 1 and 2 included the additional attribute called 1415 * 'timeUnits', but it was removed in SBML Level 2 Version 3. 1416 * LibSBML supports this attribute for compatibility with previous versions 1417 * of SBML Level 2, but its use is discouraged since models in 1418 * Level 2 Versions 3 and 4 cannot contain it. If a 1419 * Version 3 or 4 model sets the attribute, the 1420 * consistency-checking method {@link SBMLDocument#checkConsistency()} will report 1421 * an error.</span> 1422 */ public 1423 int unsetTimeUnits() { 1424 return libsbmlJNI.Event_unsetTimeUnits(swigCPtr, this); 1425 } 1426 1427 1428/** 1429 * Appends a copy of the given {@link EventAssignment} to this {@link Event}. 1430 <p> 1431 * @param ea the {@link EventAssignment} object to add. 1432 <p> 1433 * <p> 1434 * @return integer value indicating success/failure of the 1435 * function. The possible values 1436 * returned by this function are: 1437 * <ul> 1438 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1439 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 1440 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 1441 * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID} 1442 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1443 * 1444 * </ul> <p> 1445 * <p> 1446 * @note This method should be used with some caution. The fact that this 1447 * method <em>copies</em> the object passed to it means that the caller will be 1448 * left holding a physically different object instance than the one contained 1449 * inside this object. Changes made to the original object instance (such as 1450 * resetting attribute values) will <em>not affect the instance in this 1451 * object</em>. In addition, the caller should make sure to free the 1452 * original object if it is no longer being used, or else a memory leak will 1453 * result. Please see other methods on this class (particularly a 1454 * corresponding method whose name begins with the word <code>create</code>) 1455 * for alternatives that do not lead to these issues. 1456 <p> 1457 * @see #createEventAssignment() 1458 */ public 1459 int addEventAssignment(EventAssignment ea) { 1460 return libsbmlJNI.Event_addEventAssignment(swigCPtr, this, EventAssignment.getCPtr(ea), ea); 1461 } 1462 1463 1464/** 1465 * Creates a new, empty {@link EventAssignment}, adds it to this {@link Event}'s list of 1466 * event assignments and returns the {@link EventAssignment}. 1467 <p> 1468 * @return the newly created {@link EventAssignment} object instance. 1469 <p> 1470 * @see #addEventAssignment(EventAssignment ea) 1471 */ public 1472 EventAssignment createEventAssignment() { 1473 long cPtr = libsbmlJNI.Event_createEventAssignment(swigCPtr, this); 1474 return (cPtr == 0) ? null : new EventAssignment(cPtr, false); 1475 } 1476 1477 1478/** 1479 * Creates a new, empty {@link Trigger}, adds it to this {@link Event} and 1480 * returns the {@link Trigger}. 1481 <p> 1482 * @return the newly created {@link Trigger} object instance. 1483 */ public 1484 Trigger createTrigger() { 1485 long cPtr = libsbmlJNI.Event_createTrigger(swigCPtr, this); 1486 return (cPtr == 0) ? null : new Trigger(cPtr, false); 1487 } 1488 1489 1490/** 1491 * Creates a new, empty {@link Delay}, adds it to this {@link Event} and 1492 * returns the {@link Delay}. 1493 <p> 1494 * @return the newly created {@link Delay} object instance. 1495 */ public 1496 Delay createDelay() { 1497 long cPtr = libsbmlJNI.Event_createDelay(swigCPtr, this); 1498 return (cPtr == 0) ? null : new Delay(cPtr, false); 1499 } 1500 1501 1502/** 1503 * (SBML Level 3 only) Creates a new, empty {@link Priority}, adds it to this 1504 * {@link Event} and returns the {@link Priority}. 1505 <p> 1506 * @return the newly created {@link Priority} object instance, or null if the SBML 1507 * level and version used for this {@link Event} does not define {@link Priority} children. 1508 <p> 1509 * @note The element 'priority' is available in SBML Level 3, 1510 * but is not present in lower Levels of SBML. 1511 */ public 1512 Priority createPriority() { 1513 long cPtr = libsbmlJNI.Event_createPriority(swigCPtr, this); 1514 return (cPtr == 0) ? null : new Priority(cPtr, false); 1515 } 1516 1517 1518/** 1519 * Returns the list of event assignments for this {@link Event}. 1520 <p> 1521 * @return the list of EventAssignments for this {@link Event}. 1522 */ public 1523 ListOfEventAssignments getListOfEventAssignments() { 1524 long cPtr = libsbmlJNI.Event_getListOfEventAssignments__SWIG_0(swigCPtr, this); 1525 return (cPtr == 0) ? null : new ListOfEventAssignments(cPtr, false); 1526 } 1527 1528 1529/** 1530 * Return a specific {@link EventAssignment} object of this {@link Event}. 1531 <p> 1532 * @param n an integer, the index of the {@link EventAssignment} object to return. 1533 <p> 1534 * @return the <code>n</code>th {@link EventAssignment} of this {@link Event}. 1535 */ public 1536 EventAssignment getEventAssignment(long n) { 1537 long cPtr = libsbmlJNI.Event_getEventAssignment__SWIG_0(swigCPtr, this, n); 1538 return (cPtr == 0) ? null : new EventAssignment(cPtr, false); 1539 } 1540 1541 1542/** 1543 * Return the event assignment indicated by the given <code>variable</code>. 1544 <p> 1545 * @param variable a string, the identifier of the variable whose 1546 * {@link EventAssignment} is being sought. 1547 <p> 1548 * @return the {@link EventAssignment} for the given <code>variable</code>, or <code>null</code> if 1549 * no such {@link EventAssignment} exits. 1550 */ public 1551 EventAssignment getEventAssignment(String variable) { 1552 long cPtr = libsbmlJNI.Event_getEventAssignment__SWIG_2(swigCPtr, this, variable); 1553 return (cPtr == 0) ? null : new EventAssignment(cPtr, false); 1554 } 1555 1556 1557/** 1558 * Returns the number of {@link EventAssignment} objects attached to this 1559 * {@link Event}. 1560 <p> 1561 * @return the number of EventAssignments in this {@link Event}. 1562 */ public 1563 long getNumEventAssignments() { 1564 return libsbmlJNI.Event_getNumEventAssignments(swigCPtr, this); 1565 } 1566 1567 1568/** 1569 * Removes the nth {@link EventAssignment} object from this {@link Event} object and 1570 * returns a pointer to it. 1571 <p> 1572 * The caller owns the returned object and is responsible for deleting it. 1573 <p> 1574 * @param n the index of the {@link EventAssignment} object to remove. 1575 <p> 1576 * @return the {@link EventAssignment} object removed. As mentioned above, 1577 * the caller owns the returned item. <code>null</code> is returned if the given index 1578 * is out of range. 1579 */ public 1580 EventAssignment removeEventAssignment(long n) { 1581 long cPtr = libsbmlJNI.Event_removeEventAssignment__SWIG_0(swigCPtr, this, n); 1582 return (cPtr == 0) ? null : new EventAssignment(cPtr, true); 1583 } 1584 1585 1586/** 1587 * Removes the {@link EventAssignment} object with the given 'variable' attribute 1588 * from this {@link Event} object and returns a pointer to it. 1589 <p> 1590 * The caller owns the returned object and is responsible for deleting it. 1591 * If none of the {@link EventAssignment} objects in this {@link Event} object have the 1592 * 'variable' attribute <code>variable</code>, then <code>null</code> is returned. 1593 <p> 1594 * @param variable the 'variable' attribute of the {@link EventAssignment} object 1595 * to remove. 1596 <p> 1597 * @return the {@link EventAssignment} object removed. As mentioned above, the 1598 * caller owns the returned object. <code>null</code> is returned if no {@link EventAssignment} 1599 * object with the 'variable' attribute exists in this {@link Event} object. 1600 */ public 1601 EventAssignment removeEventAssignment(String variable) { 1602 long cPtr = libsbmlJNI.Event_removeEventAssignment__SWIG_1(swigCPtr, this, variable); 1603 return (cPtr == 0) ? null : new EventAssignment(cPtr, true); 1604 } 1605 1606 public void connectToChild() { 1607 libsbmlJNI.Event_connectToChild(swigCPtr, this); 1608 } 1609 1610 1611/** * @internal */ public 1612 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 1613 libsbmlJNI.Event_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 1614 } 1615 1616 1617/** 1618 * Returns the libSBML type code of this object instance. 1619 <p> 1620 * <p> 1621 * LibSBML attaches an identifying code to every kind of SBML object. These 1622 * are integer constants known as <em>SBML type codes</em>. The names of all 1623 * the codes begin with the characters <code>SBML_</code>. 1624 * In the Java language interface for libSBML, the 1625 * type codes are defined as static integer constants in the interface class 1626 * {@link libsbmlConstants}. Note that different Level 3 1627 * package plug-ins may use overlapping type codes; to identify the package 1628 * to which a given object belongs, call the <code>getPackageName()</code> 1629 * method on the object. 1630 <p> 1631 * @return the SBML type code for this object: 1632 * {@link libsbmlConstants#SBML_EVENT SBML_EVENT} (default). 1633 <p> 1634 * <p> 1635 * @warning <span class='warning'>The specific integer values of the possible 1636 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 1637 * packages, To fully identify the correct code, <strong>it is necessary to 1638 * invoke both getTypeCode() and getPackageName()</strong>.</span> 1639 <p> 1640 * @see #getElementName() 1641 * @see #getPackageName() 1642 */ public 1643 int getTypeCode() { 1644 return libsbmlJNI.Event_getTypeCode(swigCPtr, this); 1645 } 1646 1647 1648/** 1649 * Returns the XML element name of this object, which for {@link Event}, is 1650 * always <code>'event'.</code> 1651 <p> 1652 * @return the name of this element, i.e., <code>'event'.</code> 1653 */ public 1654 String getElementName() { 1655 return libsbmlJNI.Event_getElementName(swigCPtr, this); 1656 } 1657 1658 1659/** 1660 * Predicate returning <code>true</code> if all the required attributes for this 1661 * {@link Event} object have been set. 1662 <p> 1663 * The required attributes for an {@link Event} object are: 1664 * <ul> 1665 * <li> 'useValuesfromTriggerTime' (required in SBML Level 3) 1666 * 1667 * </ul> <p> 1668 * @return <code>true</code> if the required attributes have been set, <code>false</code> 1669 * otherwise. 1670 */ public 1671 boolean hasRequiredAttributes() { 1672 return libsbmlJNI.Event_hasRequiredAttributes(swigCPtr, this); 1673 } 1674 1675 1676/** 1677 * Predicate returning <code>true</code> if all the required elements for this {@link Event} 1678 * object have been set. 1679 <p> 1680 * @note The required elements for an {@link Event} object are: 1681 * <ul> 1682 * <li> 'trigger' (required in SBML Level 2 and Level 3 Version 1, 1683 * optional in SBML Level 3 Version 2+ 1684 * <li> 'listOfEventAssignments' (required in SBML Level 2, optional in Level 3) 1685 * </ul> 1686 */ public 1687 boolean hasRequiredElements() { 1688 return libsbmlJNI.Event_hasRequiredElements(swigCPtr, this); 1689 } 1690 1691}