001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.12 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * <span class="pkg-marker pkg-color-qual"><a href="group__qual.html">qual</a></span> 013 014 A transition of a {@link QualitativeSpecies}. 015 <p> 016 * A {@link Transition} element contains at most one {@link ListOfInputs} and one 017 * {@link ListOfOutputs} and exactly one {@link ListOfFunctionTerms}. 018 <p> 019 * A {@link Transition} defines the changes in level associated with the 020 * {@link QualitativeSpecies} that occur when a {@link Transition} is enabled. 021 <p> 022 * In logical models, a {@link Transition} is used to specify the logical rule 023 * associated with a {@link QualitativeSpecies} (that appears as an {@link Output} of this 024 * {@link Transition}). For example, the rule 'if A > 1 : B = 2' would be 025 * encapsulated as a {@link Transition} with {@link QualitativeSpecies} 'A' as an {@link Input} and 026 * 'B' as an {@link Output}; the 'if A > 1' rule being encode by the math element of 027 * a {@link FunctionTerm} with the resultLevel attribute having a value '2'. 028 <p> 029 * In Petri net models, a {@link Transition} is interpreted, using the common Petri 030 * net semantics, as events that might occur within the system causing tokens 031 * to be moved. 032 */ 033 034public class Transition extends SBase { 035 private long swigCPtr; 036 037 protected Transition(long cPtr, boolean cMemoryOwn) 038 { 039 super(libsbmlJNI.Transition_SWIGUpcast(cPtr), cMemoryOwn); 040 swigCPtr = cPtr; 041 } 042 043 protected static long getCPtr(Transition obj) 044 { 045 return (obj == null) ? 0 : obj.swigCPtr; 046 } 047 048 protected static long getCPtrAndDisown (Transition obj) 049 { 050 long ptr = 0; 051 052 if (obj != null) 053 { 054 ptr = obj.swigCPtr; 055 obj.swigCMemOwn = false; 056 } 057 058 return ptr; 059 } 060 061 protected void finalize() { 062 delete(); 063 } 064 065 public synchronized void delete() { 066 if (swigCPtr != 0) { 067 if (swigCMemOwn) { 068 swigCMemOwn = false; 069 libsbmlJNI.delete_Transition(swigCPtr); 070 } 071 swigCPtr = 0; 072 } 073 super.delete(); 074 } 075 076 077/** 078 * Creates a new {@link Transition} with the given level, version, and package version. 079 <p> 080 * @param level a long integer, the SBML Level to assign to this {@link Transition}. 081 <p> 082 * @param version a long integer, the SBML Version to assign to this {@link Transition}. 083 <p> 084 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Transition}. 085 <p> 086 * <p> 087 * @note Attempting to add an object to an {@link SBMLDocument} having a different 088 * combination of SBML Level, Version and XML namespaces than the object 089 * itself will result in an error at the time a caller attempts to make the 090 * addition. A parent object must have compatible Level, Version and XML 091 * namespaces. (Strictly speaking, a parent may also have more XML 092 * namespaces than a child, but the reverse is not permitted.) The 093 * restriction is necessary to ensure that an SBML model has a consistent 094 * overall structure. This requires callers to manage their objects 095 * carefully, but the benefit is increased flexibility in how models can be 096 * created by permitting callers to create objects bottom-up if desired. In 097 * situations where objects are not yet attached to parents (e.g., 098 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 099 * libSBML determine such things as whether it is valid to assign a 100 * particular value to an attribute. For packages, this means that the 101 * parent object to which this package element is being added must have 102 * been created with the package namespace, or that the package namespace 103 * was added to it, even if that parent is not a package object itself. 104 */ public 105 Transition(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 106 this(libsbmlJNI.new_Transition__SWIG_0(level, version, pkgVersion), true); 107 } 108 109 110/** 111 * Creates a new {@link Transition} with the given level, version, and package version. 112 <p> 113 * @param level a long integer, the SBML Level to assign to this {@link Transition}. 114 <p> 115 * @param version a long integer, the SBML Version to assign to this {@link Transition}. 116 <p> 117 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Transition}. 118 <p> 119 * <p> 120 * @note Attempting to add an object to an {@link SBMLDocument} having a different 121 * combination of SBML Level, Version and XML namespaces than the object 122 * itself will result in an error at the time a caller attempts to make the 123 * addition. A parent object must have compatible Level, Version and XML 124 * namespaces. (Strictly speaking, a parent may also have more XML 125 * namespaces than a child, but the reverse is not permitted.) The 126 * restriction is necessary to ensure that an SBML model has a consistent 127 * overall structure. This requires callers to manage their objects 128 * carefully, but the benefit is increased flexibility in how models can be 129 * created by permitting callers to create objects bottom-up if desired. In 130 * situations where objects are not yet attached to parents (e.g., 131 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 132 * libSBML determine such things as whether it is valid to assign a 133 * particular value to an attribute. For packages, this means that the 134 * parent object to which this package element is being added must have 135 * been created with the package namespace, or that the package namespace 136 * was added to it, even if that parent is not a package object itself. 137 */ public 138 Transition(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 139 this(libsbmlJNI.new_Transition__SWIG_1(level, version), true); 140 } 141 142 143/** 144 * Creates a new {@link Transition} with the given level, version, and package version. 145 <p> 146 * @param level a long integer, the SBML Level to assign to this {@link Transition}. 147 <p> 148 * @param version a long integer, the SBML Version to assign to this {@link Transition}. 149 <p> 150 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Transition}. 151 <p> 152 * <p> 153 * @note Attempting to add an object to an {@link SBMLDocument} having a different 154 * combination of SBML Level, Version and XML namespaces than the object 155 * itself will result in an error at the time a caller attempts to make the 156 * addition. A parent object must have compatible Level, Version and XML 157 * namespaces. (Strictly speaking, a parent may also have more XML 158 * namespaces than a child, but the reverse is not permitted.) The 159 * restriction is necessary to ensure that an SBML model has a consistent 160 * overall structure. This requires callers to manage their objects 161 * carefully, but the benefit is increased flexibility in how models can be 162 * created by permitting callers to create objects bottom-up if desired. In 163 * situations where objects are not yet attached to parents (e.g., 164 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 165 * libSBML determine such things as whether it is valid to assign a 166 * particular value to an attribute. For packages, this means that the 167 * parent object to which this package element is being added must have 168 * been created with the package namespace, or that the package namespace 169 * was added to it, even if that parent is not a package object itself. 170 */ public 171 Transition(long level) throws org.sbml.libsbml.SBMLConstructorException { 172 this(libsbmlJNI.new_Transition__SWIG_2(level), true); 173 } 174 175 176/** 177 * Creates a new {@link Transition} with the given level, version, and package version. 178 <p> 179 * @param level a long integer, the SBML Level to assign to this {@link Transition}. 180 <p> 181 * @param version a long integer, the SBML Version to assign to this {@link Transition}. 182 <p> 183 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Transition}. 184 <p> 185 * <p> 186 * @note Attempting to add an object to an {@link SBMLDocument} having a different 187 * combination of SBML Level, Version and XML namespaces than the object 188 * itself will result in an error at the time a caller attempts to make the 189 * addition. A parent object must have compatible Level, Version and XML 190 * namespaces. (Strictly speaking, a parent may also have more XML 191 * namespaces than a child, but the reverse is not permitted.) The 192 * restriction is necessary to ensure that an SBML model has a consistent 193 * overall structure. This requires callers to manage their objects 194 * carefully, but the benefit is increased flexibility in how models can be 195 * created by permitting callers to create objects bottom-up if desired. In 196 * situations where objects are not yet attached to parents (e.g., 197 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 198 * libSBML determine such things as whether it is valid to assign a 199 * particular value to an attribute. For packages, this means that the 200 * parent object to which this package element is being added must have 201 * been created with the package namespace, or that the package namespace 202 * was added to it, even if that parent is not a package object itself. 203 */ public 204 Transition() throws org.sbml.libsbml.SBMLConstructorException { 205 this(libsbmlJNI.new_Transition__SWIG_3(), true); 206 } 207 208 209/** 210 * Creates a new {@link Transition} with the given {@link QualPkgNamespaces} object. 211 <p> 212 * <p> 213 * The package namespaces object used in this constructor is derived from a 214 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces 215 * information. It is used to communicate the SBML Level, Version, and 216 * package version and name information used in addition to SBML Level 3 Core. A 217 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 218 * package namespace object somewhere in a program once, then hand that object 219 * as needed to object constructors of that package that accept it as and 220 * argument, such as this one. 221 <p> 222 * @param qualns the {@link QualPkgNamespaces} object. 223 <p> 224 * <p> 225 * @note Attempting to add an object to an {@link SBMLDocument} having a different 226 * combination of SBML Level, Version and XML namespaces than the object 227 * itself will result in an error at the time a caller attempts to make the 228 * addition. A parent object must have compatible Level, Version and XML 229 * namespaces. (Strictly speaking, a parent may also have more XML 230 * namespaces than a child, but the reverse is not permitted.) The 231 * restriction is necessary to ensure that an SBML model has a consistent 232 * overall structure. This requires callers to manage their objects 233 * carefully, but the benefit is increased flexibility in how models can be 234 * created by permitting callers to create objects bottom-up if desired. In 235 * situations where objects are not yet attached to parents (e.g., 236 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 237 * libSBML determine such things as whether it is valid to assign a 238 * particular value to an attribute. For packages, this means that the 239 * parent object to which this package element is being added must have 240 * been created with the package namespace, or that the package namespace 241 * was added to it, even if that parent is not a package object itself. 242 */ public 243 Transition(QualPkgNamespaces qualns) throws org.sbml.libsbml.SBMLConstructorException { 244 this(libsbmlJNI.new_Transition__SWIG_4(QualPkgNamespaces.getCPtr(qualns), qualns), true); 245 } 246 247 248/** 249 * Copy constructor for {@link Transition}. 250 <p> 251 * @param orig the {@link Transition} instance to copy. 252 */ public 253 Transition(Transition orig) throws org.sbml.libsbml.SBMLConstructorException { 254 this(libsbmlJNI.new_Transition__SWIG_5(Transition.getCPtr(orig), orig), true); 255 } 256 257 258/** 259 * Creates and returns a deep copy of this {@link Transition} object. 260 <p> 261 * @return a (deep) copy of this {@link Transition} object. 262 */ public 263 Transition cloneObject() { 264 long cPtr = libsbmlJNI.Transition_cloneObject(swigCPtr, this); 265 return (cPtr == 0) ? null : new Transition(cPtr, true); 266 } 267 268 269/** 270 * Returns the first child element found that has the given <code>id</code> 271 * in the model-wide SId namespace, or <code>null</code> if no such object is found. 272 <p> 273 * @param id string representing the id of the object to find. 274 <p> 275 * @return a pointer to the {@link SBase} element with the given <code>id</code>. 276 */ public 277 SBase getElementBySId(String id) { 278 return libsbml.DowncastSBase(libsbmlJNI.Transition_getElementBySId(swigCPtr, this, id), false); 279} 280 281 282/** 283 * Returns the first child element it can find with the given <code>metaid</code>, 284 * or itself if it has the given <code>metaid</code>, or <code>null</code> if no such object 285 * is found. 286 <p> 287 * @param metaid string representing the metaid of the object to find. 288 <p> 289 * @return a pointer to the {@link SBase} element with the given <code>metaid</code>. 290 */ public 291 SBase getElementByMetaId(String metaid) { 292 return libsbml.DowncastSBase(libsbmlJNI.Transition_getElementByMetaId(swigCPtr, this, metaid), false); 293} 294 295 296/** 297 * Returns the value of the 'id' attribute of this {@link Transition}. 298 <p> 299 * @note Because of the inconsistent behavior of this function with 300 * respect to assignments and rules, it is now recommended to 301 * use the getIdAttribute() function instead. 302 <p> 303 * <p> 304 * The identifier given by an object's 'id' attribute value 305 * is used to identify the object within the SBML model definition. 306 * Other objects can refer to the component using this identifier. The 307 * data type of 'id' is always <code>SId</code> or a type derived 308 * from that, such as <code>UnitSId</code>, depending on the object in 309 * question. All data types are defined as follows: 310 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 311 * letter .= 'a'..'z','A'..'Z' 312 * digit .= '0'..'9' 313 * idChar .= letter | digit | '_' 314 * SId .= ( letter | '_' ) idChar* 315 * </pre> 316 <p> 317 * The characters <code>(</code> and <code>)</code> are used for grouping, the 318 * character <code>*</code> 'zero or more times', and the character 319 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 320 * determined by an exact character sequence match; i.e., comparisons must be 321 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 322 * <code>SIdRef</code>, and derived types. 323 <p> 324 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 325 * moved to {@link SBase} directly, instead of being defined individually for many 326 * (but not all) objects. Libsbml has for a long time provided functions 327 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 328 * would fail or otherwise return empty strings if executed on any object 329 * for which those attributes were not defined. Now that all {@link SBase} objects 330 * define those attributes, those functions now succeed for any object with 331 * the appropriate level and version. 332 <p> 333 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 334 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 335 * functions (though not the setId() or unsetId() functions) would instead 336 * reference the value of the 'variable' attribute (for the rules and event 337 * assignments) or the 'symbol' attribute (for initial assignments). 338 * The {@link AlgebraicRule} fell into this category as well, though because it 339 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 340 * always return an empty string, and isSetId() would always return <code>false.</code> 341 * For this reason, four new functions are now provided 342 * (getIdAttribute(), setIdAttribute(String), 343 * isSetIdAttribute(), and unsetIdAttribute()) that will always 344 * act on the actual 'id' attribute, regardless of the object's type. The 345 * new functions should be used instead of the old ones unless the old behavior 346 * is somehow necessary. 347 <p> 348 * Regardless of the level and version of the SBML, these functions allow 349 * client applications to use more generalized code in some situations 350 * (for instance, when manipulating objects that are all known to have 351 * identifiers). If the object in question does not posess an 'id' attribute 352 * according to the SBML specification for the Level and Version in use, 353 * libSBML will not allow the identifier to be set, nor will it read or 354 * write 'id' attributes for those objects. 355 <p> 356 * @return the id of this {@link Transition}. 357 <p> 358 * @see #getIdAttribute() 359 * @see #setIdAttribute(String sid) 360 * @see #isSetIdAttribute() 361 * @see #unsetIdAttribute() 362 */ public 363 String getId() { 364 return libsbmlJNI.Transition_getId(swigCPtr, this); 365 } 366 367 368/** 369 * <p> 370 * <p> 371 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 372 * moved to {@link SBase} directly, instead of being defined individually for many 373 * (but not all) objects. Libsbml has for a long time provided functions 374 * defined on {@link SBase} itself to get, set, and unset those attributes, which 375 * would fail or otherwise return empty strings if executed on any object 376 * for which those attributes were not defined. Now that all {@link SBase} objects 377 * define those attributes, those functions now succeed for any object with 378 * the appropriate level and version. 379 <p> 380 * The 'name' attribute is 381 * optional and is not intended to be used for cross-referencing purposes 382 * within a model. Its purpose instead is to provide a human-readable 383 * label for the component. The data type of 'name' is the type 384 * <code>string</code> defined in XML Schema. SBML imposes no 385 * restrictions as to the content of 'name' attributes beyond those 386 * restrictions defined by the <code>string</code> type in XML Schema. 387 <p> 388 * The recommended practice for handling 'name' is as follows. If a 389 * software tool has the capability for displaying the content of 'name' 390 * attributes, it should display this content to the user as a 391 * component's label instead of the component's 'id'. If the user 392 * interface does not have this capability (e.g., because it cannot 393 * display or use special characters in symbol names), or if the 'name' 394 * attribute is missing on a given component, then the user interface 395 * should display the value of the 'id' attribute instead. (Script 396 * language interpreters are especially likely to display 'id' instead of 397 * 'name'.) 398 <p> 399 * As a consequence of the above, authors of systems that automatically 400 * generate the values of 'id' attributes should be aware some systems 401 * may display the 'id''s to the user. Authors therefore may wish to 402 * take some care to have their software create 'id' values that are: (a) 403 * reasonably easy for humans to type and read; and (b) likely to be 404 * meaningful, for example by making the 'id' attribute be an abbreviated 405 * form of the name attribute value. 406 <p> 407 * An additional point worth mentioning is although there are 408 * restrictions on the uniqueness of 'id' values, there are no 409 * restrictions on the uniqueness of 'name' values in a model. This 410 * allows software applications leeway in assigning component identifiers. 411 <p> 412 * Regardless of the level and version of the SBML, these functions allow 413 * client applications to use more generalized code in some situations 414 * (for instance, when manipulating objects that are all known to have 415 * names). If the object in question does not posess a 'name' attribute 416 * according to the SBML specification for the Level and Version in use, 417 * libSBML will not allow the name to be set, nor will it read or 418 * write 'name' attributes for those objects. 419 <p> 420 * @return the name of this SBML object, or the empty string if not set or unsettable. 421 <p> 422 * @see #getIdAttribute() 423 * @see #isSetName() 424 * @see #setName(String sid) 425 * @see #unsetName() 426 */ public 427 String getName() { 428 return libsbmlJNI.Transition_getName(swigCPtr, this); 429 } 430 431 432/** 433 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 434 * {@link Transition}'s 'id' attribute has been set. 435 <p> 436 * <p> 437 * @note Because of the inconsistent behavior of this function with 438 * respect to assignments and rules, it is now recommended to 439 * use the isSetIdAttribute() function instead. 440 <p> 441 * <p> 442 * The identifier given by an object's 'id' attribute value 443 * is used to identify the object within the SBML model definition. 444 * Other objects can refer to the component using this identifier. The 445 * data type of 'id' is always <code>SId</code> or a type derived 446 * from that, such as <code>UnitSId</code>, depending on the object in 447 * question. All data types are defined as follows: 448 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 449 * letter .= 'a'..'z','A'..'Z' 450 * digit .= '0'..'9' 451 * idChar .= letter | digit | '_' 452 * SId .= ( letter | '_' ) idChar* 453 * </pre> 454 <p> 455 * The characters <code>(</code> and <code>)</code> are used for grouping, the 456 * character <code>*</code> 'zero or more times', and the character 457 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 458 * determined by an exact character sequence match; i.e., comparisons must be 459 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 460 * <code>SIdRef</code>, and derived types. 461 <p> 462 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 463 * moved to {@link SBase} directly, instead of being defined individually for many 464 * (but not all) objects. Libsbml has for a long time provided functions 465 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 466 * would fail or otherwise return empty strings if executed on any object 467 * for which those attributes were not defined. Now that all {@link SBase} objects 468 * define those attributes, those functions now succeed for any object with 469 * the appropriate level and version. 470 <p> 471 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 472 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 473 * functions (though not the setId() or unsetId() functions) would instead 474 * reference the value of the 'variable' attribute (for the rules and event 475 * assignments) or the 'symbol' attribute (for initial assignments). 476 * The {@link AlgebraicRule} fell into this category as well, though because it 477 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 478 * always return an empty string, and isSetId() would always return <code>false.</code> 479 * For this reason, four new functions are now provided 480 * (getIdAttribute(), setIdAttribute(String), 481 * isSetIdAttribute(), and unsetIdAttribute()) that will always 482 * act on the actual 'id' attribute, regardless of the object's type. The 483 * new functions should be used instead of the old ones unless the old behavior 484 * is somehow necessary. 485 <p> 486 * Regardless of the level and version of the SBML, these functions allow 487 * client applications to use more generalized code in some situations 488 * (for instance, when manipulating objects that are all known to have 489 * identifiers). If the object in question does not posess an 'id' attribute 490 * according to the SBML specification for the Level and Version in use, 491 * libSBML will not allow the identifier to be set, nor will it read or 492 * write 'id' attributes for those objects. 493 <p> 494 * @return <code>true</code> if the 'id' attribute of this SBML object is 495 * set, <code>false</code> otherwise. 496 <p> 497 * @see #getIdAttribute() 498 * @see #setIdAttribute(String sid) 499 * @see #unsetIdAttribute() 500 * @see #isSetIdAttribute() 501 */ public 502 boolean isSetId() { 503 return libsbmlJNI.Transition_isSetId(swigCPtr, this); 504 } 505 506 507/** 508 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 509 * {@link Transition}'s 'name' attribute has been set. 510 <p> 511 * <p> 512 * <p> 513 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 514 * moved to {@link SBase} directly, instead of being defined individually for many 515 * (but not all) objects. Libsbml has for a long time provided functions 516 * defined on {@link SBase} itself to get, set, and unset those attributes, which 517 * would fail or otherwise return empty strings if executed on any object 518 * for which those attributes were not defined. Now that all {@link SBase} objects 519 * define those attributes, those functions now succeed for any object with 520 * the appropriate level and version. 521 <p> 522 * The 'name' attribute is 523 * optional and is not intended to be used for cross-referencing purposes 524 * within a model. Its purpose instead is to provide a human-readable 525 * label for the component. The data type of 'name' is the type 526 * <code>string</code> defined in XML Schema. SBML imposes no 527 * restrictions as to the content of 'name' attributes beyond those 528 * restrictions defined by the <code>string</code> type in XML Schema. 529 <p> 530 * The recommended practice for handling 'name' is as follows. If a 531 * software tool has the capability for displaying the content of 'name' 532 * attributes, it should display this content to the user as a 533 * component's label instead of the component's 'id'. If the user 534 * interface does not have this capability (e.g., because it cannot 535 * display or use special characters in symbol names), or if the 'name' 536 * attribute is missing on a given component, then the user interface 537 * should display the value of the 'id' attribute instead. (Script 538 * language interpreters are especially likely to display 'id' instead of 539 * 'name'.) 540 <p> 541 * As a consequence of the above, authors of systems that automatically 542 * generate the values of 'id' attributes should be aware some systems 543 * may display the 'id''s to the user. Authors therefore may wish to 544 * take some care to have their software create 'id' values that are: (a) 545 * reasonably easy for humans to type and read; and (b) likely to be 546 * meaningful, for example by making the 'id' attribute be an abbreviated 547 * form of the name attribute value. 548 <p> 549 * An additional point worth mentioning is although there are 550 * restrictions on the uniqueness of 'id' values, there are no 551 * restrictions on the uniqueness of 'name' values in a model. This 552 * allows software applications leeway in assigning component identifiers. 553 <p> 554 * Regardless of the level and version of the SBML, these functions allow 555 * client applications to use more generalized code in some situations 556 * (for instance, when manipulating objects that are all known to have 557 * names). If the object in question does not posess a 'name' attribute 558 * according to the SBML specification for the Level and Version in use, 559 * libSBML will not allow the name to be set, nor will it read or 560 * write 'name' attributes for those objects. 561 <p> 562 * @return <code>true</code> if the 'name' attribute of this SBML object is 563 * set, <code>false</code> otherwise. 564 <p> 565 * @see #getName() 566 * @see #setName(String sid) 567 * @see #unsetName() 568 */ public 569 boolean isSetName() { 570 return libsbmlJNI.Transition_isSetName(swigCPtr, this); 571 } 572 573 574/** 575 * Sets the value of the 'id' attribute of this {@link Transition}. 576 <p> 577 * <p> 578 * The string <code>sid</code> is copied. 579 <p> 580 * <p> 581 * The identifier given by an object's 'id' attribute value 582 * is used to identify the object within the SBML model definition. 583 * Other objects can refer to the component using this identifier. The 584 * data type of 'id' is always <code>SId</code> or a type derived 585 * from that, such as <code>UnitSId</code>, depending on the object in 586 * question. All data types are defined as follows: 587 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 588 * letter .= 'a'..'z','A'..'Z' 589 * digit .= '0'..'9' 590 * idChar .= letter | digit | '_' 591 * SId .= ( letter | '_' ) idChar* 592 * </pre> 593 <p> 594 * The characters <code>(</code> and <code>)</code> are used for grouping, the 595 * character <code>*</code> 'zero or more times', and the character 596 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 597 * determined by an exact character sequence match; i.e., comparisons must be 598 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 599 * <code>SIdRef</code>, and derived types. 600 <p> 601 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 602 * moved to {@link SBase} directly, instead of being defined individually for many 603 * (but not all) objects. Libsbml has for a long time provided functions 604 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 605 * would fail or otherwise return empty strings if executed on any object 606 * for which those attributes were not defined. Now that all {@link SBase} objects 607 * define those attributes, those functions now succeed for any object with 608 * the appropriate level and version. 609 <p> 610 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 611 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 612 * functions (though not the setId() or unsetId() functions) would instead 613 * reference the value of the 'variable' attribute (for the rules and event 614 * assignments) or the 'symbol' attribute (for initial assignments). 615 * The {@link AlgebraicRule} fell into this category as well, though because it 616 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 617 * always return an empty string, and isSetId() would always return <code>false.</code> 618 * For this reason, four new functions are now provided 619 * (getIdAttribute(), setIdAttribute(String), 620 * isSetIdAttribute(), and unsetIdAttribute()) that will always 621 * act on the actual 'id' attribute, regardless of the object's type. The 622 * new functions should be used instead of the old ones unless the old behavior 623 * is somehow necessary. 624 <p> 625 * Regardless of the level and version of the SBML, these functions allow 626 * client applications to use more generalized code in some situations 627 * (for instance, when manipulating objects that are all known to have 628 * identifiers). If the object in question does not posess an 'id' attribute 629 * according to the SBML specification for the Level and Version in use, 630 * libSBML will not allow the identifier to be set, nor will it read or 631 * write 'id' attributes for those objects. 632 <p> 633 * @param sid the string to use as the identifier of this object. 634 <p> 635 * <p> 636 * @return integer value indicating success/failure of the 637 * function. The possible values 638 * returned by this function are: 639 * <ul> 640 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 641 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 642 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 643 * 644 * </ul> <p> 645 * @see #getIdAttribute() 646 * @see #setIdAttribute(String sid) 647 * @see #isSetIdAttribute() 648 * @see #unsetIdAttribute() 649 */ public 650 int setId(String sid) { 651 return libsbmlJNI.Transition_setId(swigCPtr, this, sid); 652 } 653 654 655/** 656 * Sets the value of the 'name' attribute of this {@link Transition}. 657 <p> 658 * <p> 659 * The string in <code>name</code> is copied. 660 <p> 661 * @param name the new name for the SBML object. 662 <p> 663 * <p> 664 * @return integer value indicating success/failure of the 665 * function. The possible values 666 * returned by this function are: 667 * <ul> 668 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 669 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 670 * 671 * </ul> 672 */ public 673 int setName(String name) { 674 return libsbmlJNI.Transition_setName(swigCPtr, this, name); 675 } 676 677 678/** 679 * Unsets the value of the 'id' attribute of this {@link Transition}. 680 <p> 681 * <p> 682 * <p> 683 * The identifier given by an object's 'id' attribute value 684 * is used to identify the object within the SBML model definition. 685 * Other objects can refer to the component using this identifier. The 686 * data type of 'id' is always <code>SId</code> or a type derived 687 * from that, such as <code>UnitSId</code>, depending on the object in 688 * question. All data types are defined as follows: 689 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 690 * letter .= 'a'..'z','A'..'Z' 691 * digit .= '0'..'9' 692 * idChar .= letter | digit | '_' 693 * SId .= ( letter | '_' ) idChar* 694 * </pre> 695 <p> 696 * The characters <code>(</code> and <code>)</code> are used for grouping, the 697 * character <code>*</code> 'zero or more times', and the character 698 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 699 * determined by an exact character sequence match; i.e., comparisons must be 700 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 701 * <code>SIdRef</code>, and derived types. 702 <p> 703 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 704 * moved to {@link SBase} directly, instead of being defined individually for many 705 * (but not all) objects. Libsbml has for a long time provided functions 706 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 707 * would fail or otherwise return empty strings if executed on any object 708 * for which those attributes were not defined. Now that all {@link SBase} objects 709 * define those attributes, those functions now succeed for any object with 710 * the appropriate level and version. 711 <p> 712 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 713 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 714 * functions (though not the setId() or unsetId() functions) would instead 715 * reference the value of the 'variable' attribute (for the rules and event 716 * assignments) or the 'symbol' attribute (for initial assignments). 717 * The {@link AlgebraicRule} fell into this category as well, though because it 718 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 719 * always return an empty string, and isSetId() would always return <code>false.</code> 720 * For this reason, four new functions are now provided 721 * (getIdAttribute(), setIdAttribute(String), 722 * isSetIdAttribute(), and unsetIdAttribute()) that will always 723 * act on the actual 'id' attribute, regardless of the object's type. The 724 * new functions should be used instead of the old ones unless the old behavior 725 * is somehow necessary. 726 <p> 727 * Regardless of the level and version of the SBML, these functions allow 728 * client applications to use more generalized code in some situations 729 * (for instance, when manipulating objects that are all known to have 730 * identifiers). If the object in question does not posess an 'id' attribute 731 * according to the SBML specification for the Level and Version in use, 732 * libSBML will not allow the identifier to be set, nor will it read or 733 * write 'id' attributes for those objects. 734 <p> 735 * <p> 736 * @return integer value indicating success/failure of the 737 * function. The possible values 738 * returned by this function are: 739 * <ul> 740 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 741 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 742 * 743 * </ul> <p> 744 * @see #getIdAttribute() 745 * @see #setIdAttribute(String sid) 746 * @see #isSetIdAttribute() 747 * @see #unsetIdAttribute() 748 */ public 749 int unsetId() { 750 return libsbmlJNI.Transition_unsetId(swigCPtr, this); 751 } 752 753 754/** 755 * Unsets the value of the 'name' attribute of this {@link Transition}. 756 <p> 757 * <p> 758 * <p> 759 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 760 * moved to {@link SBase} directly, instead of being defined individually for many 761 * (but not all) objects. Libsbml has for a long time provided functions 762 * defined on {@link SBase} itself to get, set, and unset those attributes, which 763 * would fail or otherwise return empty strings if executed on any object 764 * for which those attributes were not defined. Now that all {@link SBase} objects 765 * define those attributes, those functions now succeed for any object with 766 * the appropriate level and version. 767 <p> 768 * The 'name' attribute is 769 * optional and is not intended to be used for cross-referencing purposes 770 * within a model. Its purpose instead is to provide a human-readable 771 * label for the component. The data type of 'name' is the type 772 * <code>string</code> defined in XML Schema. SBML imposes no 773 * restrictions as to the content of 'name' attributes beyond those 774 * restrictions defined by the <code>string</code> type in XML Schema. 775 <p> 776 * The recommended practice for handling 'name' is as follows. If a 777 * software tool has the capability for displaying the content of 'name' 778 * attributes, it should display this content to the user as a 779 * component's label instead of the component's 'id'. If the user 780 * interface does not have this capability (e.g., because it cannot 781 * display or use special characters in symbol names), or if the 'name' 782 * attribute is missing on a given component, then the user interface 783 * should display the value of the 'id' attribute instead. (Script 784 * language interpreters are especially likely to display 'id' instead of 785 * 'name'.) 786 <p> 787 * As a consequence of the above, authors of systems that automatically 788 * generate the values of 'id' attributes should be aware some systems 789 * may display the 'id''s to the user. Authors therefore may wish to 790 * take some care to have their software create 'id' values that are: (a) 791 * reasonably easy for humans to type and read; and (b) likely to be 792 * meaningful, for example by making the 'id' attribute be an abbreviated 793 * form of the name attribute value. 794 <p> 795 * An additional point worth mentioning is although there are 796 * restrictions on the uniqueness of 'id' values, there are no 797 * restrictions on the uniqueness of 'name' values in a model. This 798 * allows software applications leeway in assigning component identifiers. 799 <p> 800 * Regardless of the level and version of the SBML, these functions allow 801 * client applications to use more generalized code in some situations 802 * (for instance, when manipulating objects that are all known to have 803 * names). If the object in question does not posess a 'name' attribute 804 * according to the SBML specification for the Level and Version in use, 805 * libSBML will not allow the name to be set, nor will it read or 806 * write 'name' attributes for those objects. 807 <p> 808 * <p> 809 * @return integer value indicating success/failure of the 810 * function. The possible values 811 * returned by this function are: 812 * <ul> 813 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 814 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 815 * 816 * </ul> <p> 817 * @see #getName() 818 * @see #setName(String sid) 819 * @see #isSetName() 820 */ public 821 int unsetName() { 822 return libsbmlJNI.Transition_unsetName(swigCPtr, this); 823 } 824 825 826/** 827 * Returns the {@link ListOfInputs} in this {@link Transition} object. 828 <p> 829 * @return the {@link ListOfInputs} child of this {@link Transition}. 830 */ public 831 ListOfInputs getListOfInputs() { 832 long cPtr = libsbmlJNI.Transition_getListOfInputs__SWIG_0(swigCPtr, this); 833 return (cPtr == 0) ? null : new ListOfInputs(cPtr, false); 834 } 835 836 837/** 838 * Get a {@link Input} from the {@link ListOfInputs}. 839 <p> 840 * @param n the index number of the {@link Input} to get. 841 <p> 842 * @return the nth {@link Input} in the {@link ListOfInputs} within this {@link Transition}. 843 <p> 844 * @see #getNumInputs() 845 */ public 846 Input getInput(long n) { 847 long cPtr = libsbmlJNI.Transition_getInput__SWIG_0(swigCPtr, this, n); 848 return (cPtr == 0) ? null : new Input(cPtr, false); 849 } 850 851 852/** 853 * Get a {@link Input} from the {@link ListOfInputs} 854 * based on its identifier. 855 <p> 856 * @param sid a string representing the identifier 857 * of the {@link Input} to get. 858 <p> 859 * @return the {@link Input} in the {@link ListOfInputs} 860 * with the given id or <code>null</code> if no such 861 * {@link Input} exists. 862 <p> 863 * @see #getInput(long n) 864 * @see #getNumInputs() 865 */ public 866 Input getInput(String sid) { 867 long cPtr = libsbmlJNI.Transition_getInput__SWIG_2(swigCPtr, this, sid); 868 return (cPtr == 0) ? null : new Input(cPtr, false); 869 } 870 871 872/** 873 * Get a {@link Input} from the {@link ListOfInputs} 874 * based on its qualitativeSpecies attribute. 875 <p> 876 * @param sid a string representing the qualitativeSpecies 877 * of the {@link Input} to get. 878 <p> 879 * @return the first {@link Input} in the {@link ListOfInputs} 880 * with the given qualitativeSpecies or <code>null</code> if no such 881 * {@link Input} exists. 882 <p> 883 * 884 * @see #getNumInputs() 885 <p> 886 * @see #getInput(long n) 887 */ public 888 Input getInputBySpecies(String sid) { 889 long cPtr = libsbmlJNI.Transition_getInputBySpecies__SWIG_0(swigCPtr, this, sid); 890 return (cPtr == 0) ? null : new Input(cPtr, false); 891 } 892 893 894/** 895 * Adds a copy the given {@link Input} to this {@link Transition}. 896 <p> 897 * @param i the {@link Input} object to add. 898 <p> 899 * <p> 900 * @return integer value indicating success/failure of the 901 * function. The possible values 902 * returned by this function are: 903 * <ul> 904 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 905 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 906 * </ul> 907 */ public 908 int addInput(Input i) { 909 return libsbmlJNI.Transition_addInput(swigCPtr, this, Input.getCPtr(i), i); 910 } 911 912 913/** 914 * Get the number of {@link Input} objects in this {@link Transition}. 915 <p> 916 * @return the number of {@link Input} objects in this {@link Transition}. 917 */ public 918 long getNumInputs() { 919 return libsbmlJNI.Transition_getNumInputs(swigCPtr, this); 920 } 921 922 923/** 924 * Creates a new {@link Input} object, adds it to this {@link Transition}'s 925 * {@link ListOfInputs} and returns the {@link Input} object created. 926 <p> 927 * @return a new {@link Input} object instance. 928 <p> 929 * @see #addInput(Input i) 930 */ public 931 Input createInput() { 932 long cPtr = libsbmlJNI.Transition_createInput(swigCPtr, this); 933 return (cPtr == 0) ? null : new Input(cPtr, false); 934 } 935 936 937/** 938 * Removes the nth {@link Input} from the {@link ListOfInputs} within this {@link Transition}. 939 * and returns a pointer to it. 940 <p> 941 * The caller owns the returned item and is responsible for deleting it. 942 <p> 943 * @param n the index of the {@link Input} to remove. 944 <p> 945 * @see #getNumInputs() 946 */ public 947 Input removeInput(long n) { 948 long cPtr = libsbmlJNI.Transition_removeInput__SWIG_0(swigCPtr, this, n); 949 return (cPtr == 0) ? null : new Input(cPtr, true); 950 } 951 952 953/** 954 * Removes the {@link Input} with the given identifier from the {@link ListOfInputs} within this {@link Transition} 955 * and returns a pointer to it. 956 <p> 957 * The caller owns the returned item and is responsible for deleting it. 958 * If none of the items in this list have the identifier <code>sid</code>, then 959 * <code>null</code> is returned. 960 <p> 961 * @param sid the identifier of the {@link Input} to remove. 962 <p> 963 * @return the {@link Input} removed. As mentioned above, the caller owns the 964 * returned item. 965 */ public 966 Input removeInput(String sid) { 967 long cPtr = libsbmlJNI.Transition_removeInput__SWIG_1(swigCPtr, this, sid); 968 return (cPtr == 0) ? null : new Input(cPtr, true); 969 } 970 971 972/** 973 * Returns the {@link ListOfOutputs} in this {@link Transition} object. 974 <p> 975 * @return the {@link ListOfOutputs} child of this {@link Transition}. 976 */ public 977 ListOfOutputs getListOfOutputs() { 978 long cPtr = libsbmlJNI.Transition_getListOfOutputs__SWIG_0(swigCPtr, this); 979 return (cPtr == 0) ? null : new ListOfOutputs(cPtr, false); 980 } 981 982 983/** 984 * Get a {@link Output} from the {@link ListOfOutputs}. 985 <p> 986 * @param n the index number of the {@link Output} to get. 987 <p> 988 * @return the nth {@link Output} in the {@link ListOfOutputs} within this {@link Transition}. 989 <p> 990 * @see #getNumOutputs() 991 */ public 992 Output getOutput(long n) { 993 long cPtr = libsbmlJNI.Transition_getOutput__SWIG_0(swigCPtr, this, n); 994 return (cPtr == 0) ? null : new Output(cPtr, false); 995 } 996 997 998/** 999 * Get a {@link Output} from the {@link ListOfOutputs} 1000 * based on its identifier. 1001 <p> 1002 * @param sid a string representing the identifier 1003 * of the {@link Output} to get. 1004 <p> 1005 * @return the {@link Output} in the {@link ListOfOutputs} 1006 * with the given id or <code>null</code> if no such 1007 * {@link Output} exists. 1008 <p> 1009 * 1010 * @see #getNumOutputs() 1011 <p> 1012 * @see #getOutput(long n) 1013 */ public 1014 Output getOutput(String sid) { 1015 long cPtr = libsbmlJNI.Transition_getOutput__SWIG_2(swigCPtr, this, sid); 1016 return (cPtr == 0) ? null : new Output(cPtr, false); 1017 } 1018 1019 1020/** 1021 * Get a {@link Output} from the {@link ListOfOutputs} 1022 * based on its qualitativeSpecies attribute. 1023 <p> 1024 * @param sid a string representing the qualitativeSpecies 1025 * of the {@link Output} to get. 1026 <p> 1027 * @return the first {@link Output} in the {@link ListOfOutputs} 1028 * with the given qualitativeSpecies or <code>null</code> if no such 1029 * {@link Output} exists. 1030 <p> 1031 * 1032 * @see #getNumOutputs() 1033 <p> 1034 * @see #getOutput(long n) 1035 */ public 1036 Output getOutputBySpecies(String sid) { 1037 long cPtr = libsbmlJNI.Transition_getOutputBySpecies__SWIG_0(swigCPtr, this, sid); 1038 return (cPtr == 0) ? null : new Output(cPtr, false); 1039 } 1040 1041 1042/** 1043 * Adds a copy the given {@link Output} to this {@link Transition}. 1044 <p> 1045 * @param o the {@link Output} object to add. 1046 <p> 1047 * <p> 1048 * @return integer value indicating success/failure of the 1049 * function. The possible values 1050 * returned by this function are: 1051 * <ul> 1052 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1053 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1054 * </ul> 1055 */ public 1056 int addOutput(Output o) { 1057 return libsbmlJNI.Transition_addOutput(swigCPtr, this, Output.getCPtr(o), o); 1058 } 1059 1060 1061/** 1062 * Get the number of {@link Output} objects in this {@link Transition}. 1063 <p> 1064 * @return the number of {@link Output} objects in this {@link Transition}. 1065 */ public 1066 long getNumOutputs() { 1067 return libsbmlJNI.Transition_getNumOutputs(swigCPtr, this); 1068 } 1069 1070 1071/** 1072 * Creates a new {@link Output} object, adds it to this {@link Transition}'s 1073 * {@link ListOfOutputs} and returns the {@link Output} object created. 1074 <p> 1075 * @return a new {@link Output} object instance. 1076 <p> 1077 * @see #addOutput(Output o) 1078 */ public 1079 Output createOutput() { 1080 long cPtr = libsbmlJNI.Transition_createOutput(swigCPtr, this); 1081 return (cPtr == 0) ? null : new Output(cPtr, false); 1082 } 1083 1084 1085/** 1086 * Removes the nth {@link Output} from the {@link ListOfOutputs} within this {@link Transition}. 1087 * and returns a pointer to it. 1088 <p> 1089 * The caller owns the returned item and is responsible for deleting it. 1090 <p> 1091 * @param n the index of the {@link Output} to remove. 1092 <p> 1093 * @see #getNumOutputs() 1094 */ public 1095 Output removeOutput(long n) { 1096 long cPtr = libsbmlJNI.Transition_removeOutput__SWIG_0(swigCPtr, this, n); 1097 return (cPtr == 0) ? null : new Output(cPtr, true); 1098 } 1099 1100 1101/** 1102 * Removes the {@link Output} with the given identifier from the {@link ListOfOutputs} within this {@link Transition} 1103 * and returns a pointer to it. 1104 <p> 1105 * The caller owns the returned item and is responsible for deleting it. 1106 * If none of the items in this list have the identifier <code>sid</code>, then 1107 * <code>null</code> is returned. 1108 <p> 1109 * @param sid the identifier of the {@link Output} to remove. 1110 <p> 1111 * @return the {@link Output} removed. As mentioned above, the caller owns the 1112 * returned item. 1113 */ public 1114 Output removeOutput(String sid) { 1115 long cPtr = libsbmlJNI.Transition_removeOutput__SWIG_1(swigCPtr, this, sid); 1116 return (cPtr == 0) ? null : new Output(cPtr, true); 1117 } 1118 1119 1120/** 1121 * Returns the {@link ListOfFunctionTerms} in this {@link Transition} object. 1122 <p> 1123 * @return the {@link ListOfFunctionTerms} child of this {@link Transition}. 1124 */ public 1125 ListOfFunctionTerms getListOfFunctionTerms() { 1126 long cPtr = libsbmlJNI.Transition_getListOfFunctionTerms__SWIG_0(swigCPtr, this); 1127 return (cPtr == 0) ? null : new ListOfFunctionTerms(cPtr, false); 1128 } 1129 1130 1131/** 1132 * Get a {@link FunctionTerm} from the {@link ListOfFunctionTerms}. 1133 <p> 1134 * @param n the index number of the {@link FunctionTerm} to get. 1135 <p> 1136 * @return the nth {@link FunctionTerm} in the {@link ListOfFunctionTerms} within this {@link Transition}. 1137 <p> 1138 * @see #getNumFunctionTerms() 1139 */ public 1140 FunctionTerm getFunctionTerm(long n) { 1141 long cPtr = libsbmlJNI.Transition_getFunctionTerm__SWIG_0(swigCPtr, this, n); 1142 return (cPtr == 0) ? null : new FunctionTerm(cPtr, false); 1143 } 1144 1145 1146/** 1147 * Get a {@link FunctionTerm} from the {@link ListOfFunctionTerms} 1148 * based on its identifier. 1149 <p> 1150 * @param sid a string representing the identifier 1151 * of the {@link FunctionTerm} to get. 1152 <p> 1153 * @return the {@link FunctionTerm} in the {@link ListOfFunctionTerms} 1154 * with the given id or <code>null</code> if no such 1155 * {@link FunctionTerm} exists. 1156 <p> 1157 * 1158 * @see #getNumFunctionTerms() 1159 <p> 1160 * @see #getFunctionTerm(long n) 1161 */ public 1162 FunctionTerm getFunctionTerm(String sid) { 1163 long cPtr = libsbmlJNI.Transition_getFunctionTerm__SWIG_2(swigCPtr, this, sid); 1164 return (cPtr == 0) ? null : new FunctionTerm(cPtr, false); 1165 } 1166 1167 1168/** 1169 * Adds a copy the given {@link FunctionTerm} to this {@link Transition}. 1170 <p> 1171 * @param ft the {@link FunctionTerm} object to add. 1172 <p> 1173 * <p> 1174 * @return integer value indicating success/failure of the 1175 * function. The possible values 1176 * returned by this function are: 1177 * <ul> 1178 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1179 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1180 * </ul> 1181 */ public 1182 int addFunctionTerm(FunctionTerm ft) { 1183 return libsbmlJNI.Transition_addFunctionTerm(swigCPtr, this, FunctionTerm.getCPtr(ft), ft); 1184 } 1185 1186 1187/** 1188 * Get the number of {@link FunctionTerm} objects in this {@link Transition}. 1189 <p> 1190 * @return the number of {@link FunctionTerm} objects in this {@link Transition}. 1191 */ public 1192 long getNumFunctionTerms() { 1193 return libsbmlJNI.Transition_getNumFunctionTerms(swigCPtr, this); 1194 } 1195 1196 1197/** 1198 * Creates a new {@link FunctionTerm} object, adds it to this {@link Transition}'s 1199 * {@link ListOfFunctionTerms} and returns the {@link FunctionTerm} object created. 1200 <p> 1201 * @return a new {@link FunctionTerm} object instance. 1202 <p> 1203 * @see #addFunctionTerm(FunctionTerm ft) 1204 */ public 1205 FunctionTerm createFunctionTerm() { 1206 long cPtr = libsbmlJNI.Transition_createFunctionTerm(swigCPtr, this); 1207 return (cPtr == 0) ? null : new FunctionTerm(cPtr, false); 1208 } 1209 1210 1211/** 1212 * Removes the nth {@link FunctionTerm} from the {@link ListOfFunctionTerms} within this {@link Transition}. 1213 * and returns a pointer to it. 1214 <p> 1215 * The caller owns the returned item and is responsible for deleting it. 1216 <p> 1217 * @param n the index of the {@link FunctionTerm} to remove. 1218 <p> 1219 * @see #getNumFunctionTerms() 1220 */ public 1221 FunctionTerm removeFunctionTerm(long n) { 1222 long cPtr = libsbmlJNI.Transition_removeFunctionTerm__SWIG_0(swigCPtr, this, n); 1223 return (cPtr == 0) ? null : new FunctionTerm(cPtr, true); 1224 } 1225 1226 1227/** 1228 * Removes the {@link FunctionTerm} with the given identifier from the {@link ListOfFunctionTerms} within this {@link Transition} 1229 * and returns a pointer to it. 1230 <p> 1231 * The caller owns the returned item and is responsible for deleting it. 1232 * If none of the items in this list have the identifier <code>sid</code>, then 1233 * <code>null</code> is returned. 1234 <p> 1235 * @param sid the identifier of the {@link FunctionTerm} to remove. 1236 <p> 1237 * @return the {@link FunctionTerm} removed. As mentioned above, the caller owns the 1238 * returned item. 1239 */ public 1240 FunctionTerm removeFunctionTerm(String sid) { 1241 long cPtr = libsbmlJNI.Transition_removeFunctionTerm__SWIG_1(swigCPtr, this, sid); 1242 return (cPtr == 0) ? null : new FunctionTerm(cPtr, true); 1243 } 1244 1245 1246/** 1247 * Creates a new {@link DefaultTerm} object, adds it to this {@link Transition}'s 1248 * {@link ListOfFunctionTerms} and returns the {@link DefaultTerm} object created. 1249 <p> 1250 * @return a new {@link DefaultTerm} object instance. 1251 <p> 1252 * @see #setDefaultTerm(DefaultTerm ft) 1253 */ public 1254 DefaultTerm createDefaultTerm() { 1255 long cPtr = libsbmlJNI.Transition_createDefaultTerm(swigCPtr, this); 1256 return (cPtr == 0) ? null : new DefaultTerm(cPtr, false); 1257 } 1258 1259 1260/** 1261 * Sets the given {@link DefaultTerm} to this {@link Transition}. 1262 <p> 1263 * @param dt the {@link DefaultTerm} object to add. 1264 <p> 1265 * <p> 1266 * @return integer value indicating success/failure of the 1267 * function. The possible values 1268 * returned by this function are: 1269 * <ul> 1270 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1271 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1272 * </ul> 1273 */ public 1274 int setDefaultTerm(DefaultTerm dt) { 1275 return libsbmlJNI.Transition_setDefaultTerm(swigCPtr, this, DefaultTerm.getCPtr(dt), dt); 1276 } 1277 1278 1279/** 1280 * Predicate returning <code>true</code> if the defaultTerm 1281 * for this {@link Transition} object has been set. 1282 <p> 1283 * @return a boolean value indicating whether the defaultTerm 1284 * child for this object has been defined. 1285 */ public 1286 boolean isSetDefaultTerm() { 1287 return libsbmlJNI.Transition_isSetDefaultTerm(swigCPtr, this); 1288 } 1289 1290 1291/** 1292 * Get the {@link DefaultTerm} from the {@link ListOfFunctionTerms}. 1293 <p> 1294 * @return the {@link DefaultTerm} in the {@link ListOfFunctionTerms} within this {@link Transition}, or <code>null</code> if no such value is set. 1295 */ public 1296 DefaultTerm getDefaultTerm() { 1297 long cPtr = libsbmlJNI.Transition_getDefaultTerm__SWIG_0(swigCPtr, this); 1298 return (cPtr == 0) ? null : new DefaultTerm(cPtr, false); 1299 } 1300 1301 1302/** 1303 * Returns the XML name of this object. 1304 <p> 1305 * @return the name of this element. 1306 */ public 1307 String getElementName() { 1308 return libsbmlJNI.Transition_getElementName(swigCPtr, this); 1309 } 1310 1311 1312/** 1313 * Returns the libSBML type code of this object instance. 1314 <p> 1315 * <p> 1316 * LibSBML attaches an identifying code to every kind of SBML object. These 1317 * are integer constants known as <em>SBML type codes</em>. The names of all 1318 * the codes begin with the characters <code>SBML_</code>. 1319 * In the Java language interface for libSBML, the 1320 * type codes are defined as static integer constants in the interface class 1321 * {@link libsbmlConstants}. Note that different Level 3 1322 * package plug-ins may use overlapping type codes; to identify the package 1323 * to which a given object belongs, call the 1324 * <code>{@link SBase#getPackageName()} 1325 * </code> 1326 * method on the object. 1327 <p> 1328 * @return the SBML type code for this object: 1329 * {@link libsbmlConstants#SBML_QUAL_TRANSITION SBML_QUAL_TRANSITION}. 1330 <p> 1331 * <p> 1332 * @warning <span class='warning'>The specific integer values of the possible 1333 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 1334 * packages, To fully identify the correct code, <strong>it is necessary to 1335 * invoke both getTypeCode() and getPackageName()</strong>.</span> 1336 <p> 1337 * @see #getElementName() 1338 * @see #getPackageName() 1339 */ public 1340 int getTypeCode() { 1341 return libsbmlJNI.Transition_getTypeCode(swigCPtr, this); 1342 } 1343 1344 1345/** 1346 * Predicate returning <code>true</code> if all the required attributes 1347 * for this {@link Transition} object have been set. 1348 <p> 1349 * @note The required elements for a {@link Transition} object are: 1350 * <ul> 1351 * <li> a 'defaultTerm' child of the child {@link ListOfFunctionTerms}. 1352 * 1353 * </ul> <p> 1354 * @return a boolean value indicating whether all the required 1355 * elements for this object have been defined. 1356 */ public 1357 boolean hasRequiredElements() { 1358 return libsbmlJNI.Transition_hasRequiredElements(swigCPtr, this); 1359 } 1360 1361 1362/** * @internal */ public 1363 void connectToChild() { 1364 libsbmlJNI.Transition_connectToChild(swigCPtr, this); 1365 } 1366 1367 1368/** * @internal */ public 1369 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 1370 libsbmlJNI.Transition_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 1371 } 1372 1373 1374/** 1375 * Create and return an SBML object of this class, if present. 1376 <p> 1377 * @return the SBML object corresponding to next {@link XMLToken} in the 1378 * {@link XMLInputStream} or <code>null</code> if the token was not recognized. 1379 */ public 1380 SBase createObject(XMLInputStream stream) { 1381 return libsbml.DowncastSBase(libsbmlJNI.Transition_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false); 1382} 1383 1384 1385/** 1386 * Get the list of expected attributes for this element. 1387 */ public 1388 void addExpectedAttributes(SWIGTYPE_p_ExpectedAttributes attributes) { 1389 libsbmlJNI.Transition_addExpectedAttributes(swigCPtr, this, SWIGTYPE_p_ExpectedAttributes.getCPtr(attributes)); 1390 } 1391 1392 1393/** * @internal */ public 1394 void readAttributes(XMLAttributes attributes, SWIGTYPE_p_ExpectedAttributes expectedAttributes) { 1395 libsbmlJNI.Transition_readAttributes(swigCPtr, this, XMLAttributes.getCPtr(attributes), attributes, SWIGTYPE_p_ExpectedAttributes.getCPtr(expectedAttributes)); 1396 } 1397 1398 1399/** * @internal */ public 1400 void writeAttributes(XMLOutputStream stream) { 1401 libsbmlJNI.Transition_writeAttributes(swigCPtr, this, XMLOutputStream.getCPtr(stream), stream); 1402 } 1403 1404}