001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.8 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-fbc"><a href="group__fbc.html">fbc</a></span> 013 {@link Association} between gene products and reactions 014 <p> 015 * In Version 2 of the SBML Level 3 Flux Balance Constraints 016 * (“fbc”) package specification, {@link GeneProductAssociation} is a 017 * class derived from {@link SBase} used to associate one more genes or gene products 018 * with reactions. {@link GeneProductAssociation} objects are essentially 019 * containers, with one such container optionally attached as a subelement to 020 * a {@link Reaction} object in a model. The container can contain one of three 021 * kinds of objects, all of which are subclasses of the libSBML parent class 022 * {@link FbcAssociation}. (Note that this class is named <em>Association</em> in 023 * the “fbc” Version 2 specification, but in libSBML is 024 * named {@link FbcAssociation} to avoid a name conflict with an existing class.) 025 <p> 026 * One of the kinds of {@link FbcAssociation} subclasses that can appear in a 027 * {@link GeneProductAssociation} is {@link GeneProductRef}. This class of objects 028 * references a {@link GeneProduct} declared in a {@link ListOfGeneProducts} attached to the 029 * enclosing {@link Model} object. In the “fbc” approach, when more than 030 * one gene (or gene product) is present in an association, they are written 031 * as logical expressions using Boolean logical operators <em>and</em> and 032 * <em>or</em> through the classes (in libSBML) {@link FbcAnd} and {@link FbcOr}. (In the 033 * “fbc” Version 2 specification, these are simply named 034 * <em>And</em> and <em>Or</em>, respectively.) The {@link FbcAnd} and {@link FbcOr} objects 035 * in turn can contain either {@link GeneProductRef} objects or other {@link FbcAnd} and/or 036 * {@link FbcOr} objects. 037 <p> 038 * Here is a concrete example of what the XML representation of a simple 039 * <em>or</em> relationship might look like: 040<pre class='fragment'> 041<reaction id = 'R_ABTA' <span class='regular-text' style='font-weight: normal; font-style: italic; background-color: #ffd; padding-left: 2px; padding-right: 2px'>... rest of {@link Reaction} declaration elided for this example ...</span>> 042 <fbc:geneProductAssociation fbc:id='ga_16'> 043 <fbc:or> 044 <fbc:geneProductRef fbc:geneProduct='g_b2662'/> 045 <fbc:geneProductRef fbc:geneProduct='g_b1302'/> 046 </fbc:or> 047 </fbc:geneProductAssociationgt; 048</reaction> 049</pre> 050 <p> 051 * <p> 052 * @note This class of objects was introduced in Version 2 of the 053 * SBML Level 3 Flux Balance Constraints (“fbc”) 054 * specification. In Version 1 of “fbc”, the information 055 * encoded by this class can be stored instead using the {@link Association} and 056 * {@link GeneAssociation} annotation classes. Please see the Version 1 and 057 * Version 2 “fbc” specifications for more details. 058 */ 059 060public class GeneProductAssociation extends SBase { 061 private long swigCPtr; 062 063 protected GeneProductAssociation(long cPtr, boolean cMemoryOwn) 064 { 065 super(libsbmlJNI.GeneProductAssociation_SWIGUpcast(cPtr), cMemoryOwn); 066 swigCPtr = cPtr; 067 } 068 069 protected static long getCPtr(GeneProductAssociation obj) 070 { 071 return (obj == null) ? 0 : obj.swigCPtr; 072 } 073 074 protected static long getCPtrAndDisown (GeneProductAssociation obj) 075 { 076 long ptr = 0; 077 078 if (obj != null) 079 { 080 ptr = obj.swigCPtr; 081 obj.swigCMemOwn = false; 082 } 083 084 return ptr; 085 } 086 087 protected void finalize() { 088 delete(); 089 } 090 091 public synchronized void delete() { 092 if (swigCPtr != 0) { 093 if (swigCMemOwn) { 094 swigCMemOwn = false; 095 libsbmlJNI.delete_GeneProductAssociation(swigCPtr); 096 } 097 swigCPtr = 0; 098 } 099 super.delete(); 100 } 101 102 103/** 104 * Creates a new {@link GeneProductAssociation} with the given SBML Level, Version, and 105 * “fbc” package version. 106 <p> 107 * @param level a long integer, the SBML Level to assign to this 108 * {@link GeneProductAssociation} 109 <p> 110 * @param version a long integer, the SBML Version to assign to this 111 * {@link GeneProductAssociation} 112 <p> 113 * @param pkgVersion a long integer, the SBML “fbc” Version to 114 * assign to this {@link GeneProductAssociation} object 115 */ public 116 GeneProductAssociation(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 117 this(libsbmlJNI.new_GeneProductAssociation__SWIG_0(level, version, pkgVersion), true); 118 } 119 120 121/** 122 * Creates a new {@link GeneProductAssociation} with the given SBML Level, Version, and 123 * “fbc” package version. 124 <p> 125 * @param level a long integer, the SBML Level to assign to this 126 * {@link GeneProductAssociation} 127 <p> 128 * @param version a long integer, the SBML Version to assign to this 129 * {@link GeneProductAssociation} 130 <p> 131 * @param pkgVersion a long integer, the SBML “fbc” Version to 132 * assign to this {@link GeneProductAssociation} object 133 */ public 134 GeneProductAssociation(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 135 this(libsbmlJNI.new_GeneProductAssociation__SWIG_1(level, version), true); 136 } 137 138 139/** 140 * Creates a new {@link GeneProductAssociation} with the given SBML Level, Version, and 141 * “fbc” package version. 142 <p> 143 * @param level a long integer, the SBML Level to assign to this 144 * {@link GeneProductAssociation} 145 <p> 146 * @param version a long integer, the SBML Version to assign to this 147 * {@link GeneProductAssociation} 148 <p> 149 * @param pkgVersion a long integer, the SBML “fbc” Version to 150 * assign to this {@link GeneProductAssociation} object 151 */ public 152 GeneProductAssociation(long level) throws org.sbml.libsbml.SBMLConstructorException { 153 this(libsbmlJNI.new_GeneProductAssociation__SWIG_2(level), true); 154 } 155 156 157/** 158 * Creates a new {@link GeneProductAssociation} with the given SBML Level, Version, and 159 * “fbc” package version. 160 <p> 161 * @param level a long integer, the SBML Level to assign to this 162 * {@link GeneProductAssociation} 163 <p> 164 * @param version a long integer, the SBML Version to assign to this 165 * {@link GeneProductAssociation} 166 <p> 167 * @param pkgVersion a long integer, the SBML “fbc” Version to 168 * assign to this {@link GeneProductAssociation} object 169 */ public 170 GeneProductAssociation() throws org.sbml.libsbml.SBMLConstructorException { 171 this(libsbmlJNI.new_GeneProductAssociation__SWIG_3(), true); 172 } 173 174 175/** 176 * Creates a new {@link GeneProductAssociation} with the given {@link FbcPkgNamespaces} 177 * object. 178 <p> 179 * @param fbcns the {@link FbcPkgNamespaces} object 180 */ public 181 GeneProductAssociation(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException { 182 this(libsbmlJNI.new_GeneProductAssociation__SWIG_4(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 183 } 184 185 186/** 187 * Copy constructor for {@link GeneProductAssociation}. 188 <p> 189 * @param orig; the {@link GeneProductAssociation} instance to copy. 190 */ public 191 GeneProductAssociation(GeneProductAssociation orig) throws org.sbml.libsbml.SBMLConstructorException { 192 this(libsbmlJNI.new_GeneProductAssociation__SWIG_5(GeneProductAssociation.getCPtr(orig), orig), true); 193 } 194 195 196/** 197 * Creates and returns a deep copy of this {@link GeneProductAssociation} object. 198 <p> 199 * @return a (deep) copy of this {@link GeneProductAssociation} object. 200 */ public 201 GeneProductAssociation cloneObject() { 202 long cPtr = libsbmlJNI.GeneProductAssociation_cloneObject(swigCPtr, this); 203 return (cPtr == 0) ? null : new GeneProductAssociation(cPtr, true); 204 } 205 206 207/** 208 * Returns the value of the 'id' attribute of this {@link GeneProductAssociation}. 209 <p> 210 * @return the value of the 'id' attribute of this {@link GeneProductAssociation} 211 * as a string. 212 */ public 213 String getId() { 214 return libsbmlJNI.GeneProductAssociation_getId(swigCPtr, this); 215 } 216 217 218/** 219 * Returns the value of the 'name' attribute of this {@link GeneProductAssociation}. 220 <p> 221 * @return the value of the 'name' attribute of this {@link GeneProductAssociation} 222 * as a string. 223 */ public 224 String getName() { 225 return libsbmlJNI.GeneProductAssociation_getName(swigCPtr, this); 226 } 227 228 229/** 230 * Returns the 'association' element of this {@link GeneProductAssociation}. 231 <p> 232 * @return the 'association' element of this {@link GeneProductAssociation}. 233 */ public 234 FbcAssociation getAssociation() { 235 return (FbcAssociation) libsbml.DowncastSBase(libsbmlJNI.GeneProductAssociation_getAssociation__SWIG_0(swigCPtr, this), false); 236} 237 238 239/** 240 * Creates a new 'association' and sets it for this {@link GeneProductAssociation}. 241 <p> 242 * @return the 243 */ public 244 FbcAnd createAnd() { 245 long cPtr = libsbmlJNI.GeneProductAssociation_createAnd(swigCPtr, this); 246 return (cPtr == 0) ? null : new FbcAnd(cPtr, false); 247 } 248 249 250/** 251 * Creates a new 'association' and sets it for this {@link GeneProductAssociation}. 252 */ public 253 FbcOr createOr() { 254 long cPtr = libsbmlJNI.GeneProductAssociation_createOr(swigCPtr, this); 255 return (cPtr == 0) ? null : new FbcOr(cPtr, false); 256 } 257 258 259/** 260 * Creates a new 'association' and sets it for this {@link GeneProductAssociation}. 261 */ public 262 GeneProductRef createGeneProductRef() { 263 long cPtr = libsbmlJNI.GeneProductAssociation_createGeneProductRef(swigCPtr, this); 264 return (cPtr == 0) ? null : new GeneProductRef(cPtr, false); 265 } 266 267 268/** 269 * Predicate returning <code>true</code> if this {@link GeneProductAssociation}'s 'id' 270 * attribute is set. 271 <p> 272 * @return <code>true</code> if this {@link GeneProductAssociation}'s 'id' attribute has been set, 273 * otherwise <code>false</code> is returned. 274 */ public 275 boolean isSetId() { 276 return libsbmlJNI.GeneProductAssociation_isSetId(swigCPtr, this); 277 } 278 279 280/** 281 * Predicate returning <code>true</code> if this {@link GeneProductAssociation}'s 'name' 282 * attribute is set. 283 <p> 284 * @return <code>true</code> if this {@link GeneProductAssociation}'s 'name' attribute has been set, 285 * otherwise <code>false</code> is returned. 286 */ public 287 boolean isSetName() { 288 return libsbmlJNI.GeneProductAssociation_isSetName(swigCPtr, this); 289 } 290 291 292/** 293 * Predicate returning <code>true</code> if this {@link GeneProductAssociation}'s 294 * 'association' element is set. 295 <p> 296 * @return <code>true</code> if this {@link GeneProductAssociation}'s 'association' element has been set, 297 * otherwise <code>false</code> is returned. 298 */ public 299 boolean isSetAssociation() { 300 return libsbmlJNI.GeneProductAssociation_isSetAssociation(swigCPtr, this); 301 } 302 303 304/** 305 * Sets the value of the 'id' attribute of this {@link GeneProductAssociation}. 306 <p> 307 * @param id; String value of the 'id' attribute to be set 308 <p> 309 * @return integer value indicating success/failure of the 310 * function. The possible values 311 * returned by this function are: 312 * <ul> 313 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 314 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 315 * </ul> 316 */ public 317 int setId(String id) { 318 return libsbmlJNI.GeneProductAssociation_setId(swigCPtr, this, id); 319 } 320 321 322/** 323 * Sets the value of the 'name' attribute of this {@link GeneProductAssociation}. 324 <p> 325 * @param name; String value of the 'name' attribute to be set 326 <p> 327 * @return integer value indicating success/failure of the 328 * function. The possible values 329 * returned by this function are: 330 * <ul> 331 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 332 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 333 * </ul> 334 */ public 335 int setName(String name) { 336 return libsbmlJNI.GeneProductAssociation_setName(swigCPtr, this, name); 337 } 338 339 340/** 341 * Sets the 'association' element of this {@link GeneProductAssociation}. 342 <p> 343 * @param association; {@link FbcAssociation} to be set. 344 <p> 345 * @return integer value indicating success/failure of the 346 * function. The possible values 347 * returned by this function are: 348 * <ul> 349 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 350 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 351 * </ul> 352 */ public 353 int setAssociation(FbcAssociation association) { 354 return libsbmlJNI.GeneProductAssociation_setAssociation__SWIG_0(swigCPtr, this, FbcAssociation.getCPtr(association), association); 355 } 356 357 358/** 359 * Sets the 'association' element of this {@link GeneProductAssociation}. 360 <p> 361 * @param association; string representation of the association to be set 362 <p> 363 * @return integer value indicating success/failure of the 364 * function. The possible values 365 * returned by this function are: 366 * <ul> 367 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 368 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 369 * </ul> 370 */ public 371 int setAssociation(String association) { 372 return libsbmlJNI.GeneProductAssociation_setAssociation__SWIG_1(swigCPtr, this, association); 373 } 374 375 376/** 377 * Unsets the value of the 'id' attribute of this {@link GeneProductAssociation}. 378 <p> 379 * @return integer value indicating success/failure of the 380 * function. The possible values 381 * returned by this function are: 382 * <ul> 383 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 384 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 385 * </ul> 386 */ public 387 int unsetId() { 388 return libsbmlJNI.GeneProductAssociation_unsetId(swigCPtr, this); 389 } 390 391 392/** 393 * Unsets the value of the 'name' attribute of this {@link GeneProductAssociation}. 394 <p> 395 * @return integer value indicating success/failure of the 396 * function. The possible values 397 * returned by this function are: 398 * <ul> 399 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 400 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 401 * </ul> 402 */ public 403 int unsetName() { 404 return libsbmlJNI.GeneProductAssociation_unsetName(swigCPtr, this); 405 } 406 407 408/** 409 * Unsets the 'association' element of this {@link GeneProductAssociation}. 410 <p> 411 * @return integer value indicating success/failure of the 412 * function. The possible values 413 * returned by this function are: 414 * <ul> 415 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 416 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 417 * </ul> 418 */ public 419 int unsetAssociation() { 420 return libsbmlJNI.GeneProductAssociation_unsetAssociation(swigCPtr, this); 421 } 422 423 424/** 425 * Returns the XML element name of this object. 426 <p> 427 * For {@link GeneProductAssociation}, the XML element name is always <code>'geneProductAssociation'.</code> 428 <p> 429 * @return the name of this element, i.e. <code>'geneProductAssociation'.</code> 430 */ public 431 String getElementName() { 432 return libsbmlJNI.GeneProductAssociation_getElementName(swigCPtr, this); 433 } 434 435 436/** 437 * Returns the libSBML type code for this SBML object. 438 <p> 439 * <p> 440 * LibSBML attaches an identifying code to every kind of SBML object. These 441 * are integer constants known as <em>SBML type codes</em>. The names of all 442 * the codes begin with the characters <code>SBML_</code>. 443 * In the Java language interface for libSBML, the 444 * type codes are defined as static integer constants in the interface class 445 * {@link libsbmlConstants}. Note that different Level 3 446 * package plug-ins may use overlapping type codes; to identify the package 447 * to which a given object belongs, call the <code>getPackageName()</code> 448 * method on the object. 449 <p> 450 * @return the SBML type code for this object: 451 * {@link libsbmlConstants#SBML_FBC_GENEPRODUCTASSOCIATION SBML_FBC_GENEPRODUCTASSOCIATION} (default). 452 <p> 453 * <p> 454 * @warning <span class='warning'>The specific integer values of the possible 455 * type codes may be reused by different Level 3 package plug-ins. 456 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 457 * both getTypeCode() and getPackageName()</strong>.</span> 458 <p> 459 * @see #getElementName() 460 * @see #getPackageName() 461 */ public 462 int getTypeCode() { 463 return libsbmlJNI.GeneProductAssociation_getTypeCode(swigCPtr, this); 464 } 465 466 467/** 468 * Predicate returning <code>true</code> if all the required attributes for this 469 * {@link GeneProductAssociation} object have been set. 470 <p> 471 * @note The required attributes for a {@link GeneProductAssociation} object are: 472 * <ul> 473 * <li> 'association' 474 * 475 * </ul> <p> 476 * @return a boolean value indicating whether all the required 477 * attributes for this object have been defined. 478 */ public 479 boolean hasRequiredAttributes() { 480 return libsbmlJNI.GeneProductAssociation_hasRequiredAttributes(swigCPtr, this); 481 } 482 483 484/** 485 * Predicate returning <code>true</code> if all the required elements for this 486 * {@link GeneProductAssociation} object have been set. 487 <p> 488 * @note The required elements for a {@link GeneProductAssociation} object are: 489 * <ul> 490 * <li> 'association' 491 * 492 * </ul> <p> 493 * @return a boolean value indicating whether all the required 494 * elements for this object have been defined. 495 */ public 496 boolean hasRequiredElements() { 497 return libsbmlJNI.GeneProductAssociation_hasRequiredElements(swigCPtr, this); 498 } 499 500 501/** * @internal */ public 502 void connectToChild() { 503 libsbmlJNI.GeneProductAssociation_connectToChild(swigCPtr, this); 504 } 505 506 507/** * @internal */ public 508 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 509 libsbmlJNI.GeneProductAssociation_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 510 } 511 512}