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 single configuration setting for an SBML converter. 013 <p> 014 * <p style='color: #777; font-style: italic'> 015This class of objects is defined by libSBML only and has no direct 016equivalent in terms of SBML components. It is a class used in 017the implementation of extra functionality provided by libSBML. 018</p> 019 020 <p> 021 * LibSBML provides a number of converters that can perform transformations 022 * on SBML documents. These converters allow their behaviors to be 023 * controlled by setting property values. Converter properties are 024 * communicated using objects of class {@link ConversionProperties}, and within 025 * such objects, individual options are encapsulated using {@link ConversionOption} 026 * objects. 027 <p> 028 * A {@link ConversionOption} object consists of 029 * four parts: 030 * <ul> 031 * <li> A <em>key</em>, acting as the name of the option. 032 * <li> A <em>value</em> of this option. 033 * <li> A <em>type</em> for the value; the type code is chosen from a set of integer constants whose names all 034 * begin with the prefix <code>CNV_TYPE_</code>. (See the separate <a 035 * class='el' href='#ConversionOptionType_t'>subsection</a> below for more 036 * information.) 037 * <li> A <em>description</em> consisting of a text string that describes the 038 * option in some way. 039 * 040 * </ul> <p> 041 * There are no constraints on the values of keys or descriptions; 042 * authors of SBML converters are free to choose them as they see fit. 043 <p> 044 * <h2>Conversion option data types</h2> 045 <p> 046 * An option in {@link ConversionOption} must have a data type declared, to 047 * indicate whether it is a string value, an integer, and so forth. The 048 * possible types of values are taken from 049 * a set of 050 * constants whose symbol names begin with the prefix 051 * <code>CNV_TYPE_</code>. The following are the possible values: 052 <p> 053 * <center> 054 * <table width='90%' cellspacing='1' cellpadding='1' border='0' class='normal-font'> 055 * <tr style='background: lightgray' class='normal-font'> 056 * <td><strong>Enumerator</strong></td> 057 * <td><strong>Meaning</strong></td> 058 * </tr> 059 * <tr> 060 * <td><code>{@link libsbmlConstants#CNV_TYPE_BOOL CNV_TYPE_BOOL}</code></td> 061 * <td>Indicates the value type is a Boolean.</td> 062 * </tr> 063 * <tr> 064 * <td><code>{@link libsbmlConstants#CNV_TYPE_DOUBLE CNV_TYPE_DOUBLE}</code></td> 065 * <td>Indicates the value type is a double-sized float.</td> 066 * </tr> 067 * <tr> 068 * <td><code>{@link libsbmlConstants#CNV_TYPE_INT CNV_TYPE_INT}</code></td> 069 * <td>Indicates the value type is an integer.</td> 070 * </tr> 071 * <tr> 072 * <td><code>{@link libsbmlConstants#CNV_TYPE_SINGLE CNV_TYPE_SINGLE}</code></td> 073 * <td>Indicates the value type is a float.</td> 074 * </tr> 075 * <tr> 076 * <td><code>{@link libsbmlConstants#CNV_TYPE_STRING CNV_TYPE_STRING}</code></td> 077 * <td>Indicates the value type is a string.</td> 078 * </tr> 079 * </table> 080 * </center> 081 <p> 082 * @see ConversionProperties 083 */ 084 085public class ConversionOption { 086 private long swigCPtr; 087 protected boolean swigCMemOwn; 088 089 protected ConversionOption(long cPtr, boolean cMemoryOwn) 090 { 091 swigCMemOwn = cMemoryOwn; 092 swigCPtr = cPtr; 093 } 094 095 protected static long getCPtr(ConversionOption obj) 096 { 097 return (obj == null) ? 0 : obj.swigCPtr; 098 } 099 100 protected static long getCPtrAndDisown (ConversionOption obj) 101 { 102 long ptr = 0; 103 104 if (obj != null) 105 { 106 ptr = obj.swigCPtr; 107 obj.swigCMemOwn = false; 108 } 109 110 return ptr; 111 } 112 113 protected void finalize() { 114 delete(); 115 } 116 117 public synchronized void delete() { 118 if (swigCPtr != 0) { 119 if (swigCMemOwn) { 120 swigCMemOwn = false; 121 libsbmlJNI.delete_ConversionOption(swigCPtr); 122 } 123 swigCPtr = 0; 124 } 125 } 126 127 128/** 129 * Creates a new {@link ConversionOption}. 130 <p> 131 * This is the general constructor, taking arguments for all aspects of 132 * an option. Other constructors exist with different arguments. 133 <p> 134 * <p> 135 * The conversion <code>type</code> argument value must be one of 136 * the constants whose names begin 137 * with the characters <code>CNV_TYPE_</code> in the interface class 138 * {@link libsbmlConstants}. 139 <p> 140 * @param key the key for this option 141 * @param value an optional value for this option 142 * @param type the type of this option 143 * @param description the description for this option 144 <p> 145 * 146</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 147The native C++ implementation of this method defines a default argument 148value. In the documentation generated for different libSBML language 149bindings, you may or may not see corresponding arguments in the method 150declarations. For example, in Java and C#, a default argument is handled by 151declaring two separate methods, with one of them having the argument and 152the other one lacking the argument. However, the libSBML documentation will 153be <em>identical</em> for both methods. Consequently, if you are reading 154this and do not see an argument even though one is described, please look 155for descriptions of other variants of this method near where this one 156appears in the documentation. 157</dd></dl> 158 159 */ public 160 ConversionOption(String key, String value, int type, String description) { 161 this(libsbmlJNI.new_ConversionOption__SWIG_0(key, value, type, description), true); 162 } 163 164 165/** 166 * Creates a new {@link ConversionOption}. 167 <p> 168 * This is the general constructor, taking arguments for all aspects of 169 * an option. Other constructors exist with different arguments. 170 <p> 171 * <p> 172 * The conversion <code>type</code> argument value must be one of 173 * the constants whose names begin 174 * with the characters <code>CNV_TYPE_</code> in the interface class 175 * {@link libsbmlConstants}. 176 <p> 177 * @param key the key for this option 178 * @param value an optional value for this option 179 * @param type the type of this option 180 * @param description the description for this option 181 <p> 182 * 183</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 184The native C++ implementation of this method defines a default argument 185value. In the documentation generated for different libSBML language 186bindings, you may or may not see corresponding arguments in the method 187declarations. For example, in Java and C#, a default argument is handled by 188declaring two separate methods, with one of them having the argument and 189the other one lacking the argument. However, the libSBML documentation will 190be <em>identical</em> for both methods. Consequently, if you are reading 191this and do not see an argument even though one is described, please look 192for descriptions of other variants of this method near where this one 193appears in the documentation. 194</dd></dl> 195 196 */ public 197 ConversionOption(String key, String value, int type) { 198 this(libsbmlJNI.new_ConversionOption__SWIG_1(key, value, type), true); 199 } 200 201 202/** 203 * Creates a new {@link ConversionOption}. 204 <p> 205 * This is the general constructor, taking arguments for all aspects of 206 * an option. Other constructors exist with different arguments. 207 <p> 208 * <p> 209 * The conversion <code>type</code> argument value must be one of 210 * the constants whose names begin 211 * with the characters <code>CNV_TYPE_</code> in the interface class 212 * {@link libsbmlConstants}. 213 <p> 214 * @param key the key for this option 215 * @param value an optional value for this option 216 * @param type the type of this option 217 * @param description the description for this option 218 <p> 219 * 220</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 221The native C++ implementation of this method defines a default argument 222value. In the documentation generated for different libSBML language 223bindings, you may or may not see corresponding arguments in the method 224declarations. For example, in Java and C#, a default argument is handled by 225declaring two separate methods, with one of them having the argument and 226the other one lacking the argument. However, the libSBML documentation will 227be <em>identical</em> for both methods. Consequently, if you are reading 228this and do not see an argument even though one is described, please look 229for descriptions of other variants of this method near where this one 230appears in the documentation. 231</dd></dl> 232 233 */ public 234 ConversionOption(String key, String value) { 235 this(libsbmlJNI.new_ConversionOption__SWIG_2(key, value), true); 236 } 237 238 239/** 240 * Creates a new {@link ConversionOption}. 241 <p> 242 * This is the general constructor, taking arguments for all aspects of 243 * an option. Other constructors exist with different arguments. 244 <p> 245 * <p> 246 * The conversion <code>type</code> argument value must be one of 247 * the constants whose names begin 248 * with the characters <code>CNV_TYPE_</code> in the interface class 249 * {@link libsbmlConstants}. 250 <p> 251 * @param key the key for this option 252 * @param value an optional value for this option 253 * @param type the type of this option 254 * @param description the description for this option 255 <p> 256 * 257</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 258The native C++ implementation of this method defines a default argument 259value. In the documentation generated for different libSBML language 260bindings, you may or may not see corresponding arguments in the method 261declarations. For example, in Java and C#, a default argument is handled by 262declaring two separate methods, with one of them having the argument and 263the other one lacking the argument. However, the libSBML documentation will 264be <em>identical</em> for both methods. Consequently, if you are reading 265this and do not see an argument even though one is described, please look 266for descriptions of other variants of this method near where this one 267appears in the documentation. 268</dd></dl> 269 270 */ public 271 ConversionOption(String key) { 272 this(libsbmlJNI.new_ConversionOption__SWIG_3(key), true); 273 } 274 275 276/** 277 * Creates a new {@link ConversionOption} specialized for string-type options. 278 <p> 279 * @param key the key for this option 280 * @param value the value for this option 281 * @param description an optional description 282 <p> 283 * 284</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 285The native C++ implementation of this method defines a default argument 286value. In the documentation generated for different libSBML language 287bindings, you may or may not see corresponding arguments in the method 288declarations. For example, in Java and C#, a default argument is handled by 289declaring two separate methods, with one of them having the argument and 290the other one lacking the argument. However, the libSBML documentation will 291be <em>identical</em> for both methods. Consequently, if you are reading 292this and do not see an argument even though one is described, please look 293for descriptions of other variants of this method near where this one 294appears in the documentation. 295</dd></dl> 296 297 */ public 298 ConversionOption(String key, String value, String description) { 299 this(libsbmlJNI.new_ConversionOption__SWIG_4(key, value, description), true); 300 } 301 302 303/** 304 * Creates a new {@link ConversionOption} specialized for Boolean-type options. 305 <p> 306 * @param key the key for this option 307 * @param value the value for this option 308 * @param description an optional description 309 <p> 310 * 311</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 312The native C++ implementation of this method defines a default argument 313value. In the documentation generated for different libSBML language 314bindings, you may or may not see corresponding arguments in the method 315declarations. For example, in Java and C#, a default argument is handled by 316declaring two separate methods, with one of them having the argument and 317the other one lacking the argument. However, the libSBML documentation will 318be <em>identical</em> for both methods. Consequently, if you are reading 319this and do not see an argument even though one is described, please look 320for descriptions of other variants of this method near where this one 321appears in the documentation. 322</dd></dl> 323 324 */ public 325 ConversionOption(String key, boolean value, String description) { 326 this(libsbmlJNI.new_ConversionOption__SWIG_6(key, value, description), true); 327 } 328 329 330/** 331 * Creates a new {@link ConversionOption} specialized for Boolean-type options. 332 <p> 333 * @param key the key for this option 334 * @param value the value for this option 335 * @param description an optional description 336 <p> 337 * 338</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 339The native C++ implementation of this method defines a default argument 340value. In the documentation generated for different libSBML language 341bindings, you may or may not see corresponding arguments in the method 342declarations. For example, in Java and C#, a default argument is handled by 343declaring two separate methods, with one of them having the argument and 344the other one lacking the argument. However, the libSBML documentation will 345be <em>identical</em> for both methods. Consequently, if you are reading 346this and do not see an argument even though one is described, please look 347for descriptions of other variants of this method near where this one 348appears in the documentation. 349</dd></dl> 350 351 */ public 352 ConversionOption(String key, boolean value) { 353 this(libsbmlJNI.new_ConversionOption__SWIG_7(key, value), true); 354 } 355 356 357/** 358 * Creates a new {@link ConversionOption} specialized for double-type options. 359 <p> 360 * @param key the key for this option 361 * @param value the value for this option 362 * @param description an optional description 363 <p> 364 * 365</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 366The native C++ implementation of this method defines a default argument 367value. In the documentation generated for different libSBML language 368bindings, you may or may not see corresponding arguments in the method 369declarations. For example, in Java and C#, a default argument is handled by 370declaring two separate methods, with one of them having the argument and 371the other one lacking the argument. However, the libSBML documentation will 372be <em>identical</em> for both methods. Consequently, if you are reading 373this and do not see an argument even though one is described, please look 374for descriptions of other variants of this method near where this one 375appears in the documentation. 376</dd></dl> 377 378 */ public 379 ConversionOption(String key, double value, String description) { 380 this(libsbmlJNI.new_ConversionOption__SWIG_8(key, value, description), true); 381 } 382 383 384/** 385 * Creates a new {@link ConversionOption} specialized for double-type options. 386 <p> 387 * @param key the key for this option 388 * @param value the value for this option 389 * @param description an optional description 390 <p> 391 * 392</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 393The native C++ implementation of this method defines a default argument 394value. In the documentation generated for different libSBML language 395bindings, you may or may not see corresponding arguments in the method 396declarations. For example, in Java and C#, a default argument is handled by 397declaring two separate methods, with one of them having the argument and 398the other one lacking the argument. However, the libSBML documentation will 399be <em>identical</em> for both methods. Consequently, if you are reading 400this and do not see an argument even though one is described, please look 401for descriptions of other variants of this method near where this one 402appears in the documentation. 403</dd></dl> 404 405 */ public 406 ConversionOption(String key, double value) { 407 this(libsbmlJNI.new_ConversionOption__SWIG_9(key, value), true); 408 } 409 410 411/** 412 * Creates a new {@link ConversionOption} specialized for float-type options. 413 <p> 414 * @param key the key for this option 415 * @param value the value for this option 416 * @param description an optional description 417 <p> 418 * 419</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 420The native C++ implementation of this method defines a default argument 421value. In the documentation generated for different libSBML language 422bindings, you may or may not see corresponding arguments in the method 423declarations. For example, in Java and C#, a default argument is handled by 424declaring two separate methods, with one of them having the argument and 425the other one lacking the argument. However, the libSBML documentation will 426be <em>identical</em> for both methods. Consequently, if you are reading 427this and do not see an argument even though one is described, please look 428for descriptions of other variants of this method near where this one 429appears in the documentation. 430</dd></dl> 431 432 */ public 433 ConversionOption(String key, float value, String description) { 434 this(libsbmlJNI.new_ConversionOption__SWIG_10(key, value, description), true); 435 } 436 437 438/** 439 * Creates a new {@link ConversionOption} specialized for float-type options. 440 <p> 441 * @param key the key for this option 442 * @param value the value for this option 443 * @param description an optional description 444 <p> 445 * 446</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 447The native C++ implementation of this method defines a default argument 448value. In the documentation generated for different libSBML language 449bindings, you may or may not see corresponding arguments in the method 450declarations. For example, in Java and C#, a default argument is handled by 451declaring two separate methods, with one of them having the argument and 452the other one lacking the argument. However, the libSBML documentation will 453be <em>identical</em> for both methods. Consequently, if you are reading 454this and do not see an argument even though one is described, please look 455for descriptions of other variants of this method near where this one 456appears in the documentation. 457</dd></dl> 458 459 */ public 460 ConversionOption(String key, float value) { 461 this(libsbmlJNI.new_ConversionOption__SWIG_11(key, value), true); 462 } 463 464 465/** 466 * Creates a new {@link ConversionOption} specialized for integer-type options. 467 <p> 468 * @param key the key for this option 469 * @param value the value for this option 470 * @param description an optional description 471 <p> 472 * 473</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 474The native C++ implementation of this method defines a default argument 475value. In the documentation generated for different libSBML language 476bindings, you may or may not see corresponding arguments in the method 477declarations. For example, in Java and C#, a default argument is handled by 478declaring two separate methods, with one of them having the argument and 479the other one lacking the argument. However, the libSBML documentation will 480be <em>identical</em> for both methods. Consequently, if you are reading 481this and do not see an argument even though one is described, please look 482for descriptions of other variants of this method near where this one 483appears in the documentation. 484</dd></dl> 485 486 */ public 487 ConversionOption(String key, int value, String description) { 488 this(libsbmlJNI.new_ConversionOption__SWIG_12(key, value, description), true); 489 } 490 491 492/** 493 * Creates a new {@link ConversionOption} specialized for integer-type options. 494 <p> 495 * @param key the key for this option 496 * @param value the value for this option 497 * @param description an optional description 498 <p> 499 * 500</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 501The native C++ implementation of this method defines a default argument 502value. In the documentation generated for different libSBML language 503bindings, you may or may not see corresponding arguments in the method 504declarations. For example, in Java and C#, a default argument is handled by 505declaring two separate methods, with one of them having the argument and 506the other one lacking the argument. However, the libSBML documentation will 507be <em>identical</em> for both methods. Consequently, if you are reading 508this and do not see an argument even though one is described, please look 509for descriptions of other variants of this method near where this one 510appears in the documentation. 511</dd></dl> 512 513 */ public 514 ConversionOption(String key, int value) { 515 this(libsbmlJNI.new_ConversionOption__SWIG_13(key, value), true); 516 } 517 518 519/** 520 * Copy constructor; creates a copy of an {@link ConversionOption} object. 521 <p> 522 * @param orig the {@link ConversionOption} object to copy. 523 */ public 524 ConversionOption(ConversionOption orig) { 525 this(libsbmlJNI.new_ConversionOption__SWIG_14(ConversionOption.getCPtr(orig), orig), true); 526 } 527 528 529/** 530 * Creates and returns a deep copy of this {@link ConversionOption} object. 531 <p> 532 * @return the (deep) copy of this {@link ConversionOption} object. 533 */ public 534 ConversionOption cloneObject() { 535 long cPtr = libsbmlJNI.ConversionOption_cloneObject(swigCPtr, this); 536 return (cPtr == 0) ? null : new ConversionOption(cPtr, true); 537 } 538 539 540/** 541 * Returns the key for this option. 542 <p> 543 * @return the key, as a string. 544 */ public 545 String getKey() { 546 return libsbmlJNI.ConversionOption_getKey(swigCPtr, this); 547 } 548 549 550/** 551 * Sets the key for this option. 552 <p> 553 * @param key a string representing the key to set. 554 */ public 555 void setKey(String key) { 556 libsbmlJNI.ConversionOption_setKey(swigCPtr, this, key); 557 } 558 559 560/** 561 * Returns the value of this option. 562 <p> 563 * @return the value of this option, as a string. 564 */ public 565 String getValue() { 566 return libsbmlJNI.ConversionOption_getValue(swigCPtr, this); 567 } 568 569 570/** 571 * Sets the value for this option. 572 <p> 573 * @param value the value to set, as a string. 574 */ public 575 void setValue(String value) { 576 libsbmlJNI.ConversionOption_setValue(swigCPtr, this, value); 577 } 578 579 580/** 581 * Returns the description string for this option. 582 <p> 583 * @return the description of this option. 584 */ public 585 String getDescription() { 586 return libsbmlJNI.ConversionOption_getDescription(swigCPtr, this); 587 } 588 589 590/** 591 * Sets the description text for this option. 592 <p> 593 * @param description the description to set for this option. 594 */ public 595 void setDescription(String description) { 596 libsbmlJNI.ConversionOption_setDescription(swigCPtr, this, description); 597 } 598 599 600/** 601 * Returns the type of this option 602 <p> 603 * @return the type of this option. 604 */ public 605 int getType() { 606 return libsbmlJNI.ConversionOption_getType(swigCPtr, this); 607 } 608 609 610/** 611 * Sets the type of this option. 612 <p> 613 * <p> 614 * The conversion <code>type</code> argument value must be one of 615 * the constants whose names begin 616 * with the characters <code>CNV_TYPE_</code> in the interface class 617 * {@link libsbmlConstants}. 618 <p> 619 * @param type the type value to use. 620 */ public 621 void setType(int type) { 622 libsbmlJNI.ConversionOption_setType(swigCPtr, this, type); 623 } 624 625 626/** 627 * Returns the value of this option as a Boolean. 628 <p> 629 * @return the value of this option. 630 */ public 631 boolean getBoolValue() { 632 return libsbmlJNI.ConversionOption_getBoolValue(swigCPtr, this); 633 } 634 635 636/** 637 * Set the value of this option to a given Boolean value. 638 <p> 639 * Invoking this method will also set the type of the option to 640 * {@link libsbmlConstants#CNV_TYPE_BOOL CNV_TYPE_BOOL}. 641 <p> 642 * @param value the Boolean value to set 643 */ public 644 void setBoolValue(boolean value) { 645 libsbmlJNI.ConversionOption_setBoolValue(swigCPtr, this, value); 646 } 647 648 649/** 650 * Returns the value of this option as a <code>double.</code> 651 <p> 652 * @return the value of this option. 653 */ public 654 double getDoubleValue() { 655 return libsbmlJNI.ConversionOption_getDoubleValue(swigCPtr, this); 656 } 657 658 659/** 660 * Set the value of this option to a given <code>double</code> value. 661 <p> 662 * Invoking this method will also set the type of the option to 663 * {@link libsbmlConstants#CNV_TYPE_DOUBLE CNV_TYPE_DOUBLE}. 664 <p> 665 * @param value the value to set 666 */ public 667 void setDoubleValue(double value) { 668 libsbmlJNI.ConversionOption_setDoubleValue(swigCPtr, this, value); 669 } 670 671 672/** 673 * Returns the value of this option as a <code>float.</code> 674 <p> 675 * @return the value of this option as a float 676 */ public 677 float getFloatValue() { 678 return libsbmlJNI.ConversionOption_getFloatValue(swigCPtr, this); 679 } 680 681 682/** 683 * Set the value of this option to a given <code>float</code> value. 684 <p> 685 * Invoking this method will also set the type of the option to 686 * {@link libsbmlConstants#CNV_TYPE_SINGLE CNV_TYPE_SINGLE}. 687 <p> 688 * @param value the value to set 689 */ public 690 void setFloatValue(float value) { 691 libsbmlJNI.ConversionOption_setFloatValue(swigCPtr, this, value); 692 } 693 694 695/** 696 * Returns the value of this option as an <code>integer.</code> 697 <p> 698 * @return the value of this option, as an int 699 */ public 700 int getIntValue() { 701 return libsbmlJNI.ConversionOption_getIntValue(swigCPtr, this); 702 } 703 704 705/** 706 * Set the value of this option to a given <code>int</code> value. 707 <p> 708 * Invoking this method will also set the type of the option to 709 * {@link libsbmlConstants#CNV_TYPE_INT CNV_TYPE_INT}. 710 <p> 711 * @param value the value to set 712 */ public 713 void setIntValue(int value) { 714 libsbmlJNI.ConversionOption_setIntValue(swigCPtr, this, value); 715 } 716 717}