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-qual"><a href="group__qual.html">qual</a></span>
013
014 Base extension class for the package.
015 */
016
017public class QualExtension extends SBMLExtension {
018   private long swigCPtr;
019
020   protected QualExtension(long cPtr, boolean cMemoryOwn)
021   {
022     super(libsbmlJNI.QualExtension_SWIGUpcast(cPtr), cMemoryOwn);
023     swigCPtr = cPtr;
024   }
025
026   protected static long getCPtr(QualExtension obj)
027   {
028     return (obj == null) ? 0 : obj.swigCPtr;
029   }
030
031   protected static long getCPtrAndDisown (QualExtension obj)
032   {
033     long ptr = 0;
034
035     if (obj != null)
036     {
037       ptr             = obj.swigCPtr;
038       obj.swigCMemOwn = false;
039     }
040
041     return ptr;
042   }
043
044  protected void finalize() {
045    delete();
046  }
047
048  public synchronized void delete() {
049    if (swigCPtr != 0) {
050      if (swigCMemOwn) {
051        swigCMemOwn = false;
052        libsbmlJNI.delete_QualExtension(swigCPtr);
053      }
054      swigCPtr = 0;
055    }
056    super.delete();
057  }
058
059    /**
060         * @internal
061         */
062    public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner)
063    {
064        if (cPtr == 0) return null;
065        
066        SBasePlugin sbp = new SBasePlugin(cPtr, false);
067        SBase sb = sbp.getParentSBMLObject();
068        
069        switch( sb.getTypeCode() )
070        {
071            case (int) libsbml.SBML_MODEL:
072                return new QualModelPlugin(cPtr,owner);
073            default:
074                return new SBasePlugin(cPtr,owner);
075        }
076    }
077    
078    /**
079         * @internal
080         */
081    public SBase DowncastSBase(long cPtr, boolean owner)
082    {
083        if (cPtr == 0) return null;
084        
085        SBase sb = new SBase(cPtr, false);
086        switch( sb.getTypeCode() )
087        {
088            case (int) libsbml.SBML_LIST_OF:
089                String name = sb.getElementName();
090               if(name =="listOfFunctionTerms")
091                 {
092                   return new ListOfFunctionTerms(cPtr, owner);
093           }
094               else if(name =="listOfInputs")
095                 {
096                   return new ListOfInputs(cPtr, owner);
097           }
098               else if(name =="listOfOutputs")
099                 {
100                   return new ListOfOutputs(cPtr, owner);
101           }
102               else if(name =="listOfQualitativeSpecies")
103                 {
104                   return new ListOfQualitativeSpecies(cPtr, owner);
105           }
106               else if(name =="listOfTransitions")
107                 {
108                   return new ListOfTransitions(cPtr, owner);
109           }
110               
111               return new ListOf(cPtr, owner);
112                
113            case (int) libsbml.SBML_QUAL_QUALITATIVE_SPECIES:
114                return new QualitativeSpecies(cPtr, owner);
115                
116            case (int) libsbml.SBML_QUAL_TRANSITION:
117                return new Transition(cPtr, owner);
118                
119            case (int) libsbml.SBML_QUAL_INPUT:
120                return new Input(cPtr, owner);
121                
122            case (int) libsbml.SBML_QUAL_OUTPUT:
123                return new Output(cPtr, owner);
124                
125            case (int) libsbml.SBML_QUAL_FUNCTION_TERM:
126                return new FunctionTerm(cPtr, owner);
127                
128            case (int) libsbml.SBML_QUAL_DEFAULT_TERM:
129                return new DefaultTerm(cPtr, owner);
130                
131            default:
132                return new SBase(cPtr, owner);
133        }
134    }
135    
136    
137  
138/**
139   * Returns the nickname of the SBML Level&nbsp;3 package implemented by
140   * this libSBML extension.
141   <p>
142   * @return the package nickname, as a string.
143   <p>
144   * 
145   */ public
146 static String getPackageName() {
147    return libsbmlJNI.QualExtension_getPackageName();
148  }
149
150  
151/**
152   * Returns the default SBML Level used by this libSBML package extension.
153   <p>
154   * @return the SBML Level.
155   <p>
156   * 
157   */ public
158 static long getDefaultLevel() {
159    return libsbmlJNI.QualExtension_getDefaultLevel();
160  }
161
162  
163/**
164   * Returns the default SBML Version used by this libSBML package extension.
165   <p>
166   * @return the Version within the default SBML Level.
167   <p>
168   * 
169   */ public
170 static long getDefaultVersion() {
171    return libsbmlJNI.QualExtension_getDefaultVersion();
172  }
173
174  
175/**
176   * Returns the default version of the SBML Level&nbsp;3 package implemented
177   * by this libSBML extension.
178   <p>
179   * @return the default version number of the SBML Level&nbsp;3 package
180   * definition.
181   <p>
182   * 
183   */ public
184 static long getDefaultPackageVersion() {
185    return libsbmlJNI.QualExtension_getDefaultPackageVersion();
186  }
187
188  
189/**
190   * Returns the XML namespace URI of the SBML Level&nbsp;3 package
191   * implemented by this libSBML extension.
192   <p>
193   * @return the XML namespace as a string.
194   <p>
195   * 
196   */ public
197 static String getXmlnsL3V1V1() {
198    return libsbmlJNI.QualExtension_getXmlnsL3V1V1();
199  }
200
201  
202/**
203   * Creates a new {@link QualExtension} instance.
204   */ public
205 QualExtension() {
206    this(libsbmlJNI.new_QualExtension__SWIG_0(), true);
207  }
208
209  
210/**
211   * Copy constructor.
212   */ public
213 QualExtension(QualExtension orig) {
214    this(libsbmlJNI.new_QualExtension__SWIG_1(QualExtension.getCPtr(orig), orig), true);
215  }
216
217  
218/**
219   * Creates and returns a deep copy of this {@link QualExtension} object.
220   <p>
221   * @return a (deep) copy of this {@link SBase} object
222   */ public
223 QualExtension cloneObject() {
224    long cPtr = libsbmlJNI.QualExtension_cloneObject(swigCPtr, this);
225    return (cPtr == 0) ? null : new QualExtension(cPtr, true);
226  }
227
228  
229/**
230   * Returns the name of this package ('qual')
231   <p>
232   * @return a string representing the name of this package ('qual')
233   */ public
234 String getName() {
235    return libsbmlJNI.QualExtension_getName(swigCPtr, this);
236  }
237
238  
239/**
240   * Returns the namespace URI corresponding to the combination of the given
241   * SBML Level, Version, and package version.
242   <p>
243   * @param sbmlLevel the level of SBML
244   * @param sbmlVersion the version of SBML
245   * @param pkgVersion the version of package
246   <p>
247   * @return a string of the package URI, or an empty string if no
248   * corresponding URI exists.
249   */ public
250 String getURI(long sbmlLevel, long sbmlVersion, long pkgVersion) {
251    return libsbmlJNI.QualExtension_getURI(swigCPtr, this, sbmlLevel, sbmlVersion, pkgVersion);
252  }
253
254  
255/**
256   * Returns the SBML Level for the given URI of this package.
257   <p>
258   * @param uri a URI that represents a version of this package.
259   <p>
260   * @return the SBML Level for the given URI of this package, or <code>0</code> if the
261   * given URI is invalid.
262   */ public
263 long getLevel(String uri) {
264    return libsbmlJNI.QualExtension_getLevel(swigCPtr, this, uri);
265  }
266
267  
268/**
269   * Returns the Version within the SBML Level for the given URI of this
270   * package.
271   <p>
272   * @param uri a URI that represents a version of this package.
273   <p>
274   * @return the SBML Version within the SBML Level for the given URI of this
275   * package, or <code>0</code> if the given URI is invalid.
276   */ public
277 long getVersion(String uri) {
278    return libsbmlJNI.QualExtension_getVersion(swigCPtr, this, uri);
279  }
280
281  
282/**
283   * Returns the SBML Level&nbsp;3 package version for the given URI of this
284   * package.
285   <p>
286   * @param uri a URI that represents one of the valid versions of this
287   * package.
288   <p>
289   * @return the version of the SBML Level&nbsp;3 package with the given URI,
290   * or <code>0</code> if the given URI is invalid.
291   */ public
292 long getPackageVersion(String uri) {
293    return libsbmlJNI.QualExtension_getPackageVersion(swigCPtr, this, uri);
294  }
295
296  
297/**
298   * Returns an {@link QualPkgNamespaces} object.
299   <p>
300   * @param uri a URI that represents one of the valid versions of the
301   * &ldquo;qual&rdquo; package
302   <p>
303   * @return an QualPkgNamespace object corresponding to the given <code>uri</code>, or
304   * <code>null</code> if the URI is not defined in the Qual
305   * package.
306   */ public
307 SBMLNamespaces getSBMLExtensionNamespaces(String uri) {
308  return libsbml.DowncastSBMLNamespaces(libsbmlJNI.QualExtension_getSBMLExtensionNamespaces(swigCPtr, this, uri), false);
309}
310
311  
312/**
313   * Takes a type code of the &ldquo;qual&rdquo; package and returns a string
314   * describing the code.
315   <p>
316   * @param typeCode a libSBML type code defined by the libSBML extension
317   * implementing support for the SBML Level&nbsp;3 &ldquo;qual&rdquo; package.
318   <p>
319   * @return a text string representing the type code given by <code>typeCode</code>.
320   * If the type code is unrecognized for this implementation of the libSBML
321   * &ldquo;qual&rdquo; package, the string returned will be
322   * <code>'(Unknown SBML Qual Type)'</code>.
323   */ public
324 String getStringFromTypeCode(int typeCode) {
325    return libsbmlJNI.QualExtension_getStringFromTypeCode(swigCPtr, this, typeCode);
326  }
327
328  
329/** * @internal */ public
330 static void init() {
331    libsbmlJNI.QualExtension_init();
332  }
333
334  
335/** * @internal */ public
336 SWIGTYPE_p_packageErrorTableEntry getErrorTable(long index) {
337    return new SWIGTYPE_p_packageErrorTableEntry(libsbmlJNI.QualExtension_getErrorTable(swigCPtr, this, index), true);
338  }
339
340  
341/** * @internal */ public
342 long getErrorTableIndex(long errorId) {
343    return libsbmlJNI.QualExtension_getErrorTableIndex(swigCPtr, this, errorId);
344  }
345
346  
347/** * @internal */ public
348 long getErrorIdOffset() {
349    return libsbmlJNI.QualExtension_getErrorIdOffset(swigCPtr, this);
350  }
351
352}