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 An objective function for a flux.
014 <p>
015 * An integral component in a complete description of a steady-state model is
016 * the so-called <em>objective function</em>, which generally consists of a
017 * linear combination of model variables (fluxes) and a sense (direction). In
018 * the SBML Level&nbsp;3 <a href='../../../extensions-summary.html#fbc'>Flux Balance Constraints</a> (&ldquo;fbc&rdquo;) package, this concept
019 * is succinctly captured in the {@link Objective} class.  An {@link Objective} object
020 * includes a list of flux objectives, each in the form of a {@link FluxObjective}
021 * object.
022<p>
023 * The {@link FluxObjective} class is a relatively simple container for a model
024 * variable weighted by a signed linear coefficient.  In addition to the
025 * common SBML object attributes of 'id' and 'name' (both of which are
026 * optional), it adds two required attributes: 'reaction' and 'coefficient'.
027 <p>
028 * The 'reaction' attribute must have a value of type <code>SIdRef</code>,
029 * and its value is restricted to the identifier of a {@link Reaction} object in the
030 * model.  The 'reaction' attribute identifiers the reaction to which the
031 * {@link FluxObjective} applies.  The 'coefficient' attribute must have a value of
032 * type <code>double</code>, and refers to the coefficient that this
033 * {@link FluxObjective} takes in the enclosing {@link Objective}.  Its unit of measurement
034 * is <code>dimensionless</code>.  The meaning of these two attributes
035 * together is given by the formula <em>coefficient &times;
036 * reaction-flux</em>.  Since reactions in SBML Level&nbsp;3 are in units of
037 * <em>extent</em>, the units of a flux objective are thus <em>extent per
038 * time</em>.
039 <p>
040 * The following example * illustrates the use of these attributes in an
041 * example of a * ListOfObjectives:
042 * <pre class='fragment'>
043&lt;fbc:listOfObjectives fbc:activeObjective='obj1'&gt;
044 &lt;fbc:objective fbc:id='obj1' fbc:type='maximize'&gt;
045  &lt;fbc:listOfFluxObjectives&gt;
046   &lt;fbc:fluxObjective fbc:reaction='R1' fbc:coefficient='1'/&gt;
047   &lt;fbc:fluxObjective fbc:reaction='R2' fbc:coefficient='2'/&gt;
048  &lt;/fbc:listOfFluxObjectives&gt;
049 &lt;/fbc:objective&gt;
050&lt;/fbc:listOfObjectives&gt;
051</pre>
052 <p>
053 * @see Objective
054 * @see ListOfObjectives
055 * @see ListOfFluxObjectives
056 */
057
058public class FluxObjective extends SBase {
059   private long swigCPtr;
060
061   protected FluxObjective(long cPtr, boolean cMemoryOwn)
062   {
063     super(libsbmlJNI.FluxObjective_SWIGUpcast(cPtr), cMemoryOwn);
064     swigCPtr = cPtr;
065   }
066
067   protected static long getCPtr(FluxObjective obj)
068   {
069     return (obj == null) ? 0 : obj.swigCPtr;
070   }
071
072   protected static long getCPtrAndDisown (FluxObjective obj)
073   {
074     long ptr = 0;
075
076     if (obj != null)
077     {
078       ptr             = obj.swigCPtr;
079       obj.swigCMemOwn = false;
080     }
081
082     return ptr;
083   }
084
085  protected void finalize() {
086    delete();
087  }
088
089  public synchronized void delete() {
090    if (swigCPtr != 0) {
091      if (swigCMemOwn) {
092        swigCMemOwn = false;
093        libsbmlJNI.delete_FluxObjective(swigCPtr);
094      }
095      swigCPtr = 0;
096    }
097    super.delete();
098  }
099
100  
101/**
102   * Creates a new {@link FluxObjective} with the given SBML Level, Version, and
103   * &ldquo;fbc&rdquo;package version.
104   <p>
105   * @param level a long integer, the SBML Level to assign to this
106   * {@link FluxObjective}
107   <p>
108   * @param version a long integer, the SBML Version to assign to this
109   * {@link FluxObjective}
110   <p>
111   * @param pkgVersion a long integer, the SBML Fbc Version to assign to
112   * this {@link FluxObjective}
113   */ public
114 FluxObjective(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
115    this(libsbmlJNI.new_FluxObjective__SWIG_0(level, version, pkgVersion), true);
116  }
117
118  
119/**
120   * Creates a new {@link FluxObjective} with the given SBML Level, Version, and
121   * &ldquo;fbc&rdquo;package version.
122   <p>
123   * @param level a long integer, the SBML Level to assign to this
124   * {@link FluxObjective}
125   <p>
126   * @param version a long integer, the SBML Version to assign to this
127   * {@link FluxObjective}
128   <p>
129   * @param pkgVersion a long integer, the SBML Fbc Version to assign to
130   * this {@link FluxObjective}
131   */ public
132 FluxObjective(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
133    this(libsbmlJNI.new_FluxObjective__SWIG_1(level, version), true);
134  }
135
136  
137/**
138   * Creates a new {@link FluxObjective} with the given SBML Level, Version, and
139   * &ldquo;fbc&rdquo;package version.
140   <p>
141   * @param level a long integer, the SBML Level to assign to this
142   * {@link FluxObjective}
143   <p>
144   * @param version a long integer, the SBML Version to assign to this
145   * {@link FluxObjective}
146   <p>
147   * @param pkgVersion a long integer, the SBML Fbc Version to assign to
148   * this {@link FluxObjective}
149   */ public
150 FluxObjective(long level) throws org.sbml.libsbml.SBMLConstructorException {
151    this(libsbmlJNI.new_FluxObjective__SWIG_2(level), true);
152  }
153
154  
155/**
156   * Creates a new {@link FluxObjective} with the given SBML Level, Version, and
157   * &ldquo;fbc&rdquo;package version.
158   <p>
159   * @param level a long integer, the SBML Level to assign to this
160   * {@link FluxObjective}
161   <p>
162   * @param version a long integer, the SBML Version to assign to this
163   * {@link FluxObjective}
164   <p>
165   * @param pkgVersion a long integer, the SBML Fbc Version to assign to
166   * this {@link FluxObjective}
167   */ public
168 FluxObjective() throws org.sbml.libsbml.SBMLConstructorException {
169    this(libsbmlJNI.new_FluxObjective__SWIG_3(), true);
170  }
171
172  
173/**
174   * Creates a new {@link FluxObjective} with the given {@link FbcPkgNamespaces} object.
175   <p>
176   * @param fbcns the {@link FbcPkgNamespaces} object
177   */ public
178 FluxObjective(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException {
179    this(libsbmlJNI.new_FluxObjective__SWIG_4(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true);
180  }
181
182  
183/**
184   * Copy constructor for {@link FluxObjective}.
185   <p>
186   * @param orig; the {@link FluxObjective} instance to copy.
187   */ public
188 FluxObjective(FluxObjective orig) throws org.sbml.libsbml.SBMLConstructorException {
189    this(libsbmlJNI.new_FluxObjective__SWIG_5(FluxObjective.getCPtr(orig), orig), true);
190  }
191
192  
193/**
194   * Creates and returns a deep copy of this {@link FluxObjective} object.
195   <p>
196   * @return a (deep) copy of this {@link FluxObjective} object.
197   */ public
198 FluxObjective cloneObject() {
199    long cPtr = libsbmlJNI.FluxObjective_cloneObject(swigCPtr, this);
200    return (cPtr == 0) ? null : new FluxObjective(cPtr, true);
201  }
202
203  
204/**
205   * Returns the value of the 'id' attribute of this {@link FluxObjective}.
206   <p>
207   * @return the value of the 'id' attribute of this {@link FluxObjective} as a string.
208   */ public
209 String getId() {
210    return libsbmlJNI.FluxObjective_getId(swigCPtr, this);
211  }
212
213  
214/**
215   * Returns the value of the 'name' attribute of this {@link FluxObjective}.
216   <p>
217   * @return the value of the 'name' attribute of this {@link FluxObjective} as a
218   * string.
219   */ public
220 String getName() {
221    return libsbmlJNI.FluxObjective_getName(swigCPtr, this);
222  }
223
224  
225/**
226   * Returns the value of the 'reaction' attribute of this {@link FluxObjective}.
227   <p>
228   * @return the value of the 'reaction' attribute of this {@link FluxObjective} as a
229   * string.
230   */ public
231 String getReaction() {
232    return libsbmlJNI.FluxObjective_getReaction(swigCPtr, this);
233  }
234
235  
236/**
237   * Returns the value of the 'coefficient' attribute of this {@link FluxObjective}.
238   <p>
239   * @return the value of the 'coefficient' attribute of this {@link FluxObjective}
240   * as a double.
241   */ public
242 double getCoefficient() {
243    return libsbmlJNI.FluxObjective_getCoefficient(swigCPtr, this);
244  }
245
246  
247/**
248   * Predicate returning <code>true</code> if this {@link FluxObjective}'s 'id' attribute is
249   * set.
250   <p>
251   * @return <code>true</code> if this {@link FluxObjective}'s 'id' attribute has been set,
252   * otherwise <code>false</code> is returned.
253   */ public
254 boolean isSetId() {
255    return libsbmlJNI.FluxObjective_isSetId(swigCPtr, this);
256  }
257
258  
259/**
260   * Predicate returning <code>true</code> if this {@link FluxObjective}'s 'name' attribute is
261   * set.
262   <p>
263   * @return <code>true</code> if this {@link FluxObjective}'s 'name' attribute has been set,
264   * otherwise <code>false</code> is returned.
265   */ public
266 boolean isSetName() {
267    return libsbmlJNI.FluxObjective_isSetName(swigCPtr, this);
268  }
269
270  
271/**
272   * Predicate returning <code>true</code> if this {@link FluxObjective}'s 'reaction' attribute
273   * is set.
274   <p>
275   * @return <code>true</code> if this {@link FluxObjective}'s 'reaction' attribute has been set,
276   * otherwise <code>false</code> is returned.
277   */ public
278 boolean isSetReaction() {
279    return libsbmlJNI.FluxObjective_isSetReaction(swigCPtr, this);
280  }
281
282  
283/**
284   * Predicate returning <code>true</code> if this {@link FluxObjective}'s 'coefficient'
285   * attribute is set.
286   <p>
287   * @return <code>true</code> if this {@link FluxObjective}'s 'coefficient' attribute has been
288   * set, otherwise <code>false</code> is returned.
289   */ public
290 boolean isSetCoefficient() {
291    return libsbmlJNI.FluxObjective_isSetCoefficient(swigCPtr, this);
292  }
293
294  
295/**
296   * Sets the value of the 'id' attribute of this {@link FluxObjective}.
297   <p>
298   * @param id; String value of the 'id' attribute to be set
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_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
306   * </ul>
307   */ public
308 int setId(String id) {
309    return libsbmlJNI.FluxObjective_setId(swigCPtr, this, id);
310  }
311
312  
313/**
314   * Sets the value of the 'name' attribute of this {@link FluxObjective}.
315   <p>
316   * @param name; String value of the 'name' attribute to be set
317   <p>
318   * @return integer value indicating success/failure of the
319   * function.   The possible values
320   * returned by this function are:
321   * <ul>
322   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
323   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
324   * </ul>
325   */ public
326 int setName(String name) {
327    return libsbmlJNI.FluxObjective_setName(swigCPtr, this, name);
328  }
329
330  
331/**
332   * Sets the value of the 'reaction' attribute of this {@link FluxObjective}.
333   <p>
334   * @param reaction; String value of the 'reaction' attribute to be set
335   <p>
336   * @return integer value indicating success/failure of the
337   * function.   The possible values
338   * returned by this function are:
339   * <ul>
340   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
341   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
342   * </ul>
343   */ public
344 int setReaction(String reaction) {
345    return libsbmlJNI.FluxObjective_setReaction(swigCPtr, this, reaction);
346  }
347
348  
349/**
350   * Sets the value of the 'coefficient' attribute of this {@link FluxObjective}.
351   <p>
352   * @param coefficient; double value of the 'coefficient' attribute to be set
353   <p>
354   * @return integer value indicating success/failure of the
355   * function.   The possible values
356   * returned by this function are:
357   * <ul>
358   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
359   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
360   * </ul>
361   */ public
362 int setCoefficient(double coefficient) {
363    return libsbmlJNI.FluxObjective_setCoefficient(swigCPtr, this, coefficient);
364  }
365
366  
367/**
368   * Unsets the value of the 'id' attribute of this {@link FluxObjective}.
369   <p>
370   * @return integer value indicating success/failure of the
371   * function.   The possible values
372   * returned by this function are:
373   * <ul>
374   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
375   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
376   * </ul>
377   */ public
378 int unsetId() {
379    return libsbmlJNI.FluxObjective_unsetId(swigCPtr, this);
380  }
381
382  
383/**
384   * Unsets the value of the 'name' attribute of this {@link FluxObjective}.
385   <p>
386   * @return integer value indicating success/failure of the
387   * function.   The possible values
388   * returned by this function are:
389   * <ul>
390   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
391   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
392   * </ul>
393   */ public
394 int unsetName() {
395    return libsbmlJNI.FluxObjective_unsetName(swigCPtr, this);
396  }
397
398  
399/**
400   * Unsets the value of the 'reaction' attribute of this {@link FluxObjective}.
401   <p>
402   * @return integer value indicating success/failure of the
403   * function.   The possible values
404   * returned by this function are:
405   * <ul>
406   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
407   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
408   * </ul>
409   */ public
410 int unsetReaction() {
411    return libsbmlJNI.FluxObjective_unsetReaction(swigCPtr, this);
412  }
413
414  
415/**
416   * Unsets the value of the 'coefficient' attribute of this {@link FluxObjective}.
417   <p>
418   * @return integer value indicating success/failure of the
419   * function.   The possible values
420   * returned by this function are:
421   * <ul>
422   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
423   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
424   * </ul>
425   */ public
426 int unsetCoefficient() {
427    return libsbmlJNI.FluxObjective_unsetCoefficient(swigCPtr, this);
428  }
429
430  
431/**
432   * <p>
433 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another
434 * value.
435 <p>
436 * <p>
437 * In SBML, object identifiers are of a data type called <code>SId</code>.
438 * In SBML Level&nbsp;3, an explicit data type called <code>SIdRef</code> was
439 * introduced for attribute values that refer to <code>SId</code> values; in
440 * previous Levels of SBML, this data type did not exist and attributes were
441 * simply described to as 'referring to an identifier', but the effective
442 * data type was the same as <code>SIdRef</code>in Level&nbsp;3.  These and
443 * other methods of libSBML refer to the type <code>SIdRef</code> for all
444 * Levels of SBML, even if the corresponding SBML specification did not
445 * explicitly name the data type.
446 <p>
447 * This method works by looking at all attributes and (if appropriate)
448 * mathematical formulas in MathML content, comparing the referenced
449 * identifiers to the value of <code>oldid</code>.  If any matches are found, the
450 * matching values are replaced with <code>newid</code>.  The method does <em>not</em>
451 * descend into child elements.
452 <p>
453 * @param oldid the old identifier
454 * @param newid the new identifier
455   */ public
456 void renameSIdRefs(String oldid, String newid) {
457    libsbmlJNI.FluxObjective_renameSIdRefs(swigCPtr, this, oldid, newid);
458  }
459
460  
461/**
462   * Returns the XML element name of this object.
463   <p>
464   * For {@link FluxObjective}, the XML element name is always <code>'fluxObjective'.</code>
465   <p>
466   * @return the name of this element, i.e. <code>'fluxObjective'.</code>
467   */ public
468 String getElementName() {
469    return libsbmlJNI.FluxObjective_getElementName(swigCPtr, this);
470  }
471
472  
473/**
474   * Returns the libSBML type code for this SBML object.
475   <p>
476   * <p>
477 * LibSBML attaches an identifying code to every kind of SBML object.  These
478 * are integer constants known as <em>SBML type codes</em>.  The names of all
479 * the codes begin with the characters <code>SBML_</code>.
480 * In the Java language interface for libSBML, the
481 * type codes are defined as static integer constants in the interface class
482 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
483 * package plug-ins may use overlapping type codes; to identify the package
484 * to which a given object belongs, call the <code>getPackageName()</code>
485 * method on the object.
486   <p>
487   * @return the SBML type code for this object:
488   * {@link libsbmlConstants#SBML_FBC_FLUXOBJECTIVE SBML_FBC_FLUXOBJECTIVE} (default).
489   <p>
490   * <p>
491 * @warning <span class='warning'>The specific integer values of the possible
492 * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
493 * packages,  To fully identify the correct code, <strong>it is necessary to
494 * invoke both getTypeCode() and getPackageName()</strong>.</span>
495   <p>
496   * @see #getElementName()
497   * @see #getPackageName()
498   */ public
499 int getTypeCode() {
500    return libsbmlJNI.FluxObjective_getTypeCode(swigCPtr, this);
501  }
502
503  
504/**
505   * Predicate returning <code>true</code> if all the required attributes
506   * for this {@link FluxObjective} object have been set.
507   <p>
508   * @note The required attributes for a {@link FluxObjective} object are:
509   * <ul>
510   * <li> 'reaction'
511   * <li> 'coefficient'
512   *
513   * </ul> <p>
514   * @return a boolean value indicating whether all the required
515   * attributes for this object have been defined.
516   */ public
517 boolean hasRequiredAttributes() {
518    return libsbmlJNI.FluxObjective_hasRequiredAttributes(swigCPtr, this);
519  }
520
521  
522/** * @internal */ public
523 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
524    libsbmlJNI.FluxObjective_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
525  }
526
527}