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 Max or min value for a reaction flux.
014 <p>
015 * The {@link FluxBound} class of objects is used in Version&nbsp;1 of the SBML
016 * Level&nbsp;3 <a href='../../../extensions-summary.html#fbc'>Flux Balance Constraints</a> (&ldquo;fbc&rdquo;) package to express a single
017 * (in)equality that provides the maximum or minimum value that a reaction
018 * flux can obtain at steady state.  (This same information is encoded
019 * differently in Version&nbsp;2 of &ldquo;fbc&rdquo;; see the
020 * 'upperFluxBound' and 'lowerFluxBound' attributes on {@link FbcReactionPlugin}.)
021 <p>
022 * <h2>Attributes on {@link FluxBound}</h2>
023 <p>
024 * In addition to the common optional attributes 'id' and 'name', {@link FluxBound}
025 * takes three required attributes: 'reaction', 'operation' and 'value'.
026 * These three attributes define the meaning of the {@link FluxBound}, and are
027 * interpreted using the following expression:
028 * <center>
029 * <em>reaction</em>&nbsp;&nbsp;&nbsp;<em>operator</em>&nbsp;&nbsp;&nbsp;<em>value</em>
030 * </center>
031 <p>
032 * The 'reaction' attribute takes a value of <code>SIdRef</code>.  The value
033 * must be the identifier of a {@link Reaction} object defined within the enclosing
034 * model.
035 <p>
036 * The 'operation' attribute takes a value from an enumeration
037 * (#FluxBoundOperation_t) of Boolean operations that represent mathemetical
038 * inequalities.  Possible values for 'operation' include
039 * <code>'greaterEqual'</code>, <code>'equal'</code>, and others.
040 <p>
041 * The 'value' attribute takes a numerical value of type <code>double</code>,
042 * and represents the value of the flux bound.  The permitted values include
043 * positive infinity (<code>'INF'</code>) and negative infinity
044 * (<code>'-INF'</code>).
045 <p>
046 * The following is an example of a set of flux bounds encoded in this form; it
047 * also demonstrates the use of {@link ListOfFluxBounds}.
048 <p>
049 * <pre class='fragment'>
050&lt;fbc:listOfFluxBounds&gt;
051    &lt;fbc:fluxBound fbc:id='R1b' fbc:reaction='R1' fbc:operation='greaterEqual' fbc:value='1.2'/&gt;
052    &lt;fbc:fluxBound fbc:id='R2b' fbc:reaction='R2' fbc:operation='lessEqual' fbc:value='-1.2'/&gt;
053    &lt;fbc:fluxBound fbc:id='R3b' fbc:reaction='R3' fbc:operation='greaterEqual' fbc:value='-INF'/&gt;
054    &lt;fbc:fluxBound fbc:id='R4b' fbc:reaction='R4' fbc:operation='lessEqual' fbc:value='INF'/&gt;
055    &lt;fbc:fluxBound fbc:id='R5b' fbc:reaction='R5' fbc:operation='equal' fbc:value='1'/&gt;
056&lt;/fbc:listOfFluxBounds&gt;
057</pre>
058 <p>
059 * @note This class is only defined for Version&nbsp;1 of the
060 * &ldquo;fbc&rdquo; package specification.  It was replaced in
061 * Version&nbsp;2 by a {@link Parameter} referenced by the 'upperFluxBound' or
062 * 'lowerFluxBound' attributes on an {@link FbcReactionPlugin}.  {@link FluxBound} is
063 * therefore not used for Version&nbsp;2 &ldquo;fbc&rdquo; models.
064 <p>
065 * @see ListOfFluxBounds
066 */
067
068public class FluxBound extends SBase {
069   private long swigCPtr;
070
071   protected FluxBound(long cPtr, boolean cMemoryOwn)
072   {
073     super(libsbmlJNI.FluxBound_SWIGUpcast(cPtr), cMemoryOwn);
074     swigCPtr = cPtr;
075   }
076
077   protected static long getCPtr(FluxBound obj)
078   {
079     return (obj == null) ? 0 : obj.swigCPtr;
080   }
081
082   protected static long getCPtrAndDisown (FluxBound obj)
083   {
084     long ptr = 0;
085
086     if (obj != null)
087     {
088       ptr             = obj.swigCPtr;
089       obj.swigCMemOwn = false;
090     }
091
092     return ptr;
093   }
094
095  protected void finalize() {
096    delete();
097  }
098
099  public synchronized void delete() {
100    if (swigCPtr != 0) {
101      if (swigCMemOwn) {
102        swigCMemOwn = false;
103        libsbmlJNI.delete_FluxBound(swigCPtr);
104      }
105      swigCPtr = 0;
106    }
107    super.delete();
108  }
109
110  
111/**
112   * Creates a new {@link FbcAssociation} with the given SBML Level, Version, and
113   * &ldquo;fbc&rdquo;package version.
114   <p>
115   * @param level a long integer, the SBML Level to assign to this
116   * {@link FluxObjective}
117   <p>
118   * @param version a long integer, the SBML Version to assign to this
119   * {@link FluxObjective}
120   <p>
121   * @param pkgVersion a long integer, the SBML Fbc Version to assign to
122   * this {@link FluxObjective}
123   */ public
124 FluxBound(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
125    this(libsbmlJNI.new_FluxBound__SWIG_0(level, version, pkgVersion), true);
126  }
127
128  
129/**
130   * Creates a new {@link FbcAssociation} with the given SBML Level, Version, and
131   * &ldquo;fbc&rdquo;package version.
132   <p>
133   * @param level a long integer, the SBML Level to assign to this
134   * {@link FluxObjective}
135   <p>
136   * @param version a long integer, the SBML Version to assign to this
137   * {@link FluxObjective}
138   <p>
139   * @param pkgVersion a long integer, the SBML Fbc Version to assign to
140   * this {@link FluxObjective}
141   */ public
142 FluxBound(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
143    this(libsbmlJNI.new_FluxBound__SWIG_1(level, version), true);
144  }
145
146  
147/**
148   * Creates a new {@link FbcAssociation} with the given SBML Level, Version, and
149   * &ldquo;fbc&rdquo;package version.
150   <p>
151   * @param level a long integer, the SBML Level to assign to this
152   * {@link FluxObjective}
153   <p>
154   * @param version a long integer, the SBML Version to assign to this
155   * {@link FluxObjective}
156   <p>
157   * @param pkgVersion a long integer, the SBML Fbc Version to assign to
158   * this {@link FluxObjective}
159   */ public
160 FluxBound(long level) throws org.sbml.libsbml.SBMLConstructorException {
161    this(libsbmlJNI.new_FluxBound__SWIG_2(level), true);
162  }
163
164  
165/**
166   * Creates a new {@link FbcAssociation} with the given SBML Level, Version, and
167   * &ldquo;fbc&rdquo;package version.
168   <p>
169   * @param level a long integer, the SBML Level to assign to this
170   * {@link FluxObjective}
171   <p>
172   * @param version a long integer, the SBML Version to assign to this
173   * {@link FluxObjective}
174   <p>
175   * @param pkgVersion a long integer, the SBML Fbc Version to assign to
176   * this {@link FluxObjective}
177   */ public
178 FluxBound() throws org.sbml.libsbml.SBMLConstructorException {
179    this(libsbmlJNI.new_FluxBound__SWIG_3(), true);
180  }
181
182  
183/**
184   * Creates a new {@link FluxBound} with the given {@link FbcPkgNamespaces} object.
185   */ public
186 FluxBound(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException {
187    this(libsbmlJNI.new_FluxBound__SWIG_4(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true);
188  }
189
190  
191/**
192   * Copy constructor.
193   */ public
194 FluxBound(FluxBound source) throws org.sbml.libsbml.SBMLConstructorException {
195    this(libsbmlJNI.new_FluxBound__SWIG_5(FluxBound.getCPtr(source), source), true);
196  }
197
198  
199/**
200   * Returns the value of the 'id' attribute of this {@link FluxBound} object.
201   <p>
202   * @return the value of the 'id' attribute of this {@link FluxBound} object.
203   */ public
204 String getId() {
205    return libsbmlJNI.FluxBound_getId(swigCPtr, this);
206  }
207
208  
209/**
210   * Predicate returning <code>true</code> if this {@link FluxBound}'s 'id' attribute is set.
211   <p>
212   * @return <code>true</code> if this {@link FluxBound} object's 'id' attribute has been set,
213   * otherwise <code>false</code> is returned.
214   */ public
215 boolean isSetId() {
216    return libsbmlJNI.FluxBound_isSetId(swigCPtr, this);
217  }
218
219  
220/**
221   * Sets the value of the 'id' attribute of this {@link FluxBound} object.
222   <p>
223   * <p>
224 * @return integer value indicating success/failure of the
225 * function.   The possible values
226 * returned by this function are:
227   * <ul>
228   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
229   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
230   * </ul>
231   */ public
232 int setId(String id) {
233    return libsbmlJNI.FluxBound_setId(swigCPtr, this, id);
234  }
235
236  
237/**
238   * Unsets the value of the 'id' attribute of this {@link FluxBound} object.
239   <p>
240   * <p>
241 * @return integer value indicating success/failure of the
242 * function.   The possible values
243 * returned by this function are:
244   * <ul>
245   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
246   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
247   * </ul>
248   */ public
249 int unsetId() {
250    return libsbmlJNI.FluxBound_unsetId(swigCPtr, this);
251  }
252
253  
254/**
255   * Returns the value of the 'name' attribute of this {@link FluxBound} object.
256   <p>
257   * @return the value of the 'name' attribute of this {@link FluxBound} object.
258   */ public
259 String getName() {
260    return libsbmlJNI.FluxBound_getName(swigCPtr, this);
261  }
262
263  
264/**
265   * Predicate returning <code>true</code> if this {@link FluxBound}'s 'name' attribute is set.
266   <p>
267   * @return <code>true</code> if this {@link FluxBound} object's 'id' attribute has been set,
268   * otherwise <code>false</code> is returned.
269   */ public
270 boolean isSetName() {
271    return libsbmlJNI.FluxBound_isSetName(swigCPtr, this);
272  }
273
274  
275/**
276   * Sets the value of the 'name' attribute of this {@link FluxBound} object.
277   <p>
278   * <p>
279 * @return integer value indicating success/failure of the
280 * function.   The possible values
281 * returned by this function are:
282   * <ul>
283   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
284   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
285   * </ul>
286   */ public
287 int setName(String name) {
288    return libsbmlJNI.FluxBound_setName(swigCPtr, this, name);
289  }
290
291  
292/**
293   * Unsets the value of the 'name' attribute of this {@link FluxBound} object.
294   <p>
295   * <p>
296 * @return integer value indicating success/failure of the
297 * function.   The possible values
298 * returned by this function are:
299   * <ul>
300   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
301   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
302   * </ul>
303   */ public
304 int unsetName() {
305    return libsbmlJNI.FluxBound_unsetName(swigCPtr, this);
306  }
307
308  
309/**
310   * Returns the value of the 'reaction' attribute of this {@link FluxBound} object.
311   <p>
312   * @return the value of the 'reaction' attribute of this {@link FluxBound} object.
313   */ public
314 String getReaction() {
315    return libsbmlJNI.FluxBound_getReaction(swigCPtr, this);
316  }
317
318  
319/**
320   * Predicate returning <code>true</code> if this {@link FluxBound}'s 'reaction' attribute is
321   * set.
322   <p>
323   * @return <code>true</code> if this {@link FluxBound} object's 'reaction' attribute has been
324   * set, otherwise <code>false</code> is returned.
325   */ public
326 boolean isSetReaction() {
327    return libsbmlJNI.FluxBound_isSetReaction(swigCPtr, this);
328  }
329
330  
331/**
332   * Sets the value of the 'reaction' attribute of this {@link FluxBound} object.
333   <p>
334   * <p>
335 * @return integer value indicating success/failure of the
336 * function.   The possible values
337 * returned by this function are:
338   * <ul>
339   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
340   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
341   * </ul>
342   */ public
343 int setReaction(String reaction) {
344    return libsbmlJNI.FluxBound_setReaction(swigCPtr, this, reaction);
345  }
346
347  
348/**
349   * Unsets the value of the 'reaction' attribute of this {@link FluxBound} object.
350   <p>
351   * <p>
352 * @return integer value indicating success/failure of the
353 * function.   The possible values
354 * returned by this function are:
355   * <ul>
356   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
357   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
358   * </ul>
359   */ public
360 int unsetReaction() {
361    return libsbmlJNI.FluxBound_unsetReaction(swigCPtr, this);
362  }
363
364  
365/**
366   * Returns the value of the 'operation' attribute of this {@link FluxBound} object.
367   <p>
368   * @return the value of the 'operation' attribute of this {@link FluxBound} object.
369   */ public
370 String getOperation() {
371    return libsbmlJNI.FluxBound_getOperation(swigCPtr, this);
372  }
373
374  
375/**
376   * Returns the value of the 'operation' attribute of this {@link FluxBound} object.
377   <p>
378   * @return the value of the 'operation' attribute of this {@link FluxBound} object.
379   */ public
380 int getFluxBoundOperation() {
381    return libsbmlJNI.FluxBound_getFluxBoundOperation(swigCPtr, this);
382  }
383
384  
385/**
386   * Predicate returning <code>true</code> if this {@link FluxBound}'s 'operation' attribute is
387   * set.
388   <p>
389   * @return <code>true</code> if this {@link FluxBound} object's 'operation' attribute has been set,
390   * otherwise <code>false</code> is returned.
391   */ public
392 boolean isSetOperation() {
393    return libsbmlJNI.FluxBound_isSetOperation(swigCPtr, this);
394  }
395
396  
397/**
398   * Sets the value of the 'operation' attribute of this {@link FluxBound} object.
399   <p>
400   * <p>
401 * @return integer value indicating success/failure of the
402 * function.   The possible values
403 * returned by this function are:
404   * <ul>
405   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
406   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
407   * </ul>
408   */ public
409 int setOperation(String operation) {
410    return libsbmlJNI.FluxBound_setOperation__SWIG_0(swigCPtr, this, operation);
411  }
412
413  
414/**
415   * Sets the value of the 'operation' attribute of this {@link FluxBound} object.
416   <p>
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_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
424   * </ul>
425   */ public
426 int setOperation(int operation) {
427    return libsbmlJNI.FluxBound_setOperation__SWIG_1(swigCPtr, this, operation);
428  }
429
430  
431/**
432   * Unsets the value of the 'operation' attribute of this {@link FluxBound} object.
433   <p>
434   * <p>
435 * @return integer value indicating success/failure of the
436 * function.   The possible values
437 * returned by this function are:
438   * <ul>
439   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
440   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
441   * </ul>
442   */ public
443 int unsetOperation() {
444    return libsbmlJNI.FluxBound_unsetOperation(swigCPtr, this);
445  }
446
447  
448/**
449   * Returns the value of the 'value' attribute of this {@link FluxBound} object.
450   <p>
451   * @return the value of the 'value' attribute of this {@link FluxBound} object.
452   */ public
453 double getValue() {
454    return libsbmlJNI.FluxBound_getValue(swigCPtr, this);
455  }
456
457  
458/**
459   * Predicate returning <code>true</code> if this {@link FluxBound}'s 'value' attribute is
460   * set.
461   <p>
462   * @return <code>true</code> if this {@link FluxBound} object's 'value' attribute has been set,
463   * otherwise <code>false</code> is returned.
464   */ public
465 boolean isSetValue() {
466    return libsbmlJNI.FluxBound_isSetValue(swigCPtr, this);
467  }
468
469  
470/**
471   * Sets the value of the 'value' attribute of this {@link FluxBound} object.
472   <p>
473   * <p>
474 * @return integer value indicating success/failure of the
475 * function.   The possible values
476 * returned by this function are:
477   * <ul>
478   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
479   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
480   * </ul>
481   */ public
482 int setValue(double value) {
483    return libsbmlJNI.FluxBound_setValue(swigCPtr, this, value);
484  }
485
486  
487/**
488   * Unsets the value of the 'value' attribute of this {@link FluxBound} object.
489   <p>
490   * <p>
491 * @return integer value indicating success/failure of the
492 * function.   The possible values
493 * returned by this function are:
494   * <ul>
495   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
496   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
497   * </ul>
498   */ public
499 int unsetValue() {
500    return libsbmlJNI.FluxBound_unsetValue(swigCPtr, this);
501  }
502
503  
504/**
505   * <p>
506 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another
507 * value.
508 <p>
509 * <p>
510 * In SBML, object identifiers are of a data type called <code>SId</code>.
511 * In SBML Level&nbsp;3, an explicit data type called <code>SIdRef</code> was
512 * introduced for attribute values that refer to <code>SId</code> values; in
513 * previous Levels of SBML, this data type did not exist and attributes were
514 * simply described to as 'referring to an identifier', but the effective
515 * data type was the same as <code>SIdRef</code>in Level&nbsp;3.  These and
516 * other methods of libSBML refer to the type <code>SIdRef</code> for all
517 * Levels of SBML, even if the corresponding SBML specification did not
518 * explicitly name the data type.
519 <p>
520 * This method works by looking at all attributes and (if appropriate)
521 * mathematical formulas in MathML content, comparing the referenced
522 * identifiers to the value of <code>oldid</code>.  If any matches are found, the
523 * matching values are replaced with <code>newid</code>.  The method does <em>not</em>
524 * descend into child elements.
525 <p>
526 * @param oldid the old identifier
527 * @param newid the new identifier
528   */ public
529 void renameSIdRefs(String oldid, String newid) {
530    libsbmlJNI.FluxBound_renameSIdRefs(swigCPtr, this, oldid, newid);
531  }
532
533  
534/**
535   * Returns the XML element name of this object.
536   <p>
537   * For {@link FluxBound}, the XML element name is always <code>'fluxBound'.</code>
538   <p>
539   * @return the name of this element, i.e. <code>'fluxBound'.</code>
540   */ public
541 String getElementName() {
542    return libsbmlJNI.FluxBound_getElementName(swigCPtr, this);
543  }
544
545  
546/**
547   * Creates and returns a deep copy of this {@link FluxBound} object.
548   <p>
549   * @return a (deep) copy of this {@link FluxBound} object.
550   */ public
551 FluxBound cloneObject() {
552    long cPtr = libsbmlJNI.FluxBound_cloneObject(swigCPtr, this);
553    return (cPtr == 0) ? null : new FluxBound(cPtr, true);
554  }
555
556  
557/**
558   * Returns the libSBML type code of this object instance.
559   <p>
560   * <p>
561 * LibSBML attaches an identifying code to every kind of SBML object.  These
562 * are integer constants known as <em>SBML type codes</em>.  The names of all
563 * the codes begin with the characters <code>SBML_</code>.
564 * In the Java language interface for libSBML, the
565 * type codes are defined as static integer constants in the interface class
566 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
567 * package plug-ins may use overlapping type codes; to identify the package
568 * to which a given object belongs, call the <code>getPackageName()</code>
569 * method on the object.
570   <p>
571   * @return the SBML type code for this object:
572   * {@link libsbmlConstants#SBML_FBC_FLUXBOUND SBML_FBC_FLUXBOUND}
573   <p>
574   * <p>
575 * @warning <span class='warning'>The specific integer values of the possible
576 * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
577 * packages,  To fully identify the correct code, <strong>it is necessary to
578 * invoke both getTypeCode() and getPackageName()</strong>.</span>
579   <p>
580   * @see #getElementName()
581   * @see #getPackageName()
582   */ public
583 int getTypeCode() {
584    return libsbmlJNI.FluxBound_getTypeCode(swigCPtr, this);
585  }
586
587  
588/** * @internal */ public
589 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
590    libsbmlJNI.FluxBound_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
591  }
592
593}