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 Extension of {@link Model}.
015 <p>
016 * The extension of SBML Level 3 Core's {@link Model} class is relatively
017 * straightforward: the Qualitative Models Package adds two lists, one for
018 * holding qualitativeSpecies (ListOfQualitativeSpecies), and the other for
019 * holding transitions (ListOfTransitions).  The {@link Model} element may contain at
020 * most one {@link ListOfQualitativeSpecies}, which must contain at least one
021 * {@link QualitativeSpecies}. It may also contain at most one {@link ListOfTransitions}
022 * which must contain at least one {@link Transition}.
023 */
024
025public class QualModelPlugin extends SBasePlugin {
026   private long swigCPtr;
027
028   protected QualModelPlugin(long cPtr, boolean cMemoryOwn)
029   {
030     super(libsbmlJNI.QualModelPlugin_SWIGUpcast(cPtr), cMemoryOwn);
031     swigCPtr = cPtr;
032   }
033
034   protected static long getCPtr(QualModelPlugin obj)
035   {
036     return (obj == null) ? 0 : obj.swigCPtr;
037   }
038
039   protected static long getCPtrAndDisown (QualModelPlugin obj)
040   {
041     long ptr = 0;
042
043     if (obj != null)
044     {
045       ptr             = obj.swigCPtr;
046       obj.swigCMemOwn = false;
047     }
048
049     return ptr;
050   }
051
052  protected void finalize() {
053    delete();
054  }
055
056  public synchronized void delete() {
057    if (swigCPtr != 0) {
058      if (swigCMemOwn) {
059        swigCMemOwn = false;
060        libsbmlJNI.delete_QualModelPlugin(swigCPtr);
061      }
062      swigCPtr = 0;
063    }
064    super.delete();
065  }
066
067  
068/**
069   * Constructor
070   */ public
071 QualModelPlugin(String uri, String prefix, QualPkgNamespaces qualns) {
072    this(libsbmlJNI.new_QualModelPlugin__SWIG_0(uri, prefix, QualPkgNamespaces.getCPtr(qualns), qualns), true);
073  }
074
075  
076/**
077   * Copy constructor. Creates a copy of this {@link SBase} object.
078   */ public
079 QualModelPlugin(QualModelPlugin orig) {
080    this(libsbmlJNI.new_QualModelPlugin__SWIG_1(QualModelPlugin.getCPtr(orig), orig), true);
081  }
082
083  
084/**
085   * Creates and returns a deep copy of this {@link QualModelPlugin} object.
086   <p>
087   * @return a (deep) copy of this {@link SBase} object
088   */ public
089 SBasePlugin cloneObject() {
090    long cPtr = libsbmlJNI.QualModelPlugin_cloneObject(swigCPtr, this);
091    return (cPtr == 0) ? null : new QualModelPlugin(cPtr, true);
092  }
093
094  
095/** * @internal */ public
096 SBase createObject(XMLInputStream stream) {
097  return libsbml.DowncastSBase(libsbmlJNI.QualModelPlugin_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false);
098}
099
100  
101/** * @internal */ public
102 int appendFrom(Model model) {
103    return libsbmlJNI.QualModelPlugin_appendFrom(swigCPtr, this, Model.getCPtr(model), model);
104  }
105
106  
107/**
108   * Returns the {@link ListOfQualitativeSpecies} in this plugin object.
109   <p>
110   * @return {@link ListOfQualitativeSpecies} object in this plugin object.
111   */ public
112 ListOfQualitativeSpecies getListOfQualitativeSpecies() {
113    long cPtr = libsbmlJNI.QualModelPlugin_getListOfQualitativeSpecies__SWIG_0(swigCPtr, this);
114    return (cPtr == 0) ? null : new ListOfQualitativeSpecies(cPtr, false);
115  }
116
117  
118/**
119   * Returns the {@link QualitativeSpecies} object that belongs to the given index. If the
120   * index is invalid, null is returned.
121   <p>
122   * @param n the index number of the {@link QualitativeSpecies} to get.
123   <p>
124   * @return the nth {@link QualitativeSpecies} in the {@link ListOfQualitativeSpecies}.
125   */ public
126 QualitativeSpecies getQualitativeSpecies(long n) {
127    long cPtr = libsbmlJNI.QualModelPlugin_getQualitativeSpecies__SWIG_0(swigCPtr, this, n);
128    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, false);
129  }
130
131  
132/**
133   * Returns the qualitativeSpecies object based on its identifier.
134   <p>
135   * @param sid a string representing the identifier 
136   * of the {@link QualitativeSpecies} to get.
137   <p>
138   * @return {@link QualitativeSpecies} in the {@link ListOfQualitativeSpecies} with the given id
139   * or null if no such {@link QualitativeSpecies} exists.
140   <p>
141   * @see #getQualitativeSpecies(long n)
142   * @see #getListOfQualitativeSpecies()
143   */ public
144 QualitativeSpecies getQualitativeSpecies(String sid) {
145    long cPtr = libsbmlJNI.QualModelPlugin_getQualitativeSpecies__SWIG_2(swigCPtr, this, sid);
146    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, false);
147  }
148
149  
150/**
151   * Adds a copy of the given {@link QualitativeSpecies} object to the list of qual.
152   <p>
153   * @param qualitativeSpecies the {@link QualitativeSpecies} object to be added to the list of qual.
154   <p>
155   * <p>
156 * @return integer value indicating success/failure of the
157 * function.   The possible values
158 * returned by this function are:
159   * <ul>
160   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
161   * </ul>
162   */ public
163 int addQualitativeSpecies(QualitativeSpecies qualitativeSpecies) {
164    return libsbmlJNI.QualModelPlugin_addQualitativeSpecies(swigCPtr, this, QualitativeSpecies.getCPtr(qualitativeSpecies), qualitativeSpecies);
165  }
166
167  
168/**
169   * Creates a new qual object and adds it to the list of qual objects
170   * and returns it.
171   <p>
172   * @return a newly created {@link QualitativeSpecies} object
173   */ public
174 QualitativeSpecies createQualitativeSpecies() {
175    long cPtr = libsbmlJNI.QualModelPlugin_createQualitativeSpecies(swigCPtr, this);
176    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, false);
177  }
178
179  
180/**
181   * Removes the nth {@link QualitativeSpecies} object from this plugin object and
182   * returns a pointer to it.
183   <p>
184   * The caller owns the returned object and is responsible for
185   *  deleting it.
186   <p>
187   * @param n the index of the {@link QualitativeSpecies} object to remove
188   <p>
189   * @return the {@link QualitativeSpecies} object removed.  As mentioned above, the 
190   * caller owns the returned object. null is returned if the 
191   * given index is out of range.
192   */ public
193 QualitativeSpecies removeQualitativeSpecies(long n) {
194    long cPtr = libsbmlJNI.QualModelPlugin_removeQualitativeSpecies__SWIG_0(swigCPtr, this, n);
195    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, true);
196  }
197
198  
199/**
200   * Removes the {@link QualitativeSpecies} object with the given id attribute from 
201   * this plugin object and returns a pointer to it.
202   <p>
203   * The caller owns the returned object and is responsible for
204   * deleting it.
205   <p>
206   * @param sid the id attribute of the {@link QualitativeSpecies} object to remove
207   <p>
208   * @return the {@link QualitativeSpecies} object removed.  As mentioned above, the 
209   * caller owns the returned object. null is returned if the 
210   * given index is out of range.
211   */ public
212 QualitativeSpecies removeQualitativeSpecies(String sid) {
213    long cPtr = libsbmlJNI.QualModelPlugin_removeQualitativeSpecies__SWIG_1(swigCPtr, this, sid);
214    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, true);
215  }
216
217  
218/**
219   * Returns the number of {@link QualitativeSpecies} object in this plugin object.
220   <p>
221   * @return the number of {@link QualitativeSpecies} object in this plugin object.
222   */ public
223 long getNumQualitativeSpecies() {
224    return libsbmlJNI.QualModelPlugin_getNumQualitativeSpecies(swigCPtr, this);
225  }
226
227  
228/**
229   * Returns the {@link ListOfTransitions} in this plugin object.
230   <p>
231   * @return {@link ListOfTransitions} object in this plugin object.
232   */ public
233 ListOfTransitions getListOfTransitions() {
234    long cPtr = libsbmlJNI.QualModelPlugin_getListOfTransitions__SWIG_0(swigCPtr, this);
235    return (cPtr == 0) ? null : new ListOfTransitions(cPtr, false);
236  }
237
238  
239/**
240   * Returns the {@link Transition} object that belongs to the given index. If the
241   * index is invalid, null is returned.
242   <p>
243   * @param n the index number of the {@link Transition} to get.
244   <p>
245   * @return the nth {@link Transition} in the {@link ListOfTransitions}.
246   */ public
247 Transition getTransition(long n) {
248    long cPtr = libsbmlJNI.QualModelPlugin_getTransition__SWIG_0(swigCPtr, this, n);
249    return (cPtr == 0) ? null : new Transition(cPtr, false);
250  }
251
252  
253/**
254   * Returns the qualitativeSpecies object based on its identifier.
255   <p>
256   * @param sid a string representing the identifier 
257   * of the {@link Transition} to get.
258   <p>
259   * @return {@link Transition} in the {@link ListOfTransitions} with the given id
260   * or null if no such {@link Transition} exists.
261   <p>
262   * @see #getTransition(long n)
263   * @see #getListOfTransitions()
264   */ public
265 Transition getTransition(String sid) {
266    long cPtr = libsbmlJNI.QualModelPlugin_getTransition__SWIG_2(swigCPtr, this, sid);
267    return (cPtr == 0) ? null : new Transition(cPtr, false);
268  }
269
270  
271/**
272   * Adds a copy of the given {@link Transition} object to the list of qual.
273   <p>
274   * @param transition the {@link Transition} object to be added to the list of qual.
275   <p>
276   * <p>
277 * @return integer value indicating success/failure of the
278 * function.   The possible values
279 * returned by this function are:
280   * <ul>
281   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
282   * </ul>
283   */ public
284 int addTransition(Transition transition) {
285    return libsbmlJNI.QualModelPlugin_addTransition(swigCPtr, this, Transition.getCPtr(transition), transition);
286  }
287
288  
289/**
290   * Creates a new qual object and adds it to the list of qual objects
291   * and returns it.
292   <p>
293   * @return a newly created {@link Transition} object
294   */ public
295 Transition createTransition() {
296    long cPtr = libsbmlJNI.QualModelPlugin_createTransition(swigCPtr, this);
297    return (cPtr == 0) ? null : new Transition(cPtr, false);
298  }
299
300  
301/**
302   * Removes the nth {@link Transition} object from this plugin object and
303   * returns a pointer to it.
304   <p>
305   * The caller owns the returned object and is responsible for
306   *  deleting it.
307   <p>
308   * @param n the index of the {@link Transition} object to remove
309   <p>
310   * @return the {@link Transition} object removed.  As mentioned above, the 
311   * caller owns the returned object. null is returned if the 
312   * given index is out of range.
313   */ public
314 Transition removeTransition(long n) {
315    long cPtr = libsbmlJNI.QualModelPlugin_removeTransition__SWIG_0(swigCPtr, this, n);
316    return (cPtr == 0) ? null : new Transition(cPtr, true);
317  }
318
319  
320/**
321   * Removes the {@link Transition} object with the given id attribute from 
322   * this plugin object and returns a pointer to it.
323   <p>
324   * The caller owns the returned object and is responsible for
325   * deleting it.
326   <p>
327   * @param sid the id attribute of the {@link Transition} object to remove
328   <p>
329   * @return the {@link Transition} object removed.  As mentioned above, the 
330   * caller owns the returned object. null is returned if the 
331   * given index is out of range.
332   */ public
333 Transition removeTransition(String sid) {
334    long cPtr = libsbmlJNI.QualModelPlugin_removeTransition__SWIG_1(swigCPtr, this, sid);
335    return (cPtr == 0) ? null : new Transition(cPtr, true);
336  }
337
338  
339/**
340   * Returns the number of {@link Transition} object in this plugin object.
341   <p>
342   * @return the number of {@link Transition} object in this plugin object.
343   */ public
344 long getNumTransitions() {
345    return libsbmlJNI.QualModelPlugin_getNumTransitions(swigCPtr, this);
346  }
347
348  
349/** * @internal */ public
350 void connectToChild() {
351    libsbmlJNI.QualModelPlugin_connectToChild(swigCPtr, this);
352  }
353
354  
355/** * @internal */ public
356 void connectToParent(SBase sbase) {
357    libsbmlJNI.QualModelPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase);
358  }
359
360  
361/** * @internal */ public
362 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
363    libsbmlJNI.QualModelPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
364  }
365
366}