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 extention to the
014 * Species construct.
015 <p>
016 * The Flux Balance Constraints package extends the SBML Level 3 Version 1 Core {@link Species} class with the addition of two attributes: 'charge' and 'chemicalFormula'.
017 */
018
019public class FbcSpeciesPlugin extends SBasePlugin {
020   private long swigCPtr;
021
022   protected FbcSpeciesPlugin(long cPtr, boolean cMemoryOwn)
023   {
024     super(libsbmlJNI.FbcSpeciesPlugin_SWIGUpcast(cPtr), cMemoryOwn);
025     swigCPtr = cPtr;
026   }
027
028   protected static long getCPtr(FbcSpeciesPlugin obj)
029   {
030     return (obj == null) ? 0 : obj.swigCPtr;
031   }
032
033   protected static long getCPtrAndDisown (FbcSpeciesPlugin 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_FbcSpeciesPlugin(swigCPtr);
055      }
056      swigCPtr = 0;
057    }
058    super.delete();
059  }
060
061  
062/**
063   * Constructor
064   */ public
065 FbcSpeciesPlugin(String uri, String prefix, FbcPkgNamespaces fbcns) {
066    this(libsbmlJNI.new_FbcSpeciesPlugin__SWIG_0(uri, prefix, FbcPkgNamespaces.getCPtr(fbcns), fbcns), true);
067  }
068
069  
070/**
071   * Copy constructor. Creates a copy of this {@link FbcSpeciesPlugin} object.
072   */ public
073 FbcSpeciesPlugin(FbcSpeciesPlugin orig) {
074    this(libsbmlJNI.new_FbcSpeciesPlugin__SWIG_1(FbcSpeciesPlugin.getCPtr(orig), orig), true);
075  }
076
077  
078/**
079   * Creates and returns a deep copy of this {@link FbcSpeciesPlugin}  object.
080   <p>
081   * @return a (deep) copy of this {@link FbcSpeciesPlugin} object
082   */ public
083 SBasePlugin cloneObject() {
084    long cPtr = libsbmlJNI.FbcSpeciesPlugin_cloneObject(swigCPtr, this);
085    return (cPtr == 0) ? null : new FbcSpeciesPlugin(cPtr, true);
086  }
087
088  
089/**
090   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
091   * {@link FbcSpeciesPlugin} 'charge' attribute has been set.
092   <p>
093   * @return <code>true</code> if this {@link FbcSpeciesPlugin} 'charge' attribute has been set,
094   * otherwise <code>false</code> is returned.
095   */ public
096 boolean isSetCharge() {
097    return libsbmlJNI.FbcSpeciesPlugin_isSetCharge(swigCPtr, this);
098  }
099
100  
101/**
102   * Sets the value of the 'charge' attribute of this {@link FbcSpeciesPlugin}.
103   <p>
104   * @return integer value indicating success/failure of the
105   * function.   The only possible value
106   * returned by this function is:
107   * <ul>
108   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
109   * </ul>
110   */ public
111 int setCharge(int charge) {
112    return libsbmlJNI.FbcSpeciesPlugin_setCharge(swigCPtr, this, charge);
113  }
114
115  
116/**
117   * Returns the value of the 'charge' attribute of this {@link FbcSpeciesPlugin}.
118   <p>
119   * @return the value of the 'charge' attribute of this {@link FbcSpeciesPlugin}.
120   */ public
121 int getCharge() {
122    return libsbmlJNI.FbcSpeciesPlugin_getCharge(swigCPtr, this);
123  }
124
125  
126/**
127   * Unsets the value of the 'charge' attribute of this {@link FbcSpeciesPlugin}.
128   <p>
129   * @return integer value indicating success/failure of the
130   * function.   The only possible value
131   * returned by this function is:
132   * <ul>
133   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
134   * </ul>
135   */ public
136 int unsetCharge() {
137    return libsbmlJNI.FbcSpeciesPlugin_unsetCharge(swigCPtr, this);
138  }
139
140  
141/**
142   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
143   * {@link FbcSpeciesPlugin} 'chemicalFormula' attribute has been set.
144   <p>
145   * @return <code>true</code> if this {@link FbcSpeciesPlugin} 'chemicalFormula' attribute has been set,
146   * otherwise <code>false</code> is returned.
147   */ public
148 boolean isSetChemicalFormula() {
149    return libsbmlJNI.FbcSpeciesPlugin_isSetChemicalFormula(swigCPtr, this);
150  }
151
152  
153/**
154   * Sets the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin}.
155   * The format of chemicalFormula must consist only of atomic names (as in the Periodic Table) or user defined compounds either of which take the form of a single capital letter followed by zero or more lowercase letters. Where there is more than a single atom present, this is indicated with an integer. With regards to order (and enhance inter-operability) it is recommended to use the Hill system order.  (However, no error-checking is performed by this routine.)
156   <p>
157   * @return integer value indicating success/failure of the
158   * function.   The only possible value
159   * returned by this function is:
160   * <ul>
161   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
162   * </ul>
163   */ public
164 int setChemicalFormula(String chemicalFormula) {
165    return libsbmlJNI.FbcSpeciesPlugin_setChemicalFormula(swigCPtr, this, chemicalFormula);
166  }
167
168  
169/**
170   * Returns the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin}.
171   <p>
172   * @return the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin}.
173   */ public
174 String getChemicalFormula() {
175    return libsbmlJNI.FbcSpeciesPlugin_getChemicalFormula(swigCPtr, this);
176  }
177
178  
179/**
180   * Unsets the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin}.
181   <p>
182   * @return integer value indicating success/failure of the
183   * function.   The only possible value
184   * returned by this function is:
185   * <ul>
186   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
187   * </ul>
188   */ public
189 int unsetChemicalFormula() {
190    return libsbmlJNI.FbcSpeciesPlugin_unsetChemicalFormula(swigCPtr, this);
191  }
192
193  
194/**
195   * Sets the parent SBML object of this plugin object to
196   * this object and child elements (if any).
197   * (Creates a child-parent relationship by this plugin object)
198   <p>
199   * This function is called when this object is created by
200   * the parent element.
201   * Subclasses must override this this function if they have one
202   * or more child elements.Also, {@link SBasePlugin#connectToParent()}
203   * must be called in the overridden function.
204   <p>
205   * @param sbase the {@link SBase} object to use
206   <p>
207   * @see setSBMLDocument
208   * @see enablePackageInternal
209   * @internal
210   */ public
211 void connectToParent(SBase sbase) {
212    libsbmlJNI.FbcSpeciesPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase);
213  }
214
215  
216/**
217   * Enables/Disables the given package with child elements in this plugin
218   * object (if any).
219   * (This is an internal implementation invoked from
220   *  {@link SBase#enablePakcageInternal()} function)
221   <p>
222   * @note Subclasses in which one or more {@link SBase} derived elements are
223   * defined must override this function.
224   <p>
225   * @see setSBMLDocument
226   * @see connectToParent
227   * @internal
228   */ public
229 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
230    libsbmlJNI.FbcSpeciesPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
231  }
232
233}