001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.7 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 Reference to a gene product of a reaction 014 <p> 015 * {@link GeneProductRef} encodes a references to a {@link GeneProduct} object declared in a 016 * {@link ListOfGeneProducts} attached to the enclosing {@link Model} object. {@link GeneProductRef} 017 * is derived from the {@link FbcAssociation} class. 018 <p> 019 * {@link GeneProductRef} objects are used to construct the content of 020 * {@link GeneProductAssociation} objects. As described more fully in the 021 * documentation of the latter, a {@link GeneProductAssociation} is a container that 022 * may contain either (i) a single {@link GeneProductRef} or (ii) a logical 023 * expression built up with {@link FbcAnd} and {@link FbcOr} and ultimately containing two 024 * or more {@link GeneProductRef} objects. 025 <p> 026 * <p> 027 * @note This class of objects was introduced in Version 2 of the 028 * SBML Level 3 Flux Balance Constraints (“fbc”) 029 * specification. In Version 1 of “fbc”, the information 030 * encoded by this class can be stored instead using the {@link Association} and 031 * {@link GeneAssociation} annotation classes. Please see the Version 1 and 032 * Version 2 “fbc” specifications for more details. 033 */ 034 035public class GeneProductRef extends FbcAssociation { 036 private long swigCPtr; 037 038 protected GeneProductRef(long cPtr, boolean cMemoryOwn) 039 { 040 super(libsbmlJNI.GeneProductRef_SWIGUpcast(cPtr), cMemoryOwn); 041 swigCPtr = cPtr; 042 } 043 044 protected static long getCPtr(GeneProductRef obj) 045 { 046 return (obj == null) ? 0 : obj.swigCPtr; 047 } 048 049 protected static long getCPtrAndDisown (GeneProductRef obj) 050 { 051 long ptr = 0; 052 053 if (obj != null) 054 { 055 ptr = obj.swigCPtr; 056 obj.swigCMemOwn = false; 057 } 058 059 return ptr; 060 } 061 062 protected void finalize() { 063 delete(); 064 } 065 066 public synchronized void delete() { 067 if (swigCPtr != 0) { 068 if (swigCMemOwn) { 069 swigCMemOwn = false; 070 libsbmlJNI.delete_GeneProductRef(swigCPtr); 071 } 072 swigCPtr = 0; 073 } 074 super.delete(); 075 } 076 077 078/** 079 * Creates a new {@link GeneProductRef} with the given SBML Level, Version, and 080 * “fbc”package version. 081 <p> 082 * @param level a long integer, the SBML Level to assign to this 083 * {@link GeneProductRef} 084 <p> 085 * @param version a long integer, the SBML Version to assign to this 086 * {@link GeneProductRef} 087 <p> 088 * @param pkgVersion a long integer, the SBML Fbc Version to assign to 089 * this {@link GeneProductRef} 090 */ public 091 GeneProductRef(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 092 this(libsbmlJNI.new_GeneProductRef__SWIG_0(level, version, pkgVersion), true); 093 } 094 095 096/** 097 * Creates a new {@link GeneProductRef} with the given SBML Level, Version, and 098 * “fbc”package version. 099 <p> 100 * @param level a long integer, the SBML Level to assign to this 101 * {@link GeneProductRef} 102 <p> 103 * @param version a long integer, the SBML Version to assign to this 104 * {@link GeneProductRef} 105 <p> 106 * @param pkgVersion a long integer, the SBML Fbc Version to assign to 107 * this {@link GeneProductRef} 108 */ public 109 GeneProductRef(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 110 this(libsbmlJNI.new_GeneProductRef__SWIG_1(level, version), true); 111 } 112 113 114/** 115 * Creates a new {@link GeneProductRef} with the given SBML Level, Version, and 116 * “fbc”package version. 117 <p> 118 * @param level a long integer, the SBML Level to assign to this 119 * {@link GeneProductRef} 120 <p> 121 * @param version a long integer, the SBML Version to assign to this 122 * {@link GeneProductRef} 123 <p> 124 * @param pkgVersion a long integer, the SBML Fbc Version to assign to 125 * this {@link GeneProductRef} 126 */ public 127 GeneProductRef(long level) throws org.sbml.libsbml.SBMLConstructorException { 128 this(libsbmlJNI.new_GeneProductRef__SWIG_2(level), true); 129 } 130 131 132/** 133 * Creates a new {@link GeneProductRef} with the given SBML Level, Version, and 134 * “fbc”package version. 135 <p> 136 * @param level a long integer, the SBML Level to assign to this 137 * {@link GeneProductRef} 138 <p> 139 * @param version a long integer, the SBML Version to assign to this 140 * {@link GeneProductRef} 141 <p> 142 * @param pkgVersion a long integer, the SBML Fbc Version to assign to 143 * this {@link GeneProductRef} 144 */ public 145 GeneProductRef() throws org.sbml.libsbml.SBMLConstructorException { 146 this(libsbmlJNI.new_GeneProductRef__SWIG_3(), true); 147 } 148 149 150/** 151 * Creates a new {@link GeneProductRef} with the given {@link FbcPkgNamespaces} object. 152 <p> 153 * @param fbcns the {@link FbcPkgNamespaces} object 154 */ public 155 GeneProductRef(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException { 156 this(libsbmlJNI.new_GeneProductRef__SWIG_4(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 157 } 158 159 160/** 161 * Copy constructor for {@link GeneProductRef}. 162 <p> 163 * @param orig; the {@link GeneProductRef} instance to copy. 164 */ public 165 GeneProductRef(GeneProductRef orig) throws org.sbml.libsbml.SBMLConstructorException { 166 this(libsbmlJNI.new_GeneProductRef__SWIG_5(GeneProductRef.getCPtr(orig), orig), true); 167 } 168 169 170/** 171 * Creates and returns a deep copy of this {@link GeneProductRef} object. 172 <p> 173 * @return a (deep) copy of this {@link GeneProductRef} object. 174 */ public 175 GeneProductRef cloneObject() { 176 long cPtr = libsbmlJNI.GeneProductRef_cloneObject(swigCPtr, this); 177 return (cPtr == 0) ? null : new GeneProductRef(cPtr, true); 178 } 179 180 181/** 182 * Returns the value of the 'id' attribute of this {@link GeneProductRef}. 183 <p> 184 * @return the value of the 'id' attribute of this {@link GeneProductRef} as a string. 185 */ public 186 String getId() { 187 return libsbmlJNI.GeneProductRef_getId(swigCPtr, this); 188 } 189 190 191/** 192 * Returns the value of the 'geneProduct' attribute of this {@link GeneProductRef}. 193 <p> 194 * @return the value of the 'geneProduct' attribute of this {@link GeneProductRef} as a string. 195 */ public 196 String getGeneProduct() { 197 return libsbmlJNI.GeneProductRef_getGeneProduct(swigCPtr, this); 198 } 199 200 201/** 202 * Converts this {@link FbcAssociation} object into an infix string representation. 203 <p> 204 * @return the association as infix string. 205 */ public 206 String toInfix() { 207 return libsbmlJNI.GeneProductRef_toInfix(swigCPtr, this); 208 } 209 210 211/** 212 * Returns the value of the 'name' attribute of this {@link GeneProductRef}. 213 <p> 214 * @return the value of the 'name' attribute of this {@link GeneProductRef} as a string. 215 */ public 216 String getName() { 217 return libsbmlJNI.GeneProductRef_getName(swigCPtr, this); 218 } 219 220 221/** 222 * Predicate returning <code>true</code> if this {@link GeneProductRef}'s 'id' attribute is 223 * set. 224 <p> 225 * @return <code>true</code> if this {@link GeneProductRef}'s 'id' attribute has been set, 226 * otherwise <code>false</code> is returned. 227 */ public 228 boolean isSetId() { 229 return libsbmlJNI.GeneProductRef_isSetId(swigCPtr, this); 230 } 231 232 233/** 234 * Predicate returning <code>true</code> if this {@link GeneProductRef}'s 'geneProduct' 235 * attribute is set. 236 <p> 237 * @return <code>true</code> if this {@link GeneProductRef}'s 'geneProduct' attribute has been set, 238 * otherwise <code>false</code> is returned. 239 */ public 240 boolean isSetGeneProduct() { 241 return libsbmlJNI.GeneProductRef_isSetGeneProduct(swigCPtr, this); 242 } 243 244 245/** 246 * Predicate returning <code>true</code> if this {@link GeneProductRef}'s 'name' attribute is 247 * set. 248 <p> 249 * @return <code>true</code> if this {@link GeneProductRef}'s 'name' attribute has been set, 250 * otherwise <code>false</code> is returned. 251 */ public 252 boolean isSetName() { 253 return libsbmlJNI.GeneProductRef_isSetName(swigCPtr, this); 254 } 255 256 257/** 258 * Sets the value of the 'id' attribute of this {@link GeneProductRef}. 259 <p> 260 * @param id; String value of the 'id' attribute to be set 261 <p> 262 * @return integer value indicating success/failure of the 263 * function. The possible values 264 * returned by this function are: 265 * <ul> 266 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 267 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 268 * </ul> 269 */ public 270 int setId(String id) { 271 return libsbmlJNI.GeneProductRef_setId(swigCPtr, this, id); 272 } 273 274 275/** 276 * Sets the value of the 'geneProduct' attribute of this {@link GeneProductRef}. 277 <p> 278 * @param geneProduct; String value of the 'geneProduct' attribute to be set 279 <p> 280 * @return integer value indicating success/failure of the 281 * function. The possible values 282 * returned by this function are: 283 * <ul> 284 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 285 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 286 * </ul> 287 */ public 288 int setGeneProduct(String geneProduct) { 289 return libsbmlJNI.GeneProductRef_setGeneProduct(swigCPtr, this, geneProduct); 290 } 291 292 293/** 294 * Sets the value of the 'name' attribute of this {@link GeneProductRef}. 295 <p> 296 * @param name; String value of the 'name' attribute to be set 297 <p> 298 * @return integer value indicating success/failure of the 299 * function. The possible values 300 * returned by this function are: 301 * <ul> 302 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 303 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 304 * </ul> 305 */ public 306 int setName(String name) { 307 return libsbmlJNI.GeneProductRef_setName(swigCPtr, this, name); 308 } 309 310 311/** 312 * Unsets the value of the 'id' attribute of this {@link GeneProductRef}. 313 <p> 314 * @return integer value indicating success/failure of the 315 * function. The possible values 316 * returned by this function are: 317 * <ul> 318 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 319 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 320 * </ul> 321 */ public 322 int unsetId() { 323 return libsbmlJNI.GeneProductRef_unsetId(swigCPtr, this); 324 } 325 326 327/** 328 * Unsets the value of the 'geneProduct' attribute of this {@link GeneProductRef}. 329 <p> 330 * @return integer value indicating success/failure of the 331 * function. The possible values 332 * returned by this function are: 333 * <ul> 334 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 335 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 336 * </ul> 337 */ public 338 int unsetGeneProduct() { 339 return libsbmlJNI.GeneProductRef_unsetGeneProduct(swigCPtr, this); 340 } 341 342 343/** 344 * Unsets the value of the 'name' attribute of this {@link GeneProductRef}. 345 <p> 346 * @return integer value indicating success/failure of the 347 * function. The possible values 348 * returned by this function are: 349 * <ul> 350 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 351 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 352 * </ul> 353 */ public 354 int unsetName() { 355 return libsbmlJNI.GeneProductRef_unsetName(swigCPtr, this); 356 } 357 358 359/** 360 * <p> 361 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 362 * value. 363 <p> 364 * <p> 365 * In SBML, object identifiers are of a data type called <code>SId</code>. 366 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 367 * introduced for attribute values that refer to <code>SId</code> values; in 368 * previous Levels of SBML, this data type did not exist and attributes were 369 * simply described to as 'referring to an identifier', but the effective 370 * data type was the same as <code>SIdRef</code>in Level 3. These and 371 * other methods of libSBML refer to the type <code>SIdRef</code> for all 372 * Levels of SBML, even if the corresponding SBML specification did not 373 * explicitly name the data type. 374 <p> 375 * This method works by looking at all attributes and (if appropriate) 376 * mathematical formulas in MathML content, comparing the referenced 377 * identifiers to the value of <code>oldid</code>. If any matches are found, the 378 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 379 * descend into child elements. 380 <p> 381 * @param oldid the old identifier 382 * @param newid the new identifier 383 */ public 384 void renameSIdRefs(String oldid, String newid) { 385 libsbmlJNI.GeneProductRef_renameSIdRefs(swigCPtr, this, oldid, newid); 386 } 387 388 389/** 390 * Returns the XML element name of this object. 391 <p> 392 * For {@link GeneProductRef}, the XML element name is always <code>'geneProductRef'.</code> 393 <p> 394 * @return the name of this element, i.e. <code>'geneProductRef'.</code> 395 */ public 396 String getElementName() { 397 return libsbmlJNI.GeneProductRef_getElementName(swigCPtr, this); 398 } 399 400 401/** 402 * Returns the libSBML type code for this SBML object. 403 <p> 404 * <p> 405 * LibSBML attaches an identifying code to every kind of SBML object. These 406 * are integer constants known as <em>SBML type codes</em>. The names of all 407 * the codes begin with the characters <code>SBML_</code>. 408 * In the Java language interface for libSBML, the 409 * type codes are defined as static integer constants in the interface class 410 * {@link libsbmlConstants}. Note that different Level 3 411 * package plug-ins may use overlapping type codes; to identify the package 412 * to which a given object belongs, call the <code>getPackageName()</code> 413 * method on the object. 414 <p> 415 * @return the SBML type code for this object: 416 * {@link libsbmlConstants#SBML_FBC_GENEPRODUCTREF SBML_FBC_GENEPRODUCTREF} (default). 417 <p> 418 * <p> 419 * @warning <span class='warning'>The specific integer values of the possible 420 * type codes may be reused by different Level 3 package plug-ins. 421 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 422 * both getTypeCode() and getPackageName()</strong>.</span> 423 <p> 424 * @see #getElementName() 425 * @see #getPackageName() 426 */ public 427 int getTypeCode() { 428 return libsbmlJNI.GeneProductRef_getTypeCode(swigCPtr, this); 429 } 430 431 432/** 433 * Predicate returning <code>true</code> if all the required attributes for this 434 * {@link GeneProductRef} object have been set. 435 <p> 436 * @note The required attributes for a {@link GeneProductRef} object are: 437 * <ul> 438 * <li> 'geneProduct' 439 * 440 * </ul> <p> 441 * @return a boolean value indicating whether all the required 442 * attributes for this object have been defined. 443 */ public 444 boolean hasRequiredAttributes() { 445 return libsbmlJNI.GeneProductRef_hasRequiredAttributes(swigCPtr, this); 446 } 447 448 449/** * @internal */ public 450 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 451 libsbmlJNI.GeneProductRef_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 452 } 453 454}