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 Input} class for the Qualitative Models package. 015 <p> 016 * Each {@link Input} refers to a {@link QualitativeSpecies} that participates in the 017 * corresponding {@link Transition}. In Petri nets, these are the input places of the 018 * transition. In logical models, they are the regulators of the species 019 * whose behaviour is defined by the transition. 020 */ 021 022public class Input extends SBase { 023 private long swigCPtr; 024 025 protected Input(long cPtr, boolean cMemoryOwn) 026 { 027 super(libsbmlJNI.Input_SWIGUpcast(cPtr), cMemoryOwn); 028 swigCPtr = cPtr; 029 } 030 031 protected static long getCPtr(Input obj) 032 { 033 return (obj == null) ? 0 : obj.swigCPtr; 034 } 035 036 protected static long getCPtrAndDisown (Input obj) 037 { 038 long ptr = 0; 039 040 if (obj != null) 041 { 042 ptr = obj.swigCPtr; 043 obj.swigCMemOwn = false; 044 } 045 046 return ptr; 047 } 048 049 protected void finalize() { 050 delete(); 051 } 052 053 public synchronized void delete() { 054 if (swigCPtr != 0) { 055 if (swigCMemOwn) { 056 swigCMemOwn = false; 057 libsbmlJNI.delete_Input(swigCPtr); 058 } 059 swigCPtr = 0; 060 } 061 super.delete(); 062 } 063 064 065/** 066 * Creates a new {@link Input} with the given level, version, and package version. 067 <p> 068 * @param level a long integer, the SBML Level to assign to this {@link Input} 069 <p> 070 * @param version a long integer, the SBML Version to assign to this {@link Input} 071 <p> 072 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Input} 073 */ public 074 Input(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 075 this(libsbmlJNI.new_Input__SWIG_0(level, version, pkgVersion), true); 076 } 077 078 079/** 080 * Creates a new {@link Input} with the given level, version, and package version. 081 <p> 082 * @param level a long integer, the SBML Level to assign to this {@link Input} 083 <p> 084 * @param version a long integer, the SBML Version to assign to this {@link Input} 085 <p> 086 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Input} 087 */ public 088 Input(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 089 this(libsbmlJNI.new_Input__SWIG_1(level, version), true); 090 } 091 092 093/** 094 * Creates a new {@link Input} with the given level, version, and package version. 095 <p> 096 * @param level a long integer, the SBML Level to assign to this {@link Input} 097 <p> 098 * @param version a long integer, the SBML Version to assign to this {@link Input} 099 <p> 100 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Input} 101 */ public 102 Input(long level) throws org.sbml.libsbml.SBMLConstructorException { 103 this(libsbmlJNI.new_Input__SWIG_2(level), true); 104 } 105 106 107/** 108 * Creates a new {@link Input} with the given level, version, and package version. 109 <p> 110 * @param level a long integer, the SBML Level to assign to this {@link Input} 111 <p> 112 * @param version a long integer, the SBML Version to assign to this {@link Input} 113 <p> 114 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Input} 115 */ public 116 Input() throws org.sbml.libsbml.SBMLConstructorException { 117 this(libsbmlJNI.new_Input__SWIG_3(), true); 118 } 119 120 121/** 122 * Creates a new {@link Input} with the given {@link QualPkgNamespaces} object. 123 <p> 124 * @param qualns the {@link QualPkgNamespaces} object 125 */ public 126 Input(QualPkgNamespaces qualns) throws org.sbml.libsbml.SBMLConstructorException { 127 this(libsbmlJNI.new_Input__SWIG_4(QualPkgNamespaces.getCPtr(qualns), qualns), true); 128 } 129 130 131/** 132 * Copy constructor for {@link Input}. 133 <p> 134 * @param orig the {@link Input} instance to copy. 135 */ public 136 Input(Input orig) throws org.sbml.libsbml.SBMLConstructorException { 137 this(libsbmlJNI.new_Input__SWIG_5(Input.getCPtr(orig), orig), true); 138 } 139 140 141/** 142 * Creates and returns a deep copy of this {@link Input} object. 143 <p> 144 * @return a (deep) copy of this {@link Input} object. 145 */ public 146 Input cloneObject() { 147 long cPtr = libsbmlJNI.Input_cloneObject(swigCPtr, this); 148 return (cPtr == 0) ? null : new Input(cPtr, true); 149 } 150 151 152/** 153 * Returns the value of the 'id' attribute of this {@link Input}. 154 <p> 155 * @return the value of the 'id' attribute of this {@link Input} as a string. 156 */ public 157 String getId() { 158 return libsbmlJNI.Input_getId(swigCPtr, this); 159 } 160 161 162/** 163 * Returns the value of the 'qualitativeSpecies' attribute of this {@link Input}. 164 <p> 165 * @return the value of the 'qualitativeSpecies' attribute of this {@link Input} as a string. 166 */ public 167 String getQualitativeSpecies() { 168 return libsbmlJNI.Input_getQualitativeSpecies(swigCPtr, this); 169 } 170 171 172/** 173 * Returns the value of the 'transitionEffect' attribute of this {@link Input}. 174 <p> 175 * @return the value of the 'transitionEffect' attribute of this {@link Input} as a string. 176 */ public 177 int getTransitionEffect() { 178 return libsbmlJNI.Input_getTransitionEffect(swigCPtr, this); 179 } 180 181 182/** 183 * Returns the value of the 'name' attribute of this {@link Input}. 184 <p> 185 * @return the value of the 'name' attribute of this {@link Input} as a string. 186 */ public 187 String getName() { 188 return libsbmlJNI.Input_getName(swigCPtr, this); 189 } 190 191 192/** 193 * Returns the value of the 'sign' attribute of this {@link Input}. 194 <p> 195 * @return the value of the 'sign' attribute of this {@link Input} as a string. 196 */ public 197 int getSign() { 198 return libsbmlJNI.Input_getSign(swigCPtr, this); 199 } 200 201 202/** 203 * Returns the value of the 'thresholdLevel' attribute of this {@link Input}. 204 <p> 205 * @return the value of the 'thresholdLevel' attribute of this {@link Input} as a integer. 206 */ public 207 int getThresholdLevel() { 208 return libsbmlJNI.Input_getThresholdLevel(swigCPtr, this); 209 } 210 211 212/** 213 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 214 * {@link Input}'s 'id' attribute has been set. 215 <p> 216 * @return <code>true</code> if this {@link Input}'s 'id' attribute has been set, 217 * otherwise <code>false</code> is returned. 218 */ public 219 boolean isSetId() { 220 return libsbmlJNI.Input_isSetId(swigCPtr, this); 221 } 222 223 224/** 225 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 226 * {@link Input}'s 'qualitativeSpecies' attribute has been set. 227 <p> 228 * @return <code>true</code> if this {@link Input}'s 'qualitativeSpecies' attribute has been set, 229 * otherwise <code>false</code> is returned. 230 */ public 231 boolean isSetQualitativeSpecies() { 232 return libsbmlJNI.Input_isSetQualitativeSpecies(swigCPtr, this); 233 } 234 235 236/** 237 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 238 * {@link Input}'s 'transitionEffect' attribute has been set. 239 <p> 240 * @return <code>true</code> if this {@link Input}'s 'transitionEffect' attribute has been set, 241 * otherwise <code>false</code> is returned. 242 */ public 243 boolean isSetTransitionEffect() { 244 return libsbmlJNI.Input_isSetTransitionEffect(swigCPtr, this); 245 } 246 247 248/** 249 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 250 * {@link Input}'s 'name' attribute has been set. 251 <p> 252 * @return <code>true</code> if this {@link Input}'s 'name' attribute has been set, 253 * otherwise <code>false</code> is returned. 254 */ public 255 boolean isSetName() { 256 return libsbmlJNI.Input_isSetName(swigCPtr, this); 257 } 258 259 260/** 261 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 262 * {@link Input}'s 'sign' attribute has been set. 263 <p> 264 * @return <code>true</code> if this {@link Input}'s 'sign' attribute has been set, 265 * otherwise <code>false</code> is returned. 266 */ public 267 boolean isSetSign() { 268 return libsbmlJNI.Input_isSetSign(swigCPtr, this); 269 } 270 271 272/** 273 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 274 * {@link Input}'s 'thresholdLevel' attribute has been set. 275 <p> 276 * @return <code>true</code> if this {@link Input}'s 'thresholdLevel' attribute has been set, 277 * otherwise <code>false</code> is returned. 278 */ public 279 boolean isSetThresholdLevel() { 280 return libsbmlJNI.Input_isSetThresholdLevel(swigCPtr, this); 281 } 282 283 284/** 285 * Sets the value of the 'id' attribute of this {@link Input}. 286 <p> 287 * @param id String value of the 'id' attribute to be set 288 <p> 289 * @return integer value indicating success/failure of the 290 * operation. The possible return values are: 291 * <ul> 292 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 293 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 294 * </ul> 295 */ public 296 int setId(String id) { 297 return libsbmlJNI.Input_setId(swigCPtr, this, id); 298 } 299 300 301/** 302 * Sets the value of the 'qualitativeSpecies' attribute of this {@link Input}. 303 <p> 304 * @param qualitativeSpecies String value of the 'qualitativeSpecies' attribute to be set 305 <p> 306 * @return integer value indicating success/failure of the 307 * operation. The possible return values are: 308 * <ul> 309 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 310 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 311 * </ul> 312 */ public 313 int setQualitativeSpecies(String qualitativeSpecies) { 314 return libsbmlJNI.Input_setQualitativeSpecies(swigCPtr, this, qualitativeSpecies); 315 } 316 317 318/** 319 * Sets the value of the 'transitionEffect' attribute of this {@link Input}. 320 <p> 321 * @param transitionEffect String value of the 'transitionEffect' attribute to be set 322 <p> 323 * @return integer value indicating success/failure of the 324 * operation. The possible return values are: 325 * <ul> 326 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 327 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 328 * </ul> 329 */ public 330 int setTransitionEffect(int transitionEffect) { 331 return libsbmlJNI.Input_setTransitionEffect(swigCPtr, this, transitionEffect); 332 } 333 334 335/** 336 * Sets the value of the 'name' attribute of this {@link Input}. 337 <p> 338 * @param name String value of the 'name' attribute to be set 339 <p> 340 * @return integer value indicating success/failure of the 341 * operation. The possible return values are: 342 * <ul> 343 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 344 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 345 * </ul> 346 */ public 347 int setName(String name) { 348 return libsbmlJNI.Input_setName(swigCPtr, this, name); 349 } 350 351 352/** 353 * Sets the value of the 'sign' attribute of this {@link Input}. 354 <p> 355 * @param sign String value of the 'sign' attribute to be set 356 <p> 357 * @return integer value indicating success/failure of the 358 * operation. The possible return values are: 359 * <ul> 360 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 361 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 362 * </ul> 363 */ public 364 int setSign(int sign) { 365 return libsbmlJNI.Input_setSign(swigCPtr, this, sign); 366 } 367 368 369/** 370 * Sets the value of the 'thresholdLevel' attribute of this {@link Input}. 371 <p> 372 * @param thresholdLevel int value of the 'thresholdLevel' attribute to be set 373 <p> 374 * @return integer value indicating success/failure of the 375 * operation. The possible return values are: 376 * <ul> 377 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 378 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 379 * </ul> 380 */ public 381 int setThresholdLevel(int thresholdLevel) { 382 return libsbmlJNI.Input_setThresholdLevel(swigCPtr, this, thresholdLevel); 383 } 384 385 386/** 387 * Unsets the value of the 'id' attribute of this {@link Input}. 388 <p> 389 * @return integer value indicating success/failure of the 390 * operation. The possible return values are: 391 * <ul> 392 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 393 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 394 * </ul> 395 */ public 396 int unsetId() { 397 return libsbmlJNI.Input_unsetId(swigCPtr, this); 398 } 399 400 401/** 402 * Unsets the value of the 'qualitativeSpecies' attribute of this {@link Input}. 403 <p> 404 * @return integer value indicating success/failure of the 405 * operation. The possible return values are: 406 * <ul> 407 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 408 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 409 * </ul> 410 */ public 411 int unsetQualitativeSpecies() { 412 return libsbmlJNI.Input_unsetQualitativeSpecies(swigCPtr, this); 413 } 414 415 416/** 417 * Unsets the value of the 'transitionEffect' attribute of this {@link Input}. 418 <p> 419 * @return integer value indicating success/failure of the 420 * operation. The possible return values are: 421 * <ul> 422 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 423 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 424 * </ul> 425 */ public 426 int unsetTransitionEffect() { 427 return libsbmlJNI.Input_unsetTransitionEffect(swigCPtr, this); 428 } 429 430 431/** 432 * Unsets the value of the 'name' attribute of this {@link Input}. 433 <p> 434 * @return integer value indicating success/failure of the 435 * operation. The possible return values are: 436 * <ul> 437 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 438 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 439 * </ul> 440 */ public 441 int unsetName() { 442 return libsbmlJNI.Input_unsetName(swigCPtr, this); 443 } 444 445 446/** 447 * Unsets the value of the 'sign' attribute of this {@link Input}. 448 <p> 449 * @return integer value indicating success/failure of the 450 * operation. The possible return values are: 451 * <ul> 452 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 453 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 454 * </ul> 455 */ public 456 int unsetSign() { 457 return libsbmlJNI.Input_unsetSign(swigCPtr, this); 458 } 459 460 461/** 462 * Unsets the value of the 'thresholdLevel' attribute of this {@link Input}. 463 <p> 464 * @return integer value indicating success/failure of the 465 * operation. The possible return values are: 466 * <ul> 467 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 468 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 469 * </ul> 470 */ public 471 int unsetThresholdLevel() { 472 return libsbmlJNI.Input_unsetThresholdLevel(swigCPtr, this); 473 } 474 475 476/** 477 * Renames all the <code>SIdRef</code> attributes on this element, including any 478 * found in MathML content (if such exists). 479 <p> 480 * This method works by looking at all attributes and (if appropriate) 481 * mathematical formulas, comparing the identifiers to the value of @p 482 * oldid. If any matches are found, the matching identifiers are replaced 483 * with <code>newid</code>. The method does <em>not</em> descend into child elements. 484 <p> 485 * @param oldid the old identifier 486 * @param newid the new identifier 487 */ public 488 void renameSIdRefs(String oldid, String newid) { 489 libsbmlJNI.Input_renameSIdRefs(swigCPtr, this, oldid, newid); 490 } 491 492 493/** 494 * Returns the XML element name of this object, which for {@link Input}, is 495 * always <code>'input'.</code> 496 <p> 497 * @return the name of this element, i.e. <code>'input'.</code> 498 */ public 499 String getElementName() { 500 return libsbmlJNI.Input_getElementName(swigCPtr, this); 501 } 502 503 504/** 505 * Returns the libSBML type code of this object instance. 506 <p> 507 * <p> 508 * LibSBML attaches an identifying code to every kind of SBML object. These 509 * are integer constants known as <em>SBML type codes</em>. The names of all 510 * the codes begin with the characters “<code>SBML_</code>”. 511 * In the Java language interface for libSBML, the 512 * type codes are defined as static integer constants in the interface class 513 * {@link libsbmlConstants}. Note that different Level 3 514 * package plug-ins may use overlapping type codes; to identify the package 515 * to which a given object belongs, call the <code>getPackageName()</code> 516 * method on the object. 517 <p> 518 * @return the SBML type code for this object: 519 * {@link libsbmlConstants#SBML_QUAL_INPUT SBML_QUAL_INPUT} 520 <p> 521 * <p> 522 * @warning <span class='warning'>The specific integer values of the possible 523 * type codes may be reused by different Level 3 package plug-ins. 524 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 525 * both getTypeCode() and getPackageName()</strong>.</span> 526 <p> 527 * @see #getElementName() 528 * @see #getPackageName() 529 */ public 530 int getTypeCode() { 531 return libsbmlJNI.Input_getTypeCode(swigCPtr, this); 532 } 533 534 535/** 536 * Predicate returning <code>true</code> if all the required attributes 537 * for this {@link Input} object have been set. 538 <p> 539 * @note The required attributes for a {@link Input} object are: 540 * <ul> 541 * <li> 'qualitativeSpecies' 542 * <li> 'transitionEffect' 543 * 544 * </ul> <p> 545 * @return a boolean value indicating whether all the required 546 * attributes for this object have been defined. 547 */ public 548 boolean hasRequiredAttributes() { 549 return libsbmlJNI.Input_hasRequiredAttributes(swigCPtr, this); 550 } 551 552 553/** 554 * Enables/Disables the given package with this element. 555 * @internal 556 */ public 557 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 558 libsbmlJNI.Input_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 559 } 560 561}