001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.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 Base extension class for the &ldquo;fbc&rdquo; package.
014 <p>
015 * <p style='color: #777; font-style: italic'>
016This class of objects is defined by libSBML only and has no direct
017equivalent in terms of SBML components.  This class is not prescribed by
018the SBML specifications, although it is used to implement features
019defined in SBML.
020</p>
021
022 */
023
024public class FbcExtension extends SBMLExtension {
025   private long swigCPtr;
026
027   protected FbcExtension(long cPtr, boolean cMemoryOwn)
028   {
029     super(libsbmlJNI.FbcExtension_SWIGUpcast(cPtr), cMemoryOwn);
030     swigCPtr = cPtr;
031   }
032
033   protected static long getCPtr(FbcExtension obj)
034   {
035     return (obj == null) ? 0 : obj.swigCPtr;
036   }
037
038   protected static long getCPtrAndDisown (FbcExtension obj)
039   {
040     long ptr = 0;
041
042     if (obj != null)
043     {
044       ptr             = obj.swigCPtr;
045       obj.swigCMemOwn = false;
046     }
047
048     return ptr;
049   }
050
051  protected void finalize() {
052    delete();
053  }
054
055  public synchronized void delete() {
056    if (swigCPtr != 0) {
057      if (swigCMemOwn) {
058        swigCMemOwn = false;
059        libsbmlJNI.delete_FbcExtension(swigCPtr);
060      }
061      swigCPtr = 0;
062    }
063    super.delete();
064  }
065
066    /**
067         * @internal
068         */
069  public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner)
070  {
071    if (cPtr == 0) return null;
072
073    SBasePlugin sbp = new SBasePlugin(cPtr, false);
074    SBase sb = sbp.getParentSBMLObject();
075
076    if (sb instanceof Model)
077    {
078      return new FbcModelPlugin(cPtr, owner);
079    }
080    
081    switch( sb.getTypeCode() )
082    {
083      case (int) libsbml.SBML_SPECIES:
084        return new FbcSpeciesPlugin(cPtr, owner);
085
086      case (int) libsbml.SBML_MODEL:
087        return new FbcModelPlugin(cPtr, owner);
088
089      case (int) libsbml.SBML_REACTION:
090        return new FbcReactionPlugin(cPtr, owner);
091
092      case (int) libsbml.SBML_DOCUMENT:
093        return new FbcSBMLDocumentPlugin(cPtr, owner);
094        
095      default:
096        return new SBasePlugin(cPtr, owner);
097    }
098  }
099
100    /**
101         * @internal
102         */
103  public SBase DowncastSBase(long cPtr, boolean owner)
104  {
105    if (cPtr == 0) return null;
106
107    SBase sb = new SBase(cPtr, false);
108    switch( sb.getTypeCode() )
109    {
110      case (int) libsbml.SBML_LIST_OF:
111        String name = sb.getElementName();
112        if (name.equals("listOfFbcAssociations"))
113        {
114          return new ListOfFbcAssociations(cPtr, owner);
115        }
116        else if(name.equals("listOfFluxBounds"))
117                 {
118                    return new ListOfFluxBounds(cPtr, owner);
119                 }
120        else if (name.equals("listOfFluxes") || name.equals("listOfFluxObjectives"))
121        {
122          return new ListOfFluxObjectives(cPtr, owner);
123        }
124        else if(name.equals("listOfGeneAssociations"))
125                 {
126                    return new ListOfGeneAssociations(cPtr, owner);
127                 }
128        else if (name.equals("listOfObjectives"))
129        {
130          return new ListOfObjectives(cPtr, owner);
131        }
132        else if (name.equals("listOfGeneProducts"))
133        {
134          return new ListOfGeneProducts(cPtr, owner);
135        }
136
137        return new ListOf(cPtr, owner);
138
139      case (int) libsbml.SBML_FBC_ASSOCIATION:
140        return new FbcAssociation(cPtr, owner);
141
142            case (int) libsbml.SBML_FBC_V1ASSOCIATION:
143                return new Association(cPtr, owner);
144                
145            case (int) libsbml.SBML_FBC_FLUXBOUND:
146                return new FluxBound(cPtr, owner);
147
148      case (int) libsbml.SBML_FBC_FLUXOBJECTIVE:
149        return new FluxObjective(cPtr, owner);
150
151      case (int) libsbml.SBML_FBC_GENEPRODUCTASSOCIATION:
152        return new GeneProductAssociation(cPtr, owner);
153
154            case (int) libsbml.SBML_FBC_GENEASSOCIATION:
155                return new GeneAssociation(cPtr, owner);
156                
157      case (int) libsbml.SBML_FBC_OBJECTIVE:
158        return new Objective(cPtr, owner);
159
160      case (int) libsbml.SBML_FBC_GENEPRODUCT:
161        return new GeneProduct(cPtr, owner);
162
163      case (int) libsbml.SBML_FBC_GENEPRODUCTREF:
164        return new GeneProductRef(cPtr, owner);
165
166      case (int) libsbml.SBML_FBC_AND:
167        return new FbcAnd(cPtr, owner);
168
169      case (int) libsbml.SBML_FBC_OR:
170        return new FbcOr(cPtr, owner);
171
172      default:
173        return new SBase(cPtr, owner);
174    }
175  }
176
177
178  
179/**
180   * Returns the nickname of the SBML Level&nbsp;3 package implemented by
181   * this libSBML extension.
182   <p>
183   * @return the package nickname, as a string.
184   <p>
185   * 
186   */ public
187 static String getPackageName() {
188    return libsbmlJNI.FbcExtension_getPackageName();
189  }
190
191  
192/**
193   * Returns the default SBML Level used by this libSBML package extension.
194   <p>
195   * @return the SBML Level.
196   <p>
197   * 
198   */ public
199 static long getDefaultLevel() {
200    return libsbmlJNI.FbcExtension_getDefaultLevel();
201  }
202
203  
204/**
205   * Returns the default SBML Version used by this libSBML package extension.
206   <p>
207   * @return the Version within the default SBML Level.
208   <p>
209   * 
210   */ public
211 static long getDefaultVersion() {
212    return libsbmlJNI.FbcExtension_getDefaultVersion();
213  }
214
215  
216/**
217   * Returns the default version of the SBML Level&nbsp;3 package implemented
218   * by this libSBML extension.
219   <p>
220   * @return the default version number of the SBML Level&nbsp;3 package
221   * definition.
222   <p>
223   * 
224   */ public
225 static long getDefaultPackageVersion() {
226    return libsbmlJNI.FbcExtension_getDefaultPackageVersion();
227  }
228
229  
230/**
231   * Returns the XML namespace URI of the SBML Level&nbsp;3 package
232   * implemented by this libSBML extension.
233   <p>
234   * @return the XML namespace as a string.
235   <p>
236   * 
237   */ public
238 static String getXmlnsL3V1V1() {
239    return libsbmlJNI.FbcExtension_getXmlnsL3V1V1();
240  }
241
242  
243/**
244   * Returns the XML namespace URI of the SBML Level&nbsp;3 package
245   * implemented by this libSBML extension.
246   <p>
247   * @return the XML namespace as a string.
248   <p>
249   * 
250   */ public
251 static String getXmlnsL3V1V2() {
252    return libsbmlJNI.FbcExtension_getXmlnsL3V1V2();
253  }
254
255  
256/**
257   * Creates a new {@link FbcExtension} instance.
258   */ public
259 FbcExtension() {
260    this(libsbmlJNI.new_FbcExtension__SWIG_0(), true);
261  }
262
263  
264/**
265   * Copy constructor for {@link FbcExtension}.
266   <p>
267   * @param orig the {@link FbcExtension} instance to copy.
268   */ public
269 FbcExtension(FbcExtension orig) {
270    this(libsbmlJNI.new_FbcExtension__SWIG_1(FbcExtension.getCPtr(orig), orig), true);
271  }
272
273  
274/**
275   * Creates and returns a deep copy of this {@link FbcExtension} object.
276   <p>
277   * @return a (deep) copy of this {@link FbcExtension} object.
278   */ public
279 FbcExtension cloneObject() {
280    long cPtr = libsbmlJNI.FbcExtension_cloneObject(swigCPtr, this);
281    return (cPtr == 0) ? null : new FbcExtension(cPtr, true);
282  }
283
284  
285/**
286   * Returns the name of this SBML Level&nbsp;3 package ('fbc').
287   <p>
288   * @return a string representing the name of this package ('fbc').
289   */ public
290 String getName() {
291    return libsbmlJNI.FbcExtension_getName(swigCPtr, this);
292  }
293
294  
295/**
296   * Returns a string representing the SBML XML namespace of this
297   * SBML Level&nbsp;3 package.
298   <p>
299   * The namespace URI constructed by this method corresponds to the
300   * combination of the Level and Version of SBML, and the Version of the
301   * SBML Level&nbsp;3 package.  (At the time of this writing, the only SBML
302   * Level that supports packages is Level&nbsp;3, so the value of
303   * <code>sbmlLevel</code> must necessarily always be <code>3</code>.)
304   <p>
305   * @param sbmlLevel the level of SBML.
306   * @param sbmlVersion the version of SBML.
307   * @param pkgVersion the version of the package.
308   <p>
309   * @return a string representing the package URI, or an empty string if no
310   * corresponding URI exists.
311   */ public
312 String getURI(long sbmlLevel, long sbmlVersion, long pkgVersion) {
313    return libsbmlJNI.FbcExtension_getURI(swigCPtr, this, sbmlLevel, sbmlVersion, pkgVersion);
314  }
315
316  
317/**
318   * Returns the SBML Level for the given URI of this package.
319   <p>
320   * @param uri a URI that represents a version of this package.
321   <p>
322   * @return the SBML Level for the given URI of this package, or <code>0</code> if the
323   * given URI is invalid, or for a different package.
324   */ public
325 long getLevel(String uri) {
326    return libsbmlJNI.FbcExtension_getLevel(swigCPtr, this, uri);
327  }
328
329  
330/**
331   * Returns the Version within the SBML Level for the given URI of this
332   * package.
333   <p>
334   * @param uri a URI that represents a version of this package.
335   <p>
336   * @return the SBML Version within the SBML Level for the given URI of this
337   * package, or <code>0</code> if the given URI is invalid, or for a different package.
338   */ public
339 long getVersion(String uri) {
340    return libsbmlJNI.FbcExtension_getVersion(swigCPtr, this, uri);
341  }
342
343  
344/**
345   * Returns the SBML Level&nbsp;3 package version for the given URI of this
346   * package.
347   <p>
348   * @param uri a URI that represents one of the valid versions of this
349   * package.
350   <p>
351   * @return the version of the SBML Level&nbsp;3 package with the given URI,
352   * or <code>0</code> if the given URI is invalid, or for a different package.
353   */ public
354 long getPackageVersion(String uri) {
355    return libsbmlJNI.FbcExtension_getPackageVersion(swigCPtr, this, uri);
356  }
357
358  
359/**
360   * Returns an {@link FbcPkgNamespaces} object.
361   <p>
362   * @param uri a URI that represents one of the valid versions of the
363   * &ldquo;fbc&rdquo; package.
364   <p>
365   * @return an FbcPkgNamespace object corresponding to the given <code>uri</code>, or
366   * <code>null</code> if the URI is not defined in the &ldquo;fbc&rdquo; package.
367   */ public
368 SBMLNamespaces getSBMLExtensionNamespaces(String uri) {
369  return libsbml.DowncastSBMLNamespaces(libsbmlJNI.FbcExtension_getSBMLExtensionNamespaces(swigCPtr, this, uri), false);
370}
371
372  
373/**
374   * Takes a type code of the &ldquo;fbc&rdquo; package and returns a string
375   * describing the code.
376   <p>
377   * @param typeCode a libSBML type code defined by the libSBML extension
378   * implementing support for the SBML Level&nbsp;3 &ldquo;fbc&rdquo; package.
379   <p>
380   * @return a text string representing the type code given by <code>typeCode</code>.
381   * If the type code is unrecognized for this implementation of the libSBML
382   * &ldquo;fbc&rdquo; package, the string returned will be
383   * <code>'(Unknown SBML Fbc Type)'</code>.
384   */ public
385 String getStringFromTypeCode(int typeCode) {
386    return libsbmlJNI.FbcExtension_getStringFromTypeCode(swigCPtr, this, typeCode);
387  }
388
389  
390/** * @internal */ public
391 static void init() {
392    libsbmlJNI.FbcExtension_init();
393  }
394
395  
396/** * @internal */ public
397 SWIGTYPE_p_packageErrorTableEntryV2 getErrorTableV2(long index) {
398    return new SWIGTYPE_p_packageErrorTableEntryV2(libsbmlJNI.FbcExtension_getErrorTableV2(swigCPtr, this, index), true);
399  }
400
401  
402/** * @internal */ public
403 long getErrorTableIndex(long errorId) {
404    return libsbmlJNI.FbcExtension_getErrorTableIndex(swigCPtr, this, errorId);
405  }
406
407  
408/** * @internal */ public
409 long getErrorIdOffset() {
410    return libsbmlJNI.FbcExtension_getErrorIdOffset(swigCPtr, this);
411  }
412
413  
414/** * @internal */ public
415 boolean hasMultipleVersions() {
416    return libsbmlJNI.FbcExtension_hasMultipleVersions(swigCPtr, this);
417  }
418
419}