001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.7
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 Flux Balance Constraints package extends the SBML Level 3 Version 1 Core {@link Species} class with the addition of two attributes: 'charge' and 'chemicalFormula'.
016 */
017
018public class FbcSpeciesPlugin extends SBasePlugin {
019   private long swigCPtr;
020
021   protected FbcSpeciesPlugin(long cPtr, boolean cMemoryOwn)
022   {
023     super(libsbmlJNI.FbcSpeciesPlugin_SWIGUpcast(cPtr), cMemoryOwn);
024     swigCPtr = cPtr;
025   }
026
027   protected static long getCPtr(FbcSpeciesPlugin obj)
028   {
029     return (obj == null) ? 0 : obj.swigCPtr;
030   }
031
032   protected static long getCPtrAndDisown (FbcSpeciesPlugin obj)
033   {
034     long ptr = 0;
035
036     if (obj != null)
037     {
038       ptr             = obj.swigCPtr;
039       obj.swigCMemOwn = false;
040     }
041
042     return ptr;
043   }
044
045  protected void finalize() {
046    delete();
047  }
048
049  public synchronized void delete() {
050    if (swigCPtr != 0) {
051      if (swigCMemOwn) {
052        swigCMemOwn = false;
053        libsbmlJNI.delete_FbcSpeciesPlugin(swigCPtr);
054      }
055      swigCPtr = 0;
056    }
057    super.delete();
058  }
059
060  
061/**
062   * Creates a new {@link FbcSpeciesPlugin}
063   */ public
064 FbcSpeciesPlugin(String uri, String prefix, FbcPkgNamespaces fbcns) {
065    this(libsbmlJNI.new_FbcSpeciesPlugin__SWIG_0(uri, prefix, FbcPkgNamespaces.getCPtr(fbcns), fbcns), true);
066  }
067
068  
069/**
070   * Copy constructor for {@link FbcSpeciesPlugin}.
071   <p>
072   * @param orig; the {@link FbcSpeciesPlugin} instance to copy.
073   */ public
074 FbcSpeciesPlugin(FbcSpeciesPlugin orig) {
075    this(libsbmlJNI.new_FbcSpeciesPlugin__SWIG_1(FbcSpeciesPlugin.getCPtr(orig), orig), true);
076  }
077
078  
079/**
080   * Creates and returns a deep copy of this {@link FbcSpeciesPlugin} object.
081   <p>
082   * @return a (deep) copy of this {@link FbcSpeciesPlugin} object.
083   */ public
084 SBasePlugin cloneObject() {
085    long cPtr = libsbmlJNI.FbcSpeciesPlugin_cloneObject(swigCPtr, this);
086    return (cPtr == 0) ? null : new FbcSpeciesPlugin(cPtr, true);
087  }
088
089  
090/** * @internal */ public
091 SBase createObject(XMLInputStream stream) {
092  return libsbml.DowncastSBase(libsbmlJNI.FbcSpeciesPlugin_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false);
093}
094
095  
096/**
097   * Checks if this plugin object has all the required elements.
098   <p>
099   * Subclasses must override this method 
100   * if they have their specific elements.
101   <p>
102   * @return true if this plugin object has all the required elements
103   * otherwise false will be returned.
104   */ public
105 boolean hasRequiredElements() {
106    return libsbmlJNI.FbcSpeciesPlugin_hasRequiredElements(swigCPtr, this);
107  }
108
109  
110/** * @internal */ public
111 void addExpectedAttributes(SWIGTYPE_p_ExpectedAttributes attributes) {
112    libsbmlJNI.FbcSpeciesPlugin_addExpectedAttributes(swigCPtr, this, SWIGTYPE_p_ExpectedAttributes.getCPtr(attributes));
113  }
114
115  
116/** * @internal */ public
117 void readAttributes(XMLAttributes attributes, SWIGTYPE_p_ExpectedAttributes expectedAttributes) {
118    libsbmlJNI.FbcSpeciesPlugin_readAttributes(swigCPtr, this, XMLAttributes.getCPtr(attributes), attributes, SWIGTYPE_p_ExpectedAttributes.getCPtr(expectedAttributes));
119  }
120
121  
122/** * @internal */ public
123 void writeAttributes(XMLOutputStream stream) {
124    libsbmlJNI.FbcSpeciesPlugin_writeAttributes(swigCPtr, this, XMLOutputStream.getCPtr(stream), stream);
125  }
126
127  
128/**
129   * Returns the value of the 'charge' attribute of this {@link FbcSpeciesPlugin}.
130   <p>
131   * @return the value of the 'charge' attribute of this {@link FbcSpeciesPlugin} as a integer.
132   */ public
133 int getCharge() {
134    return libsbmlJNI.FbcSpeciesPlugin_getCharge(swigCPtr, this);
135  }
136
137  
138/**
139   * Returns the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin}.
140   <p>
141   * @return the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin} as a string.
142   */ public
143 String getChemicalFormula() {
144    return libsbmlJNI.FbcSpeciesPlugin_getChemicalFormula(swigCPtr, this);
145  }
146
147  
148/**
149   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
150   * {@link FbcSpeciesPlugin}'s 'charge' attribute has been set.
151   <p>
152   * @return <code>true</code> if this {@link FbcSpeciesPlugin}'s 'charge' attribute has been set,
153   * otherwise <code>false</code> is returned.
154   */ public
155 boolean isSetCharge() {
156    return libsbmlJNI.FbcSpeciesPlugin_isSetCharge(swigCPtr, this);
157  }
158
159  
160/**
161   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
162   * {@link FbcSpeciesPlugin}'s 'chemicalFormula' attribute has been set.
163   <p>
164   * @return <code>true</code> if this {@link FbcSpeciesPlugin}'s 'chemicalFormula' attribute has been set,
165   * otherwise <code>false</code> is returned.
166   */ public
167 boolean isSetChemicalFormula() {
168    return libsbmlJNI.FbcSpeciesPlugin_isSetChemicalFormula(swigCPtr, this);
169  }
170
171  
172/**
173   * Sets the value of the 'charge' attribute of this {@link FbcSpeciesPlugin}.
174   <p>
175   * @param charge; int value of the 'charge' attribute to be set
176   <p>
177   * @return integer value indicating success/failure of the
178   * function.   The possible values
179   * returned by this function are:
180   * <ul>
181   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
182   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
183   * </ul>
184   */ public
185 int setCharge(int charge) {
186    return libsbmlJNI.FbcSpeciesPlugin_setCharge(swigCPtr, this, charge);
187  }
188
189  
190/**
191   * Sets the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin}.
192   <p>
193   * @param chemicalFormula; String value of the 'chemicalFormula' attribute to be set
194   <p>
195   * @return integer value indicating success/failure of the
196   * function.   The possible values
197   * returned by this function are:
198   * <ul>
199   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
200   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
201   * </ul>
202   */ public
203 int setChemicalFormula(String chemicalFormula) {
204    return libsbmlJNI.FbcSpeciesPlugin_setChemicalFormula(swigCPtr, this, chemicalFormula);
205  }
206
207  
208/**
209   * Unsets the value of the 'charge' attribute of this {@link FbcSpeciesPlugin}.
210   <p>
211   * @return integer value indicating success/failure of the
212   * function.   The possible values
213   * returned by this function are:
214   * <ul>
215   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
216   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
217   * </ul>
218   */ public
219 int unsetCharge() {
220    return libsbmlJNI.FbcSpeciesPlugin_unsetCharge(swigCPtr, this);
221  }
222
223  
224/**
225   * Unsets the value of the 'chemicalFormula' attribute of this {@link FbcSpeciesPlugin}.
226   <p>
227   * @return integer value indicating success/failure of the
228   * function.   The possible values
229   * returned by this function are:
230   * <ul>
231   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
232   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
233   * </ul>
234   */ public
235 int unsetChemicalFormula() {
236    return libsbmlJNI.FbcSpeciesPlugin_unsetChemicalFormula(swigCPtr, this);
237  }
238
239  
240/** * @internal */ public
241 void connectToParent(SBase sbase) {
242    libsbmlJNI.FbcSpeciesPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase);
243  }
244
245  
246/** * @internal */ public
247 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
248    libsbmlJNI.FbcSpeciesPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
249  }
250
251}