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-fbc"><a href="group__fbc.html">fbc</a></span> 013 Implementation of the 'fbc' package GeneAssociation 014 * construct. 015 <p> 016 * Gene associations are not part of the core FBC specification, but rather are a proposed annotation. 017 */ 018 019public class GeneAssociation extends SBase { 020 private long swigCPtr; 021 022 protected GeneAssociation(long cPtr, boolean cMemoryOwn) 023 { 024 super(libsbmlJNI.GeneAssociation_SWIGUpcast(cPtr), cMemoryOwn); 025 swigCPtr = cPtr; 026 } 027 028 protected static long getCPtr(GeneAssociation obj) 029 { 030 return (obj == null) ? 0 : obj.swigCPtr; 031 } 032 033 protected static long getCPtrAndDisown (GeneAssociation obj) 034 { 035 long ptr = 0; 036 037 if (obj != null) 038 { 039 ptr = obj.swigCPtr; 040 obj.swigCMemOwn = false; 041 } 042 043 return ptr; 044 } 045 046 protected void finalize() { 047 delete(); 048 } 049 050 public synchronized void delete() { 051 if (swigCPtr != 0) { 052 if (swigCMemOwn) { 053 swigCMemOwn = false; 054 libsbmlJNI.delete_GeneAssociation(swigCPtr); 055 } 056 swigCPtr = 0; 057 } 058 super.delete(); 059 } 060 061 062/** 063 * Creates a new {@link GeneAssociation} with the given <code>level</code>, <code>version</code>, and <code>pkgVersion</code>. 064 */ public 065 GeneAssociation(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 066 this(libsbmlJNI.new_GeneAssociation__SWIG_0(level, version, pkgVersion), true); 067 } 068 069 070/** 071 * Creates a new {@link GeneAssociation} with the given <code>level</code>, <code>version</code>, and <code>pkgVersion</code>. 072 */ public 073 GeneAssociation(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 074 this(libsbmlJNI.new_GeneAssociation__SWIG_1(level, version), true); 075 } 076 077 078/** 079 * Creates a new {@link GeneAssociation} with the given <code>level</code>, <code>version</code>, and <code>pkgVersion</code>. 080 */ public 081 GeneAssociation(long level) throws org.sbml.libsbml.SBMLConstructorException { 082 this(libsbmlJNI.new_GeneAssociation__SWIG_2(level), true); 083 } 084 085 086/** 087 * Creates a new {@link GeneAssociation} with the given <code>level</code>, <code>version</code>, and <code>pkgVersion</code>. 088 */ public 089 GeneAssociation() throws org.sbml.libsbml.SBMLConstructorException { 090 this(libsbmlJNI.new_GeneAssociation__SWIG_3(), true); 091 } 092 093 094/** 095 * Creates a new {@link GeneAssociation} with the given <code>node</code> and {@link FbcPkgNamespaces} <code>fbcns</code>. 096 */ public 097 GeneAssociation(XMLNode node, FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException { 098 this(libsbmlJNI.new_GeneAssociation__SWIG_4(XMLNode.getCPtr(node), node, FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 099 } 100 101 102/** 103 * Creates a new {@link GeneAssociation} with the given {@link FbcPkgNamespaces} object. 104 */ public 105 GeneAssociation(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException { 106 this(libsbmlJNI.new_GeneAssociation__SWIG_5(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 107 } 108 109 110/** 111 * Copy constructor. 112 */ public 113 GeneAssociation(GeneAssociation source) throws org.sbml.libsbml.SBMLConstructorException { 114 this(libsbmlJNI.new_GeneAssociation__SWIG_6(GeneAssociation.getCPtr(source), source), true); 115 } 116 117 118/** 119 * Returns the string of the 'id' attribute of this {@link GeneAssociation}. 120 <p> 121 * @return the string of the 'id' attribute of this {@link GeneAssociation}. 122 */ public 123 String getId() { 124 return libsbmlJNI.GeneAssociation_getId(swigCPtr, this); 125 } 126 127 128/** 129 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 130 * {@link GeneAssociation}'s 'id' attribute has been set. 131 <p> 132 * @return <code>true</code> if this {@link GeneAssociation}'s 'id' attribute has been set, 133 * otherwise <code>false</code> is returned. 134 */ public 135 boolean isSetId() { 136 return libsbmlJNI.GeneAssociation_isSetId(swigCPtr, this); 137 } 138 139 140/** 141 * Sets the SIdRef string of the 'id' attribute of this {@link GeneAssociation}. 142 <p> 143 * @param id a SIdRef string to be set. 144 <p> 145 * @return integer value indicating success/failure of the 146 * operation. The possible return values are: 147 * <ul> 148 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 149 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 150 * </ul> 151 */ public 152 int setId(String id) { 153 return libsbmlJNI.GeneAssociation_setId(swigCPtr, this, id); 154 } 155 156 157/** 158 * Unsets the value of the 'id' attribute of this {@link GeneAssociation}. 159 <p> 160 * @return integer value indicating success/failure of the 161 * operation. The possible return values are: 162 * <ul> 163 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 164 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 165 * </ul> 166 */ public 167 int unsetId() { 168 return libsbmlJNI.GeneAssociation_unsetId(swigCPtr, this); 169 } 170 171 172/** 173 * Returns the string of the 'reaction' attribute of this {@link GeneAssociation}. 174 <p> 175 * @return the string of the 'reaction' attribute of this {@link GeneAssociation}. 176 */ public 177 String getReaction() { 178 return libsbmlJNI.GeneAssociation_getReaction(swigCPtr, this); 179 } 180 181 182/** 183 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 184 * {@link GeneAssociation}'s 'reaction' attribute has been set. 185 <p> 186 * @return <code>true</code> if this {@link GeneAssociation}'s 'reaction' attribute has been set, 187 * otherwise <code>false</code> is returned. 188 */ public 189 boolean isSetReaction() { 190 return libsbmlJNI.GeneAssociation_isSetReaction(swigCPtr, this); 191 } 192 193 194/** 195 * Sets the SIdRef string of the 'reaction' attribute of this {@link GeneAssociation}. 196 <p> 197 * @param reaction a SIdRef string to be set. 198 <p> 199 * @return integer value indicating success/failure of the 200 * operation. The possible return values are: 201 * <ul> 202 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 203 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 204 * </ul> 205 */ public 206 int setReaction(String reaction) { 207 return libsbmlJNI.GeneAssociation_setReaction(swigCPtr, this, reaction); 208 } 209 210 211/** 212 * Unsets the value of the 'id' attribute of this {@link GeneAssociation}. 213 <p> 214 * @return integer value indicating success/failure of the 215 * operation. The possible return values are: 216 * <ul> 217 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 218 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 219 * </ul> 220 */ public 221 int unsetReaction() { 222 return libsbmlJNI.GeneAssociation_unsetReaction(swigCPtr, this); 223 } 224 225 226/** 227 * Creates a new association, sets it to this element and returns it. 228 */ public 229 Association createAssociation() { 230 long cPtr = libsbmlJNI.GeneAssociation_createAssociation(swigCPtr, this); 231 return (cPtr == 0) ? null : new Association(cPtr, false); 232 } 233 234 235/** 236 * Returns {@link Association} object of this {@link GeneAssociation}. 237 <p> 238 * @return {@link Association} object of this {@link GeneAssociation}. 239 */ public 240 Association getAssociation() { 241 long cPtr = libsbmlJNI.GeneAssociation_getAssociation__SWIG_0(swigCPtr, this); 242 return (cPtr == 0) ? null : new Association(cPtr, false); 243 } 244 245 246/** 247 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 248 * {@link GeneAssociation}'s 'association' element has been set. 249 <p> 250 * @return <code>true</code> if this {@link GeneAssociation}'s 'association' element has been set, 251 * otherwise <code>false</code> is returned. 252 */ public 253 boolean isSetAssociation() { 254 return libsbmlJNI.GeneAssociation_isSetAssociation(swigCPtr, this); 255 } 256 257 258/** 259 * Sets the {@link Association} object of this {@link GeneAssociation}. 260 <p> 261 * @param association a {@link Association} object to be set. 262 <p> 263 * @return integer value indicating success/failure of the 264 * operation. The possible return values 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 setAssociation(Association association) { 271 return libsbmlJNI.GeneAssociation_setAssociation(swigCPtr, this, Association.getCPtr(association), association); 272 } 273 274 275/** 276 * Unsets the {@link Association} object of this {@link GeneAssociation}. 277 <p> 278 * @return integer value indicating success/failure of the 279 * operation. The possible return values are: 280 * <ul> 281 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 282 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 283 * </ul> 284 */ public 285 int unsetAssociation() { 286 return libsbmlJNI.GeneAssociation_unsetAssociation(swigCPtr, this); 287 } 288 289 290/** 291 * Returns the XML element name of 292 * this SBML object. 293 <p> 294 * @return the string of the name of this element. 295 */ public 296 String getElementName() { 297 return libsbmlJNI.GeneAssociation_getElementName(swigCPtr, this); 298 } 299 300 301/** 302 * Creates and returns a deep copy of this {@link GeneAssociation}. 303 <p> 304 * @return a (deep) copy of this {@link GeneAssociation}. 305 */ public 306 GeneAssociation cloneObject() { 307 long cPtr = libsbmlJNI.GeneAssociation_cloneObject(swigCPtr, this); 308 return (cPtr == 0) ? null : new GeneAssociation(cPtr, true); 309 } 310 311 312/** 313 * Returns the libSBML type code of this object instance. 314 <p> 315 * <p> 316 * LibSBML attaches an identifying code to every kind of SBML object. These 317 * are integer constants known as <em>SBML type codes</em>. The names of all 318 * the codes begin with the characters “<code>SBML_</code>”. 319 * In the Java language interface for libSBML, the 320 * type codes are defined as static integer constants in the interface class 321 * {@link libsbmlConstants}. Note that different Level 3 322 * package plug-ins may use overlapping type codes; to identify the package 323 * to which a given object belongs, call the <code>getPackageName()</code> 324 * method on the object. 325 <p> 326 * @return the SBML type code for this object: 327 * {@link libsbmlConstants#SBML_FBC_GENEASSOCIATION SBML_FBC_GENEASSOCIATION} 328 <p> 329 * <p> 330 * @warning <span class='warning'>The specific integer values of the possible 331 * type codes may be reused by different Level 3 package plug-ins. 332 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 333 * both getTypeCode() and getPackageName()</strong>.</span> 334 <p> 335 * @see #getElementName() 336 * @see #getPackageName() 337 */ public 338 int getTypeCode() { 339 return libsbmlJNI.GeneAssociation_getTypeCode(swigCPtr, this); 340 } 341 342 343/** 344 * Creates an {@link XMLNode} object from this. 345 */ public 346 XMLNode toXML() { 347 return new XMLNode(libsbmlJNI.GeneAssociation_toXML(swigCPtr, this), true); 348 } 349 350}