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