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 FluxObjective
014 * construct.
015 <p>
016 * An integral component in a complete description of a steady-state model is the so-called 'objective function' which generally consists of a linear combination of model variables (fluxes) and a sense (direction). In the FBC package this concept is succinctly captured in the {@link Objective} class.
017 */
018
019public class FluxObjective extends SBase {
020   private long swigCPtr;
021
022   protected FluxObjective(long cPtr, boolean cMemoryOwn)
023   {
024     super(libsbmlJNI.FluxObjective_SWIGUpcast(cPtr), cMemoryOwn);
025     swigCPtr = cPtr;
026   }
027
028   protected static long getCPtr(FluxObjective obj)
029   {
030     return (obj == null) ? 0 : obj.swigCPtr;
031   }
032
033   protected static long getCPtrAndDisown (FluxObjective 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_FluxObjective(swigCPtr);
055      }
056      swigCPtr = 0;
057    }
058    super.delete();
059  }
060
061  
062/**
063   * Creates a new {@link FluxObjective} with the given level, version, and package version.
064   */ public
065 FluxObjective(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
066    this(libsbmlJNI.new_FluxObjective__SWIG_0(level, version, pkgVersion), true);
067  }
068
069  
070/**
071   * Creates a new {@link FluxObjective} with the given level, version, and package version.
072   */ public
073 FluxObjective(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
074    this(libsbmlJNI.new_FluxObjective__SWIG_1(level, version), true);
075  }
076
077  
078/**
079   * Creates a new {@link FluxObjective} with the given level, version, and package version.
080   */ public
081 FluxObjective(long level) throws org.sbml.libsbml.SBMLConstructorException {
082    this(libsbmlJNI.new_FluxObjective__SWIG_2(level), true);
083  }
084
085  
086/**
087   * Creates a new {@link FluxObjective} with the given level, version, and package version.
088   */ public
089 FluxObjective() throws org.sbml.libsbml.SBMLConstructorException {
090    this(libsbmlJNI.new_FluxObjective__SWIG_3(), true);
091  }
092
093  
094/**
095   * Creates a new {@link FluxObjective} with the given {@link FbcPkgNamespaces} object.
096   */ public
097 FluxObjective(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException {
098    this(libsbmlJNI.new_FluxObjective__SWIG_4(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true);
099  }
100
101  
102/**
103   * Copy constructor.
104   */ public
105 FluxObjective(FluxObjective source) throws org.sbml.libsbml.SBMLConstructorException {
106    this(libsbmlJNI.new_FluxObjective__SWIG_5(FluxObjective.getCPtr(source), source), true);
107  }
108
109  
110/**
111   * Returns the value of the 'id' attribute of this {@link FluxObjective}.
112   <p>
113   * @return the value of the 'id' attribute of this {@link FluxObjective}.
114   */ public
115 String getId() {
116    return libsbmlJNI.FluxObjective_getId(swigCPtr, this);
117  }
118
119  
120/**
121   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
122   * {@link FluxObjective} 'id' attribute has been set.
123   <p>
124   * @return <code>true</code> if this {@link FluxObjective} 'id' attribute has been set,
125   * otherwise <code>false</code> is returned.
126   */ public
127 boolean isSetId() {
128    return libsbmlJNI.FluxObjective_isSetId(swigCPtr, this);
129  }
130
131  
132/**
133   * Sets the value of the 'id' attribute of this {@link FluxObjective}.
134   <p>
135   * @return integer value indicating success/failure of the
136   * operation. The possible return values are:
137   * <ul>
138   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
139   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
140   * </ul>
141   */ public
142 int setId(String id) {
143    return libsbmlJNI.FluxObjective_setId(swigCPtr, this, id);
144  }
145
146  
147/**
148   * Unsets the value of the 'id' attribute of this {@link FluxObjective}.
149   <p>
150   * @return integer value indicating success/failure of the
151   * operation. The possible return values are:
152   * <ul>
153   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
154   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
155   * </ul>
156   */ public
157 int unsetId() {
158    return libsbmlJNI.FluxObjective_unsetId(swigCPtr, this);
159  }
160
161  
162/**
163   * Returns the value of the 'name' attribute of this {@link FluxObjective}.
164   <p>
165   * @return the value of the 'name' attribute of this {@link FluxObjective}.
166   */ public
167 String getName() {
168    return libsbmlJNI.FluxObjective_getName(swigCPtr, this);
169  }
170
171  
172/**
173   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
174   * {@link FluxObjective} 'name' attribute has been set.
175   <p>
176   * @return <code>true</code> if this {@link FluxObjective} 'id' attribute has been set,
177   * otherwise <code>false</code> is returned.
178   */ public
179 boolean isSetName() {
180    return libsbmlJNI.FluxObjective_isSetName(swigCPtr, this);
181  }
182
183  
184/**
185   * Sets the value of the 'name' attribute of this {@link FluxObjective}.
186   <p>
187   * @return integer value indicating success/failure of the
188   * operation. The possible return values are:
189   * <ul>
190   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
191   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
192   * </ul>
193   */ public
194 int setName(String name) {
195    return libsbmlJNI.FluxObjective_setName(swigCPtr, this, name);
196  }
197
198  
199/**
200   * Unsets the value of the 'name' attribute of this {@link FluxObjective}.
201   <p>
202   * @return integer value indicating success/failure of the
203   * operation. The possible return values are:
204   * <ul>
205   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
206   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
207   * </ul>
208   */ public
209 int unsetName() {
210    return libsbmlJNI.FluxObjective_unsetName(swigCPtr, this);
211  }
212
213  
214/**
215   * Returns the string of the 'reaction' attribute of this {@link FluxObjective}.
216   <p>
217   * @return the string of the 'reaction' attribute of this {@link FluxObjective}.
218   */ public
219 String getReaction() {
220    return libsbmlJNI.FluxObjective_getReaction(swigCPtr, this);
221  }
222
223  
224/**
225   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
226   * {@link FluxObjective}'s 'reaction' attribute has been set.
227   <p>
228   * @return <code>true</code> if this {@link FluxObjective}'s 'reaction' attribute has been set, 
229   * otherwise <code>false</code> is returned.
230   */ public
231 boolean isSetReaction() {
232    return libsbmlJNI.FluxObjective_isSetReaction(swigCPtr, this);
233  }
234
235  
236/**
237   * Sets the SIdRef string of the 'reaction' attribute of this {@link FluxObjective}.
238   <p>
239   * @param reaction a SIdRef string to be set.
240   <p>
241   * @return integer value indicating success/failure of the
242   * operation. The possible return values are:
243   * <ul>
244   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
245   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
246   * </ul>
247   */ public
248 int setReaction(String reaction) {
249    return libsbmlJNI.FluxObjective_setReaction(swigCPtr, this, reaction);
250  }
251
252  
253/**
254   * Unsets the value of the 'id' attribute of this {@link FluxObjective}.
255   <p>
256   * @return integer value indicating success/failure of the
257   * operation. The possible return values are:
258   * <ul>
259   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
260   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
261   * </ul>
262   */ public
263 int unsetReaction() {
264    return libsbmlJNI.FluxObjective_unsetReaction(swigCPtr, this);
265  }
266
267  
268/**
269   * Returns the value of the 'coefficient' attribute of this {@link FluxObjective}.
270   <p>
271   * @return the value of the 'coefficient' attribute of this {@link FluxObjective}.
272   */ public
273 double getCoefficient() {
274    return libsbmlJNI.FluxObjective_getCoefficient(swigCPtr, this);
275  }
276
277  
278/**
279   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
280   * {@link FluxObjective}'s 'coefficient' attribute has been set.
281   <p>
282   * @return <code>true</code> if this {@link FluxObjective}'s 'coefficient' attribute has been set, 
283   * otherwise <code>false</code> is returned.
284   */ public
285 boolean isSetCoefficient() {
286    return libsbmlJNI.FluxObjective_isSetCoefficient(swigCPtr, this);
287  }
288
289  
290/**
291   * Sets the value of the 'coefficient' attribute of this {@link FluxObjective}.
292   <p>
293   * @param coefficient a double coefficient to be set.
294   <p>
295   * @return integer value indicating success/failure of the
296   * operation. The possible return values are:
297   * <ul>
298   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
299   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
300   * </ul>
301   */ public
302 int setCoefficient(double coefficient) {
303    return libsbmlJNI.FluxObjective_setCoefficient(swigCPtr, this, coefficient);
304  }
305
306  
307/**
308   * Unsets the value of the 'id' attribute of this {@link FluxObjective}.
309   <p>
310   * @return integer value indicating success/failure of the
311   * operation. The possible return values are:
312   * <ul>
313   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
314   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
315   * </ul>
316   */ public
317 int unsetCoefficient() {
318    return libsbmlJNI.FluxObjective_unsetCoefficient(swigCPtr, this);
319  }
320
321  
322/**
323   * Renames all the <code>SIdRef</code> attributes on this element, including any
324   * found in MathML content (if such exists).
325   <p>
326   * This method works by looking at all attributes and (if appropriate)
327   * mathematical formulas, comparing the identifiers to the value of @p
328   * oldid.  If any matches are found, the matching identifiers are replaced
329   * with <code>newid</code>.  The method does <em>not</em> descend into child elements.
330   <p>
331   * @param oldid the old identifier
332   * @param newid the new identifier
333   */ public
334 void renameSIdRefs(String oldid, String newid) {
335    libsbmlJNI.FluxObjective_renameSIdRefs(swigCPtr, this, oldid, newid);
336  }
337
338  
339/**
340   * Returns the XML element name of
341   * this SBML object.
342   <p>
343   * @return the string of the name of this element.
344   */ public
345 String getElementName() {
346    return libsbmlJNI.FluxObjective_getElementName(swigCPtr, this);
347  }
348
349  
350/**
351   * Creates and returns a deep copy of this {@link FluxObjective}.
352   <p>
353   * @return a (deep) copy of this {@link FluxObjective}.
354   */ public
355 FluxObjective cloneObject() {
356    long cPtr = libsbmlJNI.FluxObjective_cloneObject(swigCPtr, this);
357    return (cPtr == 0) ? null : new FluxObjective(cPtr, true);
358  }
359
360  
361/**
362   * Returns the libSBML type code of this object instance.
363   <p>
364   * <p>
365 * LibSBML attaches an identifying code to every kind of SBML object.  These
366 * are integer constants known as <em>SBML type codes</em>.  The names of all
367 * the codes begin with the characters &ldquo;<code>SBML_</code>&rdquo;. 
368 * In the Java language interface for libSBML, the
369 * type codes are defined as static integer constants in the interface class
370 * {@link libsbmlConstants}.    Note that different Level&nbsp;3 
371 * package plug-ins may use overlapping type codes; to identify the package
372 * to which a given object belongs, call the <code>getPackageName()</code>
373 * method on the object.
374   <p>
375   * @return the SBML type code for this object:
376   * {@link  libsbmlConstants#SBML_FBC_FLUXOBJECTIVE SBML_FBC_FLUXOBJECTIVE}
377   <p>
378   * <p>
379 * @warning <span class='warning'>The specific integer values of the possible
380 * type codes may be reused by different Level&nbsp;3 package plug-ins.
381 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
382 * both getTypeCode() and getPackageName()</strong>.</span>
383   <p>
384   * @see #getElementName()
385   * @see #getPackageName()
386   */ public
387 int getTypeCode() {
388    return libsbmlJNI.FluxObjective_getTypeCode(swigCPtr, this);
389  }
390
391}