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 * <span class="pkg-marker pkg-color-fbc"><a href="group__fbc.html">fbc</a></span> 013 {@link Association} of a gene product with a {@link Reaction} 014 <p> 015 * In the SBML Level 3 <a href='../../../extensions-summary.html#fbc'>Flux Balance Constraints</a> (“fbc”) package 016 * representation format, a {@link GeneProduct} object represents a single gene or 017 * implied gene product. The gene or gene product is identified using the 018 * required attribute 'label', which is a text string. (This attribute is 019 * separate from the usual SBML 'id' attribute, which is used to 020 * cross-reference entities within an SBML model.) A {@link GeneProduct} object can 021 * also possess an optional 'associatedSpecies' attribute; if this a 022 * attribute is defined, it should have a value of type <code>SIdRef</code> 023 * and be the identifier of a {@link Species} object defined in the enclosing {@link Model}. 024 * An 'associatedSpecies', if it exists, is interpreted to be a species 025 * associated with the gene or gene product that is represented by the 026 * {@link GeneProduct} object. 027 <p> 028 * <p> 029 * @note This class of objects was introduced in Version 2 of the 030 * SBML Level 3 Flux Balance Constraints (“fbc”) 031 * specification. In Version 1 of “fbc”, the information 032 * encoded by this class can be stored instead using the {@link Association} and 033 * {@link GeneAssociation} annotation classes. Please see the Version 1 and 034 * Version 2 “fbc” specifications for more details. 035 */ 036 037public class GeneProduct extends SBase { 038 private long swigCPtr; 039 040 protected GeneProduct(long cPtr, boolean cMemoryOwn) 041 { 042 super(libsbmlJNI.GeneProduct_SWIGUpcast(cPtr), cMemoryOwn); 043 swigCPtr = cPtr; 044 } 045 046 protected static long getCPtr(GeneProduct obj) 047 { 048 return (obj == null) ? 0 : obj.swigCPtr; 049 } 050 051 protected static long getCPtrAndDisown (GeneProduct obj) 052 { 053 long ptr = 0; 054 055 if (obj != null) 056 { 057 ptr = obj.swigCPtr; 058 obj.swigCMemOwn = false; 059 } 060 061 return ptr; 062 } 063 064 protected void finalize() { 065 delete(); 066 } 067 068 public synchronized void delete() { 069 if (swigCPtr != 0) { 070 if (swigCMemOwn) { 071 swigCMemOwn = false; 072 libsbmlJNI.delete_GeneProduct(swigCPtr); 073 } 074 swigCPtr = 0; 075 } 076 super.delete(); 077 } 078 079 080/** 081 * Creates a new {@link GeneProduct} with the given SBML Level, Version, and 082 * “fbc”package version. 083 <p> 084 * @param level a long integer, the SBML Level to assign to this {@link GeneProduct} 085 <p> 086 * @param version a long integer, the SBML Version to assign to this {@link GeneProduct} 087 <p> 088 * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link GeneProduct} 089 */ public 090 GeneProduct(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 091 this(libsbmlJNI.new_GeneProduct__SWIG_0(level, version, pkgVersion), true); 092 } 093 094 095/** 096 * Creates a new {@link GeneProduct} with the given SBML Level, Version, and 097 * “fbc”package version. 098 <p> 099 * @param level a long integer, the SBML Level to assign to this {@link GeneProduct} 100 <p> 101 * @param version a long integer, the SBML Version to assign to this {@link GeneProduct} 102 <p> 103 * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link GeneProduct} 104 */ public 105 GeneProduct(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 106 this(libsbmlJNI.new_GeneProduct__SWIG_1(level, version), true); 107 } 108 109 110/** 111 * Creates a new {@link GeneProduct} with the given SBML Level, Version, and 112 * “fbc”package version. 113 <p> 114 * @param level a long integer, the SBML Level to assign to this {@link GeneProduct} 115 <p> 116 * @param version a long integer, the SBML Version to assign to this {@link GeneProduct} 117 <p> 118 * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link GeneProduct} 119 */ public 120 GeneProduct(long level) throws org.sbml.libsbml.SBMLConstructorException { 121 this(libsbmlJNI.new_GeneProduct__SWIG_2(level), true); 122 } 123 124 125/** 126 * Creates a new {@link GeneProduct} with the given SBML Level, Version, and 127 * “fbc”package version. 128 <p> 129 * @param level a long integer, the SBML Level to assign to this {@link GeneProduct} 130 <p> 131 * @param version a long integer, the SBML Version to assign to this {@link GeneProduct} 132 <p> 133 * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link GeneProduct} 134 */ public 135 GeneProduct() throws org.sbml.libsbml.SBMLConstructorException { 136 this(libsbmlJNI.new_GeneProduct__SWIG_3(), true); 137 } 138 139 140/** 141 * Creates a new {@link GeneProduct} with the given {@link FbcPkgNamespaces} object. 142 <p> 143 * @param fbcns the {@link FbcPkgNamespaces} object 144 */ public 145 GeneProduct(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException { 146 this(libsbmlJNI.new_GeneProduct__SWIG_4(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 147 } 148 149 150/** 151 * Copy constructor for {@link GeneProduct}. 152 <p> 153 * @param orig; the {@link GeneProduct} instance to copy. 154 */ public 155 GeneProduct(GeneProduct orig) throws org.sbml.libsbml.SBMLConstructorException { 156 this(libsbmlJNI.new_GeneProduct__SWIG_5(GeneProduct.getCPtr(orig), orig), true); 157 } 158 159 160/** 161 * Creates and returns a deep copy of this {@link GeneProduct} object. 162 <p> 163 * @return a (deep) copy of this {@link GeneProduct} object. 164 */ public 165 GeneProduct cloneObject() { 166 long cPtr = libsbmlJNI.GeneProduct_cloneObject(swigCPtr, this); 167 return (cPtr == 0) ? null : new GeneProduct(cPtr, true); 168 } 169 170 171/** 172 * Returns the value of the 'id' attribute of this {@link GeneProduct}. 173 <p> 174 * @return the value of the 'id' attribute of this {@link GeneProduct} as a string. 175 */ public 176 String getId() { 177 return libsbmlJNI.GeneProduct_getId(swigCPtr, this); 178 } 179 180 181/** 182 * Returns the value of the 'name' attribute of this {@link GeneProduct}. 183 <p> 184 * @return the value of the 'name' attribute of this {@link GeneProduct} as a string. 185 */ public 186 String getName() { 187 return libsbmlJNI.GeneProduct_getName(swigCPtr, this); 188 } 189 190 191/** 192 * Returns the value of the 'label' attribute of this {@link GeneProduct}. 193 <p> 194 * @return the value of the 'label' attribute of this {@link GeneProduct} as a 195 * string. 196 */ public 197 String getLabel() { 198 return libsbmlJNI.GeneProduct_getLabel(swigCPtr, this); 199 } 200 201 202/** 203 * Returns the value of the 'associatedSpecies' attribute of this 204 * {@link GeneProduct}. 205 <p> 206 * @return the value of the 'associatedSpecies' attribute of this 207 * {@link GeneProduct} as a string. 208 */ public 209 String getAssociatedSpecies() { 210 return libsbmlJNI.GeneProduct_getAssociatedSpecies(swigCPtr, this); 211 } 212 213 214/** 215 * Predicate returning <code>true</code> if this {@link GeneProduct}'s 'id' attribute is set. 216 <p> 217 * @return <code>true</code> if this {@link GeneProduct}'s 'id' attribute has been set, 218 * otherwise <code>false</code> is returned. 219 */ public 220 boolean isSetId() { 221 return libsbmlJNI.GeneProduct_isSetId(swigCPtr, this); 222 } 223 224 225/** 226 * Predicate returning <code>true</code> if this {@link GeneProduct}'s 'name' attribute is 227 * set. 228 <p> 229 * @return <code>true</code> if this {@link GeneProduct}'s 'name' attribute has been set, 230 * otherwise <code>false</code> is returned. 231 */ public 232 boolean isSetName() { 233 return libsbmlJNI.GeneProduct_isSetName(swigCPtr, this); 234 } 235 236 237/** 238 * Predicate returning <code>true</code> if this {@link GeneProduct}'s 'label' attribute is 239 * set. 240 <p> 241 * @return <code>true</code> if this {@link GeneProduct}'s 'label' attribute has been set, 242 * otherwise <code>false</code> is returned. 243 */ public 244 boolean isSetLabel() { 245 return libsbmlJNI.GeneProduct_isSetLabel(swigCPtr, this); 246 } 247 248 249/** 250 * Predicate returning <code>true</code> if this {@link GeneProduct}'s 'associatedSpecies' 251 * attribute is set. 252 <p> 253 * @return <code>true</code> if this {@link GeneProduct}'s 'associatedSpecies' attribute has 254 * been set, otherwise <code>false</code> is returned. 255 */ public 256 boolean isSetAssociatedSpecies() { 257 return libsbmlJNI.GeneProduct_isSetAssociatedSpecies(swigCPtr, this); 258 } 259 260 261/** 262 * Sets the value of the 'id' attribute of this {@link GeneProduct}. 263 <p> 264 * @param id; String value of the 'id' attribute to be set 265 <p> 266 * @return integer value indicating success/failure of the 267 * function. The possible values 268 * returned by this function are: 269 * <ul> 270 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 271 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 272 * </ul> 273 */ public 274 int setId(String id) { 275 return libsbmlJNI.GeneProduct_setId(swigCPtr, this, id); 276 } 277 278 279/** 280 * Sets the value of the 'name' attribute of this {@link GeneProduct}. 281 <p> 282 * @param name; String value of the 'name' attribute to be set 283 <p> 284 * @return integer value indicating success/failure of the 285 * function. The possible values 286 * returned by this function are: 287 * <ul> 288 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 289 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 290 * </ul> 291 */ public 292 int setName(String name) { 293 return libsbmlJNI.GeneProduct_setName(swigCPtr, this, name); 294 } 295 296 297/** 298 * Sets the value of the 'label' attribute of this {@link GeneProduct}. 299 <p> 300 * @param label; String value of the 'label' attribute to be 301 * set 302 <p> 303 * @return integer value indicating success/failure of the 304 * function. The possible values 305 * returned by this function are: 306 * <ul> 307 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 308 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 309 * </ul> 310 */ public 311 int setLabel(String label) { 312 return libsbmlJNI.GeneProduct_setLabel(swigCPtr, this, label); 313 } 314 315 316/** 317 * Sets the value of the 'associatedSpecies' attribute of this {@link GeneProduct}. 318 <p> 319 * @param associatedSpecies; String value of the 320 * 'associatedSpecies' attribute to be set 321 <p> 322 * @return integer value indicating success/failure of the 323 * function. The possible values 324 * returned by this function 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 setAssociatedSpecies(String associatedSpecies) { 331 return libsbmlJNI.GeneProduct_setAssociatedSpecies(swigCPtr, this, associatedSpecies); 332 } 333 334 335/** 336 * Unsets the value of the 'id' attribute of this {@link GeneProduct}. 337 <p> 338 * @return integer value indicating success/failure of the 339 * function. The possible values 340 * returned by this function are: 341 * <ul> 342 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 343 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 344 * </ul> 345 */ public 346 int unsetId() { 347 return libsbmlJNI.GeneProduct_unsetId(swigCPtr, this); 348 } 349 350 351/** 352 * Unsets the value of the 'name' attribute of this {@link GeneProduct}. 353 <p> 354 * @return integer value indicating success/failure of the 355 * function. The possible values 356 * returned by this function are: 357 * <ul> 358 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 359 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 360 * </ul> 361 */ public 362 int unsetName() { 363 return libsbmlJNI.GeneProduct_unsetName(swigCPtr, this); 364 } 365 366 367/** 368 * Unsets the value of the 'label' attribute of this {@link GeneProduct}. 369 <p> 370 * @return integer value indicating success/failure of the 371 * function. The possible values 372 * returned by this function are: 373 * <ul> 374 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 375 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 376 * </ul> 377 */ public 378 int unsetLabel() { 379 return libsbmlJNI.GeneProduct_unsetLabel(swigCPtr, this); 380 } 381 382 383/** 384 * Unsets the value of the 'associatedSpecies' attribute of this 385 * {@link GeneProduct}. 386 <p> 387 * @return integer value indicating success/failure of the 388 * function. The possible values 389 * returned by this function are: 390 * <ul> 391 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 392 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 393 * </ul> 394 */ public 395 int unsetAssociatedSpecies() { 396 return libsbmlJNI.GeneProduct_unsetAssociatedSpecies(swigCPtr, this); 397 } 398 399 400/** 401 * <p> 402 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 403 * value. 404 <p> 405 * <p> 406 * In SBML, object identifiers are of a data type called <code>SId</code>. 407 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 408 * introduced for attribute values that refer to <code>SId</code> values; in 409 * previous Levels of SBML, this data type did not exist and attributes were 410 * simply described to as 'referring to an identifier', but the effective 411 * data type was the same as <code>SIdRef</code>in Level 3. These and 412 * other methods of libSBML refer to the type <code>SIdRef</code> for all 413 * Levels of SBML, even if the corresponding SBML specification did not 414 * explicitly name the data type. 415 <p> 416 * This method works by looking at all attributes and (if appropriate) 417 * mathematical formulas in MathML content, comparing the referenced 418 * identifiers to the value of <code>oldid</code>. If any matches are found, the 419 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 420 * descend into child elements. 421 <p> 422 * @param oldid the old identifier 423 * @param newid the new identifier 424 */ public 425 void renameSIdRefs(String oldid, String newid) { 426 libsbmlJNI.GeneProduct_renameSIdRefs(swigCPtr, this, oldid, newid); 427 } 428 429 430/** 431 * Returns the XML element name of this object. 432 <p> 433 * For {@link GeneProduct}, the XML element name is always <code>'geneProduct'.</code> 434 <p> 435 * @return the name of this element, i.e. <code>'geneProduct'.</code> 436 */ public 437 String getElementName() { 438 return libsbmlJNI.GeneProduct_getElementName(swigCPtr, this); 439 } 440 441 442/** 443 * Returns the libSBML type code for this SBML object. 444 <p> 445 * <p> 446 * LibSBML attaches an identifying code to every kind of SBML object. These 447 * are integer constants known as <em>SBML type codes</em>. The names of all 448 * the codes begin with the characters <code>SBML_</code>. 449 * In the Java language interface for libSBML, the 450 * type codes are defined as static integer constants in the interface class 451 * {@link libsbmlConstants}. Note that different Level 3 452 * package plug-ins may use overlapping type codes; to identify the package 453 * to which a given object belongs, call the <code>getPackageName()</code> 454 * method on the object. 455 <p> 456 * @return the SBML type code for this object: 457 * {@link libsbmlConstants#SBML_FBC_GENEPRODUCT SBML_FBC_GENEPRODUCT} (default). 458 <p> 459 * <p> 460 * @warning <span class='warning'>The specific integer values of the possible 461 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 462 * packages, To fully identify the correct code, <strong>it is necessary to 463 * invoke both getTypeCode() and getPackageName()</strong>.</span> 464 <p> 465 * @see #getElementName() 466 * @see #getPackageName() 467 */ public 468 int getTypeCode() { 469 return libsbmlJNI.GeneProduct_getTypeCode(swigCPtr, this); 470 } 471 472 473/** 474 * Predicate returning <code>true</code> if all the required attributes 475 * for this {@link GeneProduct} object have been set. 476 <p> 477 * @note The required attributes for a {@link GeneProduct} object are: 478 * <ul> 479 * <li> 'id' 480 * <li> 'label' 481 * 482 * </ul> <p> 483 * @return a boolean value indicating whether all the required 484 * attributes for this object have been defined. 485 */ public 486 boolean hasRequiredAttributes() { 487 return libsbmlJNI.GeneProduct_hasRequiredAttributes(swigCPtr, this); 488 } 489 490 491/** * @internal */ public 492 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 493 libsbmlJNI.GeneProduct_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 494 } 495 496}