001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.0.12 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * <span class="pkg-marker pkg-color-qual"><a href="group__qual.html">qual</a></span> 013 014 The {@link Transition} class for the Qualitative Models package. 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 */ public 086 Transition(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 087 this(libsbmlJNI.new_Transition__SWIG_0(level, version, pkgVersion), true); 088 } 089 090 091/** 092 * Creates a new {@link Transition} with the given level, version, and package version. 093 <p> 094 * @param level a long integer, the SBML Level to assign to this {@link Transition} 095 <p> 096 * @param version a long integer, the SBML Version to assign to this {@link Transition} 097 <p> 098 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Transition} 099 */ public 100 Transition(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 101 this(libsbmlJNI.new_Transition__SWIG_1(level, version), true); 102 } 103 104 105/** 106 * Creates a new {@link Transition} with the given level, version, and package version. 107 <p> 108 * @param level a long integer, the SBML Level to assign to this {@link Transition} 109 <p> 110 * @param version a long integer, the SBML Version to assign to this {@link Transition} 111 <p> 112 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Transition} 113 */ public 114 Transition(long level) throws org.sbml.libsbml.SBMLConstructorException { 115 this(libsbmlJNI.new_Transition__SWIG_2(level), true); 116 } 117 118 119/** 120 * Creates a new {@link Transition} with the given level, version, and package version. 121 <p> 122 * @param level a long integer, the SBML Level to assign to this {@link Transition} 123 <p> 124 * @param version a long integer, the SBML Version to assign to this {@link Transition} 125 <p> 126 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Transition} 127 */ public 128 Transition() throws org.sbml.libsbml.SBMLConstructorException { 129 this(libsbmlJNI.new_Transition__SWIG_3(), true); 130 } 131 132 133/** 134 * Creates a new {@link Transition} with the given {@link QualPkgNamespaces} object. 135 <p> 136 * @param qualns the {@link QualPkgNamespaces} object 137 */ public 138 Transition(QualPkgNamespaces qualns) throws org.sbml.libsbml.SBMLConstructorException { 139 this(libsbmlJNI.new_Transition__SWIG_4(QualPkgNamespaces.getCPtr(qualns), qualns), true); 140 } 141 142 143/** 144 * Copy constructor for {@link Transition}. 145 <p> 146 * @param orig the {@link Transition} instance to copy. 147 */ public 148 Transition(Transition orig) throws org.sbml.libsbml.SBMLConstructorException { 149 this(libsbmlJNI.new_Transition__SWIG_5(Transition.getCPtr(orig), orig), true); 150 } 151 152 153/** 154 * Creates and returns a deep copy of this {@link Transition} object. 155 <p> 156 * @return a (deep) copy of this {@link Transition} object. 157 */ public 158 Transition cloneObject() { 159 long cPtr = libsbmlJNI.Transition_cloneObject(swigCPtr, this); 160 return (cPtr == 0) ? null : new Transition(cPtr, true); 161 } 162 163 164/** 165 * Returns the first child element found that has the given <code>id</code> 166 * in the model-wide SId namespace, or <code>null</code> if no such object is found. 167 <p> 168 * @param id string representing the id of objects to find 169 <p> 170 * @return a pointer to the {@link SBase} element with the given <code>id</code>. 171 */ public 172 SBase getElementBySId(String id) { 173 return libsbml.DowncastSBase(libsbmlJNI.Transition_getElementBySId(swigCPtr, this, id), false); 174} 175 176 177/** 178 * Returns the first child element it can find with the given <code>metaid</code>, 179 * or itself if it has the given <code>metaid</code>, or <code>null</code> if no such object 180 * is found. 181 <p> 182 * @param metaid string representing the metaid of objects to find 183 <p> 184 * @return a pointer to the {@link SBase} element with the given <code>metaid</code>. 185 */ public 186 SBase getElementByMetaId(String metaid) { 187 return libsbml.DowncastSBase(libsbmlJNI.Transition_getElementByMetaId(swigCPtr, this, metaid), false); 188} 189 190 191/** 192 * Returns the value of the 'id' attribute of this {@link Transition}. 193 <p> 194 * @return the value of the 'id' attribute of this {@link Transition} as a string. 195 */ public 196 String getId() { 197 return libsbmlJNI.Transition_getId(swigCPtr, this); 198 } 199 200 201/** 202 * Returns the value of the 'name' attribute of this {@link Transition}. 203 <p> 204 * @return the value of the 'name' attribute of this {@link Transition} as a string. 205 */ public 206 String getName() { 207 return libsbmlJNI.Transition_getName(swigCPtr, this); 208 } 209 210 211/** 212 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 213 * {@link Transition}'s 'id' attribute has been set. 214 <p> 215 * @return <code>true</code> if this {@link Transition}'s 'id' attribute has been set, 216 * otherwise <code>false</code> is returned. 217 */ public 218 boolean isSetId() { 219 return libsbmlJNI.Transition_isSetId(swigCPtr, this); 220 } 221 222 223/** 224 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 225 * {@link Transition}'s 'name' attribute has been set. 226 <p> 227 * @return <code>true</code> if this {@link Transition}'s 'name' attribute has been set, 228 * otherwise <code>false</code> is returned. 229 */ public 230 boolean isSetName() { 231 return libsbmlJNI.Transition_isSetName(swigCPtr, this); 232 } 233 234 235/** 236 * Sets the value of the 'id' attribute of this {@link Transition}. 237 <p> 238 * @param id String value of the 'id' attribute to be set 239 <p> 240 * @return integer value indicating success/failure of the 241 * operation. The possible return values are: 242 * <ul> 243 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 244 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 245 * </ul> 246 */ public 247 int setId(String id) { 248 return libsbmlJNI.Transition_setId(swigCPtr, this, id); 249 } 250 251 252/** 253 * Sets the value of the 'name' attribute of this {@link Transition}. 254 <p> 255 * @param name String value of the 'name' attribute to be set 256 <p> 257 * @return integer value indicating success/failure of the 258 * operation. The possible return values are: 259 * <ul> 260 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 261 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 262 * </ul> 263 */ public 264 int setName(String name) { 265 return libsbmlJNI.Transition_setName(swigCPtr, this, name); 266 } 267 268 269/** 270 * Unsets the value of the 'id' attribute of this {@link Transition}. 271 <p> 272 * @return integer value indicating success/failure of the 273 * operation. The possible return values are: 274 * <ul> 275 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 276 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 277 * </ul> 278 */ public 279 int unsetId() { 280 return libsbmlJNI.Transition_unsetId(swigCPtr, this); 281 } 282 283 284/** 285 * Unsets the value of the 'name' attribute of this {@link Transition}. 286 <p> 287 * @return integer value indicating success/failure of the 288 * operation. The possible return values are: 289 * <ul> 290 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 291 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 292 * </ul> 293 */ public 294 int unsetName() { 295 return libsbmlJNI.Transition_unsetName(swigCPtr, this); 296 } 297 298 299/** 300 * Returns the 'ListOfInputs' in this {@link Transition} object. 301 <p> 302 * @return the 'ListOfInputs' attribute of this {@link Transition}. 303 */ public 304 ListOfInputs getListOfInputs() { 305 long cPtr = libsbmlJNI.Transition_getListOfInputs__SWIG_0(swigCPtr, this); 306 return (cPtr == 0) ? null : new ListOfInputs(cPtr, false); 307 } 308 309 310/** 311 * Get a {@link Input} from the {@link ListOfInputs}. 312 <p> 313 * @param n the index number of the {@link Input} to get. 314 <p> 315 * @return the nth {@link Input} in the {@link ListOfInputs} within this {@link Transition}. 316 <p> 317 * @see #getNumInputs() 318 */ public 319 Input getInput(long n) { 320 long cPtr = libsbmlJNI.Transition_getInput__SWIG_0(swigCPtr, this, n); 321 return (cPtr == 0) ? null : new Input(cPtr, false); 322 } 323 324 325/** 326 * Get a {@link Input} from the {@link ListOfInputs} 327 * based on its identifier. 328 <p> 329 * @param sid a string representing the identifier 330 * of the {@link Input} to get. 331 <p> 332 * @return the {@link Input} in the {@link ListOfInputs} 333 * with the given id or null if no such 334 * {@link Input} exists. 335 <p> 336 * @see #getInput(long n) 337 * @see #getNumInputs() 338 */ public 339 Input getInput(String sid) { 340 long cPtr = libsbmlJNI.Transition_getInput__SWIG_2(swigCPtr, this, sid); 341 return (cPtr == 0) ? null : new Input(cPtr, false); 342 } 343 344 345/** 346 * Get a {@link Input} from the {@link ListOfInputs} 347 * based on its qualitativeSpecies attribute. 348 <p> 349 * @param sid a string representing the qualitativeSpecies 350 * of the {@link Input} to get. 351 <p> 352 * @return the first {@link Input} in the {@link ListOfInputs} 353 * with the given qualitativeSpecies or null if no such 354 * {@link Input} exists. 355 <p> 356 * @see #getInput(long n) 357 @see #getNumInputs() 358 */ public 359 Input getInputBySpecies(String sid) { 360 long cPtr = libsbmlJNI.Transition_getInputBySpecies__SWIG_0(swigCPtr, this, sid); 361 return (cPtr == 0) ? null : new Input(cPtr, false); 362 } 363 364 365/** 366 * Adds a copy the given 'Input' to this {@link Transition}. 367 <p> 368 * @param i the {@link Input} object to add 369 <p> 370 * @return integer value indicating success/failure of the 371 * operation. The possible return values are: 372 * <ul> 373 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 374 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 375 * </ul> 376 */ public 377 int addInput(Input i) { 378 return libsbmlJNI.Transition_addInput(swigCPtr, this, Input.getCPtr(i), i); 379 } 380 381 382/** 383 * Get the number of {@link Input} objects in this {@link Transition}. 384 <p> 385 * @return the number of {@link Input} objects in this {@link Transition} 386 */ public 387 long getNumInputs() { 388 return libsbmlJNI.Transition_getNumInputs(swigCPtr, this); 389 } 390 391 392/** 393 * Creates a new {@link Input} object, adds it to this Transitions 394 * {@link ListOfInputs} and returns the {@link Input} object created. 395 <p> 396 * @return a new {@link Input} object instance 397 <p> 398 * @see #addInput(Input i) 399 */ public 400 Input createInput() { 401 long cPtr = libsbmlJNI.Transition_createInput(swigCPtr, this); 402 return (cPtr == 0) ? null : new Input(cPtr, false); 403 } 404 405 406/** 407 * Removes the nth {@link Input} from the {@link ListOfInputs} within this {@link Transition}. 408 * and returns a pointer to it. 409 <p> 410 * The caller owns the returned item and is responsible for deleting it. 411 <p> 412 * @param n the index of the {@link Input} to remove. 413 <p> 414 * @see #getNumInputs() 415 */ public 416 Input removeInput(long n) { 417 long cPtr = libsbmlJNI.Transition_removeInput__SWIG_0(swigCPtr, this, n); 418 return (cPtr == 0) ? null : new Input(cPtr, true); 419 } 420 421 422/** 423 * Removes the {@link Input} with the given identifier from the {@link ListOfInputs} within this {@link Transition} 424 * and returns a pointer to it. 425 <p> 426 * The caller owns the returned item and is responsible for deleting it. 427 * If none of the items in this list have the identifier <code>sid</code>, then 428 * <code>null</code> is returned. 429 <p> 430 * @param sid the identifier of the {@link Input} to remove. 431 <p> 432 * @return the {@link Input} removed. As mentioned above, the caller owns the 433 * returned item. 434 */ public 435 Input removeInput(String sid) { 436 long cPtr = libsbmlJNI.Transition_removeInput__SWIG_1(swigCPtr, this, sid); 437 return (cPtr == 0) ? null : new Input(cPtr, true); 438 } 439 440 441/** 442 * Returns the 'ListOfOutputs' in this {@link Transition} object. 443 <p> 444 * @return the 'ListOfOutputs' attribute of this {@link Transition}. 445 */ public 446 ListOfOutputs getListOfOutputs() { 447 long cPtr = libsbmlJNI.Transition_getListOfOutputs__SWIG_0(swigCPtr, this); 448 return (cPtr == 0) ? null : new ListOfOutputs(cPtr, false); 449 } 450 451 452/** 453 * Get a {@link Output} from the {@link ListOfOutputs}. 454 <p> 455 * @param n the index number of the {@link Output} to get. 456 <p> 457 * @return the nth {@link Output} in the {@link ListOfOutputs} within this {@link Transition}. 458 <p> 459 * @see #getNumOutputs() 460 */ public 461 Output getOutput(long n) { 462 long cPtr = libsbmlJNI.Transition_getOutput__SWIG_0(swigCPtr, this, n); 463 return (cPtr == 0) ? null : new Output(cPtr, false); 464 } 465 466 467/** 468 * Get a {@link Output} from the {@link ListOfOutputs} 469 * based on its identifier. 470 <p> 471 * @param sid a string representing the identifier 472 * of the {@link Output} to get. 473 <p> 474 * @return the {@link Output} in the {@link ListOfOutputs} 475 * with the given id or null if no such 476 * {@link Output} exists. 477 <p> 478 * @see #getOutput(long n) 479 @see #getNumOutputs() 480 */ public 481 Output getOutput(String sid) { 482 long cPtr = libsbmlJNI.Transition_getOutput__SWIG_2(swigCPtr, this, sid); 483 return (cPtr == 0) ? null : new Output(cPtr, false); 484 } 485 486 487/** 488 * Get a {@link Output} from the {@link ListOfOutputs} 489 * based on its qualitativeSpecies attribute. 490 <p> 491 * @param sid a string representing the qualitativeSpecies 492 * of the {@link Output} to get. 493 <p> 494 * @return the first {@link Output} in the {@link ListOfOutputs} 495 * with the given qualitativeSpecies or null if no such 496 * {@link Output} exists. 497 <p> 498 * @see #getOutput(long n) 499 @see #getNumOutputs() 500 */ public 501 Output getOutputBySpecies(String sid) { 502 long cPtr = libsbmlJNI.Transition_getOutputBySpecies__SWIG_0(swigCPtr, this, sid); 503 return (cPtr == 0) ? null : new Output(cPtr, false); 504 } 505 506 507/** 508 * Adds a copy the given 'Output' to this {@link Transition}. 509 <p> 510 * @param o the {@link Output} object to add 511 <p> 512 * @return integer value indicating success/failure of the 513 * operation. The possible return values are: 514 * <ul> 515 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 516 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 517 * </ul> 518 */ public 519 int addOutput(Output o) { 520 return libsbmlJNI.Transition_addOutput(swigCPtr, this, Output.getCPtr(o), o); 521 } 522 523 524/** 525 * Get the number of {@link Output} objects in this {@link Transition}. 526 <p> 527 * @return the number of {@link Output} objects in this {@link Transition} 528 */ public 529 long getNumOutputs() { 530 return libsbmlJNI.Transition_getNumOutputs(swigCPtr, this); 531 } 532 533 534/** 535 * Creates a new {@link Output} object, adds it to this Transitions 536 * {@link ListOfOutputs} and returns the {@link Output} object created. 537 <p> 538 * @return a new {@link Output} object instance 539 <p> 540 * @see #addOutput(Output o) 541 */ public 542 Output createOutput() { 543 long cPtr = libsbmlJNI.Transition_createOutput(swigCPtr, this); 544 return (cPtr == 0) ? null : new Output(cPtr, false); 545 } 546 547 548/** 549 * Removes the nth {@link Output} from the {@link ListOfOutputs} within this {@link Transition}. 550 * and returns a pointer to it. 551 <p> 552 * The caller owns the returned item and is responsible for deleting it. 553 <p> 554 * @param n the index of the {@link Output} to remove. 555 <p> 556 * @see #getNumOutputs() 557 */ public 558 Output removeOutput(long n) { 559 long cPtr = libsbmlJNI.Transition_removeOutput__SWIG_0(swigCPtr, this, n); 560 return (cPtr == 0) ? null : new Output(cPtr, true); 561 } 562 563 564/** 565 * Removes the {@link Output} with the given identifier from the {@link ListOfOutputs} within this {@link Transition} 566 * and returns a pointer to it. 567 <p> 568 * The caller owns the returned item and is responsible for deleting it. 569 * If none of the items in this list have the identifier <code>sid</code>, then 570 * <code>null</code> is returned. 571 <p> 572 * @param sid the identifier of the {@link Output} to remove. 573 <p> 574 * @return the {@link Output} removed. As mentioned above, the caller owns the 575 * returned item. 576 */ public 577 Output removeOutput(String sid) { 578 long cPtr = libsbmlJNI.Transition_removeOutput__SWIG_1(swigCPtr, this, sid); 579 return (cPtr == 0) ? null : new Output(cPtr, true); 580 } 581 582 583/** 584 * Returns the 'ListOfFunctionTerms' in this {@link Transition} object. 585 <p> 586 * @return the 'ListOfFunctionTerms' attribute of this {@link Transition}. 587 */ public 588 ListOfFunctionTerms getListOfFunctionTerms() { 589 long cPtr = libsbmlJNI.Transition_getListOfFunctionTerms__SWIG_0(swigCPtr, this); 590 return (cPtr == 0) ? null : new ListOfFunctionTerms(cPtr, false); 591 } 592 593 594/** 595 * Get a {@link FunctionTerm} from the {@link ListOfFunctionTerms}. 596 <p> 597 * @param n the index number of the {@link FunctionTerm} to get. 598 <p> 599 * @return the nth {@link FunctionTerm} in the {@link ListOfFunctionTerms} within this {@link Transition}. 600 <p> 601 * @see #getNumFunctionTerms() 602 */ public 603 FunctionTerm getFunctionTerm(long n) { 604 long cPtr = libsbmlJNI.Transition_getFunctionTerm__SWIG_0(swigCPtr, this, n); 605 return (cPtr == 0) ? null : new FunctionTerm(cPtr, false); 606 } 607 608 609/** 610 * Get a {@link FunctionTerm} from the {@link ListOfFunctionTerms} 611 * based on its identifier. 612 <p> 613 * @param sid a string representing the identifier 614 * of the {@link FunctionTerm} to get. 615 <p> 616 * @return the {@link FunctionTerm} in the {@link ListOfFunctionTerms} 617 * with the given id or null if no such 618 * {@link FunctionTerm} exists. 619 <p> 620 * @see #getFunctionTerm(long n) 621 @see #getNumFunctionTerms() 622 */ public 623 FunctionTerm getFunctionTerm(String sid) { 624 long cPtr = libsbmlJNI.Transition_getFunctionTerm__SWIG_2(swigCPtr, this, sid); 625 return (cPtr == 0) ? null : new FunctionTerm(cPtr, false); 626 } 627 628 629/** 630 * Adds a copy the given 'FunctionTerm' to this {@link Transition}. 631 <p> 632 * @param ft the {@link FunctionTerm} object to add 633 <p> 634 * @return integer value indicating success/failure of the 635 * operation. The possible return values are: 636 * <ul> 637 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 638 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 639 * </ul> 640 */ public 641 int addFunctionTerm(FunctionTerm ft) { 642 return libsbmlJNI.Transition_addFunctionTerm(swigCPtr, this, FunctionTerm.getCPtr(ft), ft); 643 } 644 645 646/** 647 * Get the number of {@link FunctionTerm} objects in this {@link Transition}. 648 <p> 649 * @return the number of {@link FunctionTerm} objects in this {@link Transition} 650 */ public 651 long getNumFunctionTerms() { 652 return libsbmlJNI.Transition_getNumFunctionTerms(swigCPtr, this); 653 } 654 655 656/** 657 * Creates a new {@link FunctionTerm} object, adds it to this Transitions 658 * {@link ListOfFunctionTerms} and returns the {@link FunctionTerm} object created. 659 <p> 660 * @return a new {@link FunctionTerm} object instance 661 <p> 662 * @see #addFunctionTerm(FunctionTerm ft) 663 */ public 664 FunctionTerm createFunctionTerm() { 665 long cPtr = libsbmlJNI.Transition_createFunctionTerm(swigCPtr, this); 666 return (cPtr == 0) ? null : new FunctionTerm(cPtr, false); 667 } 668 669 670/** 671 * Removes the nth {@link FunctionTerm} from the {@link ListOfFunctionTerms} within this {@link Transition}. 672 * and returns a pointer to it. 673 <p> 674 * The caller owns the returned item and is responsible for deleting it. 675 <p> 676 * @param n the index of the {@link FunctionTerm} to remove. 677 <p> 678 * @see #getNumFunctionTerms() 679 */ public 680 FunctionTerm removeFunctionTerm(long n) { 681 long cPtr = libsbmlJNI.Transition_removeFunctionTerm__SWIG_0(swigCPtr, this, n); 682 return (cPtr == 0) ? null : new FunctionTerm(cPtr, true); 683 } 684 685 686/** 687 * Removes the {@link FunctionTerm} with the given identifier from the {@link ListOfFunctionTerms} within this {@link Transition} 688 * and returns a pointer to it. 689 <p> 690 * The caller owns the returned item and is responsible for deleting it. 691 * If none of the items in this list have the identifier <code>sid</code>, then 692 * <code>null</code> is returned. 693 <p> 694 * @param sid the identifier of the {@link FunctionTerm} to remove. 695 <p> 696 * @return the {@link FunctionTerm} removed. As mentioned above, the caller owns the 697 * returned item. 698 */ public 699 FunctionTerm removeFunctionTerm(String sid) { 700 long cPtr = libsbmlJNI.Transition_removeFunctionTerm__SWIG_1(swigCPtr, this, sid); 701 return (cPtr == 0) ? null : new FunctionTerm(cPtr, true); 702 } 703 704 705/** 706 * Creates a new {@link DefaultTerm} object, adds it to this Transitions 707 * {@link ListOfFunctionTerms} and returns the {@link DefaultTerm} object created. 708 <p> 709 * @return a new {@link DefaultTerm} object instance 710 <p> 711 * @see #setDefaultTerm(DefaultTerm ft) 712 */ public 713 DefaultTerm createDefaultTerm() { 714 long cPtr = libsbmlJNI.Transition_createDefaultTerm(swigCPtr, this); 715 return (cPtr == 0) ? null : new DefaultTerm(cPtr, false); 716 } 717 718 719/** 720 * Sets the given 'DefaultTerm' to this {@link Transition}. 721 <p> 722 * @param dt the {@link DefaultTerm} object to add 723 <p> 724 * @return integer value indicating success/failure of the 725 * operation. The possible return values are: 726 * <ul> 727 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 728 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 729 * </ul> 730 */ public 731 int setDefaultTerm(DefaultTerm dt) { 732 return libsbmlJNI.Transition_setDefaultTerm(swigCPtr, this, DefaultTerm.getCPtr(dt), dt); 733 } 734 735 736/** 737 * Predicate returning <code>true</code> if the defaultTerm 738 * for this {@link Transition} object has been set. 739 <p> 740 * @return a boolean value indicating whether the defaultTerm 741 * child for this object has been defined. 742 */ public 743 boolean isSetDefaultTerm() { 744 return libsbmlJNI.Transition_isSetDefaultTerm(swigCPtr, this); 745 } 746 747 748/** 749 * Get the {@link DefaultTerm} from the {@link ListOfFunctionTerms}. 750 <p> 751 * @return the {@link DefaultTerm} in the {@link ListOfFunctionTerms} within this {@link Transition}, or null if no such value is set. 752 */ public 753 DefaultTerm getDefaultTerm() { 754 long cPtr = libsbmlJNI.Transition_getDefaultTerm__SWIG_0(swigCPtr, this); 755 return (cPtr == 0) ? null : new DefaultTerm(cPtr, false); 756 } 757 758 759/** 760 * Returns the XML element name of this object, which for {@link Transition}, is 761 * always <code>'transition'.</code> 762 <p> 763 * @return the name of this element, i.e. <code>'transition'.</code> 764 */ public 765 String getElementName() { 766 return libsbmlJNI.Transition_getElementName(swigCPtr, this); 767 } 768 769 770/** 771 * Returns the libSBML type code of this object instance. 772 <p> 773 * <p> 774 * LibSBML attaches an identifying code to every kind of SBML object. These 775 * are integer constants known as <em>SBML type codes</em>. The names of all 776 * the codes begin with the characters “<code>SBML_</code>”. 777 * In the Java language interface for libSBML, the 778 * type codes are defined as static integer constants in the interface class 779 * {@link libsbmlConstants}. Note that different Level 3 780 * package plug-ins may use overlapping type codes; to identify the package 781 * to which a given object belongs, call the <code>getPackageName()</code> 782 * method on the object. 783 <p> 784 * @return the SBML type code for this object: 785 * {@link libsbmlConstants#SBML_QUAL_TRANSITION SBML_QUAL_TRANSITION} 786 <p> 787 * <p> 788 * @warning <span class='warning'>The specific integer values of the possible 789 * type codes may be reused by different Level 3 package plug-ins. 790 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 791 * both getTypeCode() and getPackageName()</strong>.</span> 792 <p> 793 * @see #getElementName() 794 * @see #getPackageName() 795 */ public 796 int getTypeCode() { 797 return libsbmlJNI.Transition_getTypeCode(swigCPtr, this); 798 } 799 800 801/** 802 * Predicate returning <code>true</code> if all the required attributes 803 * for this {@link Transition} object have been set. 804 <p> 805 * @note The required attributes for a {@link Transition} object are: 806 * <ul> 807 * <li> 'output' 808 * 809 * </ul> <p> 810 * @return a boolean value indicating whether all the required 811 * attributes for this object have been defined. 812 */ public 813 boolean hasRequiredAttributes() { 814 return libsbmlJNI.Transition_hasRequiredAttributes(swigCPtr, this); 815 } 816 817 818/** 819 * Predicate returning <code>true</code> if all the required attributes 820 * for this {@link Transition} object have been set. 821 <p> 822 * @note The required elements for a {@link Transition} object are: 823 * <ul> 824 * <li> 'output' 825 * 826 * </ul> <p> 827 * @return a boolean value indicating whether all the required 828 * elements for this object have been defined. 829 */ public 830 boolean hasRequiredElements() { 831 return libsbmlJNI.Transition_hasRequiredElements(swigCPtr, this); 832 } 833 834 835/** 836 * Connects to child elements. 837 * @internal 838 */ public 839 void connectToChild() { 840 libsbmlJNI.Transition_connectToChild(swigCPtr, this); 841 } 842 843 844/** 845 * Enables/Disables the given package with this element. 846 * @internal 847 */ public 848 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 849 libsbmlJNI.Transition_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 850 } 851 852}