001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 2.0.11
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
011public class FbcModelPlugin extends SBasePlugin {
012   private long swigCPtr;
013
014   protected FbcModelPlugin(long cPtr, boolean cMemoryOwn)
015   {
016     super(libsbmlJNI.FbcModelPlugin_SWIGUpcast(cPtr), cMemoryOwn);
017     swigCPtr = cPtr;
018   }
019
020   protected static long getCPtr(FbcModelPlugin obj)
021   {
022     return (obj == null) ? 0 : obj.swigCPtr;
023   }
024
025   protected static long getCPtrAndDisown (FbcModelPlugin obj)
026   {
027     long ptr = 0;
028
029     if (obj != null)
030     {
031       ptr             = obj.swigCPtr;
032       obj.swigCMemOwn = false;
033     }
034
035     return ptr;
036   }
037
038  protected void finalize() {
039    delete();
040  }
041
042  public synchronized void delete() {
043    if (swigCPtr != 0) {
044      if (swigCMemOwn) {
045        swigCMemOwn = false;
046        libsbmlJNI.delete_FbcModelPlugin(swigCPtr);
047      }
048      swigCPtr = 0;
049    }
050    super.delete();
051  }
052
053  public FbcModelPlugin(String uri, String prefix, FbcPkgNamespaces fbcns) {
054    this(libsbmlJNI.new_FbcModelPlugin__SWIG_0(uri, prefix, FbcPkgNamespaces.getCPtr(fbcns), fbcns), true);
055  }
056
057  public FbcModelPlugin(FbcModelPlugin orig) {
058    this(libsbmlJNI.new_FbcModelPlugin__SWIG_1(FbcModelPlugin.getCPtr(orig), orig), true);
059  }
060
061  
062/**
063   * Creates and returns a deep copy of this {@link SBasePlugin} object.
064   * <p>
065   * @return a (deep) copy of this {@link SBase} object
066   */ public
067 SBasePlugin cloneObject() {
068    long cPtr = libsbmlJNI.FbcModelPlugin_cloneObject(swigCPtr, this);
069    return (cPtr == 0) ? null : new FbcModelPlugin(cPtr, true);
070  }
071
072  public SBase createObject(XMLInputStream stream) {
073  return libsbml.DowncastSBase(libsbmlJNI.FbcModelPlugin_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false);
074}
075
076  public void writeAttributes(XMLOutputStream stream) {
077    libsbmlJNI.FbcModelPlugin_writeAttributes(swigCPtr, this, XMLOutputStream.getCPtr(stream), stream);
078  }
079
080  public boolean hasRequiredElements() {
081    return libsbmlJNI.FbcModelPlugin_hasRequiredElements(swigCPtr, this);
082  }
083
084  public boolean readOtherXML(SBase parentObject, XMLInputStream stream) {
085    return libsbmlJNI.FbcModelPlugin_readOtherXML(swigCPtr, this, SBase.getCPtr(parentObject), parentObject, XMLInputStream.getCPtr(stream), stream);
086  }
087
088  
089/**
090   * Returns the first child element found that has the given <code>id</code> in the model-wide SId namespace, or <code>null</code> if no such object is found.
091   * <p>
092   * @param id string representing the id of objects to find
093   * <p>
094   * @return pointer to the first element found with the given <code>id</code>.
095   */ public
096 SBase getElementBySId(String id) {
097  return libsbml.DowncastSBase(libsbmlJNI.FbcModelPlugin_getElementBySId(swigCPtr, this, id), false);
098}
099
100  
101/**
102   * Returns the first child element it can find with the given <code>metaid</code>, or <code>null</code> if no such object is found.
103   * <p>
104   * @param metaid string representing the metaid of objects to find
105   * <p>
106   * @return pointer to the first element found with the given <code>metaid</code>.
107   */ public
108 SBase getElementByMetaId(String metaid) {
109  return libsbml.DowncastSBase(libsbmlJNI.FbcModelPlugin_getElementByMetaId(swigCPtr, this, metaid), false);
110}
111
112  public ListOfFluxBounds getListOfFluxBounds() {
113    long cPtr = libsbmlJNI.FbcModelPlugin_getListOfFluxBounds__SWIG_0(swigCPtr, this);
114    return (cPtr == 0) ? null : new ListOfFluxBounds(cPtr, false);
115  }
116
117  public FluxBound getFluxBound(long n) {
118    long cPtr = libsbmlJNI.FbcModelPlugin_getFluxBound__SWIG_0(swigCPtr, this, n);
119    return (cPtr == 0) ? null : new FluxBound(cPtr, false);
120  }
121
122  public FluxBound getFluxBound(String sid) {
123    long cPtr = libsbmlJNI.FbcModelPlugin_getFluxBound__SWIG_2(swigCPtr, this, sid);
124    return (cPtr == 0) ? null : new FluxBound(cPtr, false);
125  }
126
127  public int addFluxBound(FluxBound bound) {
128    return libsbmlJNI.FbcModelPlugin_addFluxBound(swigCPtr, this, FluxBound.getCPtr(bound), bound);
129  }
130
131  public FluxBound createFluxBound() {
132    long cPtr = libsbmlJNI.FbcModelPlugin_createFluxBound(swigCPtr, this);
133    return (cPtr == 0) ? null : new FluxBound(cPtr, false);
134  }
135
136  public FluxBound removeFluxBound(long n) {
137    long cPtr = libsbmlJNI.FbcModelPlugin_removeFluxBound__SWIG_0(swigCPtr, this, n);
138    return (cPtr == 0) ? null : new FluxBound(cPtr, false);
139  }
140
141  public FluxBound removeFluxBound(String sid) {
142    long cPtr = libsbmlJNI.FbcModelPlugin_removeFluxBound__SWIG_1(swigCPtr, this, sid);
143    return (cPtr == 0) ? null : new FluxBound(cPtr, false);
144  }
145
146  public long getNumFluxBounds() {
147    return libsbmlJNI.FbcModelPlugin_getNumFluxBounds(swigCPtr, this);
148  }
149
150  public ListOfObjectives getListOfObjectives() {
151    long cPtr = libsbmlJNI.FbcModelPlugin_getListOfObjectives__SWIG_0(swigCPtr, this);
152    return (cPtr == 0) ? null : new ListOfObjectives(cPtr, false);
153  }
154
155  public Objective getObjective(long n) {
156    long cPtr = libsbmlJNI.FbcModelPlugin_getObjective__SWIG_0(swigCPtr, this, n);
157    return (cPtr == 0) ? null : new Objective(cPtr, false);
158  }
159
160  public Objective getObjective(String sid) {
161    long cPtr = libsbmlJNI.FbcModelPlugin_getObjective__SWIG_2(swigCPtr, this, sid);
162    return (cPtr == 0) ? null : new Objective(cPtr, false);
163  }
164
165  public int addObjective(Objective bound) {
166    return libsbmlJNI.FbcModelPlugin_addObjective(swigCPtr, this, Objective.getCPtr(bound), bound);
167  }
168
169  public Objective createObjective() {
170    long cPtr = libsbmlJNI.FbcModelPlugin_createObjective(swigCPtr, this);
171    return (cPtr == 0) ? null : new Objective(cPtr, false);
172  }
173
174  public Objective removeObjective(long n) {
175    long cPtr = libsbmlJNI.FbcModelPlugin_removeObjective__SWIG_0(swigCPtr, this, n);
176    return (cPtr == 0) ? null : new Objective(cPtr, false);
177  }
178
179  public Objective removeObjective(String sid) {
180    long cPtr = libsbmlJNI.FbcModelPlugin_removeObjective__SWIG_1(swigCPtr, this, sid);
181    return (cPtr == 0) ? null : new Objective(cPtr, false);
182  }
183
184  public long getNumObjectives() {
185    return libsbmlJNI.FbcModelPlugin_getNumObjectives(swigCPtr, this);
186  }
187
188  public Objective getActiveObjective() {
189    long cPtr = libsbmlJNI.FbcModelPlugin_getActiveObjective__SWIG_0(swigCPtr, this);
190    return (cPtr == 0) ? null : new Objective(cPtr, false);
191  }
192
193  public int setActiveObjectiveId(String objectiveId) {
194    return libsbmlJNI.FbcModelPlugin_setActiveObjectiveId(swigCPtr, this, objectiveId);
195  }
196
197  public String getActiveObjectiveId() {
198    return libsbmlJNI.FbcModelPlugin_getActiveObjectiveId(swigCPtr, this);
199  }
200
201  public void unsetActiveObjectiveId() {
202    libsbmlJNI.FbcModelPlugin_unsetActiveObjectiveId(swigCPtr, this);
203  }
204
205  public ListOfGeneAssociations getListOfGeneAssociations() {
206    long cPtr = libsbmlJNI.FbcModelPlugin_getListOfGeneAssociations__SWIG_0(swigCPtr, this);
207    return (cPtr == 0) ? null : new ListOfGeneAssociations(cPtr, false);
208  }
209
210  public GeneAssociation getGeneAssociation(long n) {
211    long cPtr = libsbmlJNI.FbcModelPlugin_getGeneAssociation__SWIG_0(swigCPtr, this, n);
212    return (cPtr == 0) ? null : new GeneAssociation(cPtr, false);
213  }
214
215  public GeneAssociation getGeneAssociation(String sid) {
216    long cPtr = libsbmlJNI.FbcModelPlugin_getGeneAssociation__SWIG_2(swigCPtr, this, sid);
217    return (cPtr == 0) ? null : new GeneAssociation(cPtr, false);
218  }
219
220  public int addGeneAssociation(GeneAssociation association) {
221    return libsbmlJNI.FbcModelPlugin_addGeneAssociation(swigCPtr, this, GeneAssociation.getCPtr(association), association);
222  }
223
224  public GeneAssociation createGeneAssociation() {
225    long cPtr = libsbmlJNI.FbcModelPlugin_createGeneAssociation(swigCPtr, this);
226    return (cPtr == 0) ? null : new GeneAssociation(cPtr, false);
227  }
228
229  public GeneAssociation removeGeneAssociation(long n) {
230    long cPtr = libsbmlJNI.FbcModelPlugin_removeGeneAssociation__SWIG_0(swigCPtr, this, n);
231    return (cPtr == 0) ? null : new GeneAssociation(cPtr, false);
232  }
233
234  public GeneAssociation removeGeneAssociation(String sid) {
235    long cPtr = libsbmlJNI.FbcModelPlugin_removeGeneAssociation__SWIG_1(swigCPtr, this, sid);
236    return (cPtr == 0) ? null : new GeneAssociation(cPtr, false);
237  }
238
239  public int getNumGeneAssociations() {
240    return libsbmlJNI.FbcModelPlugin_getNumGeneAssociations(swigCPtr, this);
241  }
242
243  
244/**
245   * Sets the parent SBML object of this plugin object to
246   * this object and child elements (if any).
247   * (Creates a child-parent relationship by this plugin object)
248   * <p>
249   * This function is called when this object is created by
250   * the parent element.
251   * Subclasses must override this this function if they have one
252   * or more child elements. Also, {@link SBasePlugin#connectToParent(SBase sbase)}
253   * must be called in the overridden function.
254   * <p>
255   * @param sbase the {@link SBase} object to use
256   * <p>
257   * @see setSBMLDocument
258   * @see enablePackageInternal
259   * @internal
260   */ public
261 void connectToParent(SBase sbase) {
262    libsbmlJNI.FbcModelPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase);
263  }
264
265  
266/**
267   * Enables/Disables the given package with child elements in this plugin 
268   * object (if any).
269   * (This is an internal implementation invoked from 
270   *  {@link SBase#enablePackageInternal()} function)
271   * <p>
272   * Subclasses which contain one or more {@link SBase} derived elements should 
273   * override this function if elements defined in them can be extended by
274   * some other package extension.
275   * <p>
276   * @see setSBMLDocument
277   * @see connectToParent
278   * @internal
279   */ public
280 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
281    libsbmlJNI.FbcModelPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
282  }
283
284  public boolean acceptFbc(SWIGTYPE_p_FbcVisitor v) {
285    return libsbmlJNI.FbcModelPlugin_acceptFbc(swigCPtr, this, SWIGTYPE_p_FbcVisitor.getCPtr(v));
286  }
287
288  public ListOfFluxBounds getFluxBoundsForReaction(String reaction) {
289    long cPtr = libsbmlJNI.FbcModelPlugin_getFluxBoundsForReaction(swigCPtr, this, reaction);
290    return (cPtr == 0) ? null : new ListOfFluxBounds(cPtr, false);
291  }
292
293}