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 Extension of {@link Species}.
014 <p>
015 * The {@link FbcSpeciesPlugin} class codifies an extension of the core SBML {@link Species}
016 * class defined in the SBML Level&nbsp;3 <a href='../../../extensions-summary.html#fbc'>Flux Balance Constraints</a> (&ldquo;fbc&rdquo;)
017 * package.  The &ldquo;fbc&rdquo; package adds two attributes named 'charge'
018 * and 'chemicalFormula' to {@link Species}.
019 <p>
020 * The optional attribute 'charge' can contain a signed integer that refers
021 * to the {@link Species} object's electrical charge (in terms of electrons, not the
022 * SI unit of coulombs).  Note that this attribute is therefore defined as it
023 * is in the SBML Level&nbsp;2 Version&nbsp;1 specification.  (The charge
024 * attribute was removed in higher Versions and Levels of SBML, and is not an
025 * attribute of SBML {@link Species} in core SBML Level&nbsp;3.  However, it is
026 * useful for flux balance constraints models, and thus, the Level&nbsp;3
027 * &ldquo;fbc&rdquo; package adds it.)
028 <p>
029 * The optional attribute 'chemicalFormula' can contain a text string that
030 * represents the elemental composition of the substance represented by the
031 * {@link Species} object.  The purpose of the 'chemicalFormula' attribute is to
032 * allow balancing and validating reactions.  This is particularly important
033 * in constraint-based models.  The format of 'chemicalFormula' must consist
034 * only of atomic names (as given in the Periodic Table of elements) or
035 * user-defined compounds, either of which take the form of a single capital
036 * letter followed by zero or more lowercase letters.  Where there is more
037 * than a single atom present, this is indicated with an integer.  With
038 * regards to order (and to enhance interoperability of models), users are
039 * advised to employ the <a href='https://en.wikipedia.org/wiki/Hill_system'>Hill system order</a>.
040 * Using this notation, the number of carbon atoms in a molecule is indicated
041 * first, followed by the number of hydrogen atoms, and then the number of
042 * all other chemical elements in alphabetical order.  When the formula
043 * contains no carbon, all elements including hydrogen are listed
044 * alphabetically.
045 <p>
046 * Here is an example of the XML form of an extended {@link Species} definition with
047 * these attributes:
048 * <pre class='fragment'>
049&lt;species metaid='meta_M_atp_c' id='M_atp_c' name='ATP' compartment='Cytosol'
050boundaryCondition='false' initialConcentration='0' hasOnlySubstanceUnits='false'
051fbc:charge='-4' fbc:chemicalFormula='C10H12N5O13P3'/&gt;
052</pre>
053 */
054
055public class FbcSpeciesPlugin extends SBasePlugin {
056   private long swigCPtr;
057
058   protected FbcSpeciesPlugin(long cPtr, boolean cMemoryOwn)
059   {
060     super(libsbmlJNI.FbcSpeciesPlugin_SWIGUpcast(cPtr), cMemoryOwn);
061     swigCPtr = cPtr;
062   }
063
064   protected static long getCPtr(FbcSpeciesPlugin obj)
065   {
066     return (obj == null) ? 0 : obj.swigCPtr;
067   }
068
069   protected static long getCPtrAndDisown (FbcSpeciesPlugin obj)
070   {
071     long ptr = 0;
072
073     if (obj != null)
074     {
075       ptr             = obj.swigCPtr;
076       obj.swigCMemOwn = false;
077     }
078
079     return ptr;
080   }
081
082  protected void finalize() {
083    delete();
084  }
085
086  public synchronized void delete() {
087    if (swigCPtr != 0) {
088      if (swigCMemOwn) {
089        swigCMemOwn = false;
090        libsbmlJNI.delete_FbcSpeciesPlugin(swigCPtr);
091      }
092      swigCPtr = 0;
093    }
094    super.delete();
095  }
096
097  
098/**
099   * Creates a new {@link FbcSpeciesPlugin}
100   */ public
101 FbcSpeciesPlugin(String uri, String prefix, FbcPkgNamespaces fbcns) {
102    this(libsbmlJNI.new_FbcSpeciesPlugin__SWIG_0(uri, prefix, FbcPkgNamespaces.getCPtr(fbcns), fbcns), true);
103  }
104
105  
106/**
107   * Copy constructor for {@link FbcSpeciesPlugin}.
108   <p>
109   * @param orig; the {@link FbcSpeciesPlugin} instance to copy.
110   */ public
111 FbcSpeciesPlugin(FbcSpeciesPlugin orig) {
112    this(libsbmlJNI.new_FbcSpeciesPlugin__SWIG_1(FbcSpeciesPlugin.getCPtr(orig), orig), true);
113  }
114
115  
116/**
117   * Creates and returns a deep copy of this {@link FbcSpeciesPlugin} object.
118   <p>
119   * @return a (deep) copy of this {@link FbcSpeciesPlugin} object.
120   */ public
121 SBasePlugin cloneObject() {
122    long cPtr = libsbmlJNI.FbcSpeciesPlugin_cloneObject(swigCPtr, this);
123    return (cPtr == 0) ? null : new FbcSpeciesPlugin(cPtr, true);
124  }
125
126  
127/** * @internal */ public
128 SBase createObject(XMLInputStream stream) {
129  return libsbml.DowncastSBase(libsbmlJNI.FbcSpeciesPlugin_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false);
130}
131
132  
133/** * @internal */ public
134 void addExpectedAttributes(SWIGTYPE_p_ExpectedAttributes attributes) {
135    libsbmlJNI.FbcSpeciesPlugin_addExpectedAttributes(swigCPtr, this, SWIGTYPE_p_ExpectedAttributes.getCPtr(attributes));
136  }
137
138  
139/** * @internal */ public
140 void readAttributes(XMLAttributes attributes, SWIGTYPE_p_ExpectedAttributes expectedAttributes) {
141    libsbmlJNI.FbcSpeciesPlugin_readAttributes(swigCPtr, this, XMLAttributes.getCPtr(attributes), attributes, SWIGTYPE_p_ExpectedAttributes.getCPtr(expectedAttributes));
142  }
143
144  
145/** * @internal */ public
146 void writeAttributes(XMLOutputStream stream) {
147    libsbmlJNI.FbcSpeciesPlugin_writeAttributes(swigCPtr, this, XMLOutputStream.getCPtr(stream), stream);
148  }
149
150  
151/**
152   * Returns the value of the 'charge' attribute of this {@link FbcSpeciesPlugin}.
153   <p>
154   * @return the value of the 'charge' attribute of this {@link FbcSpeciesPlugin} as a integer.
155   */ public
156 int getCharge() {
157    return libsbmlJNI.FbcSpeciesPlugin_getCharge(swigCPtr, this);
158  }
159
160  
161/**
162   * Returns the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin}.
163   <p>
164   * @return the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin} as a string.
165   */ public
166 String getChemicalFormula() {
167    return libsbmlJNI.FbcSpeciesPlugin_getChemicalFormula(swigCPtr, this);
168  }
169
170  
171/**
172   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
173   * {@link FbcSpeciesPlugin}'s 'charge' attribute has been set.
174   <p>
175   * @return <code>true</code> if this {@link FbcSpeciesPlugin}'s 'charge' attribute has been set,
176   * otherwise <code>false</code> is returned.
177   */ public
178 boolean isSetCharge() {
179    return libsbmlJNI.FbcSpeciesPlugin_isSetCharge(swigCPtr, this);
180  }
181
182  
183/**
184   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
185   * {@link FbcSpeciesPlugin}'s 'chemicalFormula' attribute has been set.
186   <p>
187   * @return <code>true</code> if this {@link FbcSpeciesPlugin}'s 'chemicalFormula' attribute has been set,
188   * otherwise <code>false</code> is returned.
189   */ public
190 boolean isSetChemicalFormula() {
191    return libsbmlJNI.FbcSpeciesPlugin_isSetChemicalFormula(swigCPtr, this);
192  }
193
194  
195/**
196   * Sets the value of the 'charge' attribute of this {@link FbcSpeciesPlugin}.
197   <p>
198   * @param charge; int value of the 'charge' attribute to be set
199   <p>
200   * @return integer value indicating success/failure of the
201   * function.   The possible values
202   * returned by this function are:
203   * <ul>
204   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
205   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
206   * </ul>
207   */ public
208 int setCharge(int charge) {
209    return libsbmlJNI.FbcSpeciesPlugin_setCharge(swigCPtr, this, charge);
210  }
211
212  
213/**
214   * Sets the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin}.
215   <p>
216   * @param chemicalFormula; String value of the 'chemicalFormula' attribute to be set
217   <p>
218   * @return integer value indicating success/failure of the
219   * function.   The possible values
220   * returned by this function are:
221   * <ul>
222   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
223   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
224   * </ul>
225   */ public
226 int setChemicalFormula(String chemicalFormula) {
227    return libsbmlJNI.FbcSpeciesPlugin_setChemicalFormula(swigCPtr, this, chemicalFormula);
228  }
229
230  
231/**
232   * Unsets the value of the 'charge' attribute of this {@link FbcSpeciesPlugin}.
233   <p>
234   * @return integer value indicating success/failure of the
235   * function.   The possible values
236   * returned by this function are:
237   * <ul>
238   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
239   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
240   * </ul>
241   */ public
242 int unsetCharge() {
243    return libsbmlJNI.FbcSpeciesPlugin_unsetCharge(swigCPtr, this);
244  }
245
246  
247/**
248   * Unsets the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin}.
249   <p>
250   * @return integer value indicating success/failure of the
251   * function.   The possible values
252   * returned by this function are:
253   * <ul>
254   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
255   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
256   * </ul>
257   */ public
258 int unsetChemicalFormula() {
259    return libsbmlJNI.FbcSpeciesPlugin_unsetChemicalFormula(swigCPtr, this);
260  }
261
262  
263/** * @internal */ public
264 void connectToParent(SBase sbase) {
265    libsbmlJNI.FbcSpeciesPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase);
266  }
267
268  
269/** * @internal */ public
270 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
271    libsbmlJNI.FbcSpeciesPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
272  }
273
274}