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