001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.8
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 boolean hasRequiredElements() {
103    return libsbmlJNI.QualModelPlugin_hasRequiredElements(swigCPtr, this);
104  }
105
106  
107/** * @internal */ public
108 int appendFrom(Model model) {
109    return libsbmlJNI.QualModelPlugin_appendFrom(swigCPtr, this, Model.getCPtr(model), model);
110  }
111
112  
113/**
114   * Returns the {@link ListOfQualitativeSpecies} in this plugin object.
115   <p>
116   * @return {@link ListOfQualitativeSpecies} object in this plugin object.
117   */ public
118 ListOfQualitativeSpecies getListOfQualitativeSpecies() {
119    long cPtr = libsbmlJNI.QualModelPlugin_getListOfQualitativeSpecies__SWIG_0(swigCPtr, this);
120    return (cPtr == 0) ? null : new ListOfQualitativeSpecies(cPtr, false);
121  }
122
123  
124/**
125   * Returns the {@link QualitativeSpecies} object that belongs to the given index. If the
126   * index is invalid, null is returned.
127   <p>
128   * @param n the index number of the {@link QualitativeSpecies} to get.
129   <p>
130   * @return the nth {@link QualitativeSpecies} in the {@link ListOfQualitativeSpecies}.
131   */ public
132 QualitativeSpecies getQualitativeSpecies(long n) {
133    long cPtr = libsbmlJNI.QualModelPlugin_getQualitativeSpecies__SWIG_0(swigCPtr, this, n);
134    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, false);
135  }
136
137  
138/**
139   * Returns the qualitativeSpecies object based on its identifier.
140   <p>
141   * @param sid a string representing the identifier 
142   * of the {@link QualitativeSpecies} to get.
143   <p>
144   * @return {@link QualitativeSpecies} in the {@link ListOfQualitativeSpecies} with the given id
145   * or null if no such {@link QualitativeSpecies} exists.
146   <p>
147   * @see #getQualitativeSpecies(long n)
148   * @see #getListOfQualitativeSpecies()
149   */ public
150 QualitativeSpecies getQualitativeSpecies(String sid) {
151    long cPtr = libsbmlJNI.QualModelPlugin_getQualitativeSpecies__SWIG_2(swigCPtr, this, sid);
152    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, false);
153  }
154
155  
156/**
157   * Adds a copy of the given {@link QualitativeSpecies} object to the list of qual.
158   <p>
159   * @param qualitativeSpecies the {@link QualitativeSpecies} object to be added to the list of qual.
160   <p>
161   * <p>
162 * @return integer value indicating success/failure of the
163 * function.   The possible values
164 * returned by this function are:
165   * <ul>
166   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
167   * </ul>
168   */ public
169 int addQualitativeSpecies(QualitativeSpecies qualitativeSpecies) {
170    return libsbmlJNI.QualModelPlugin_addQualitativeSpecies(swigCPtr, this, QualitativeSpecies.getCPtr(qualitativeSpecies), qualitativeSpecies);
171  }
172
173  
174/**
175   * Creates a new qual object and adds it to the list of qual objects
176   * and returns it.
177   <p>
178   * @return a newly created {@link QualitativeSpecies} object
179   */ public
180 QualitativeSpecies createQualitativeSpecies() {
181    long cPtr = libsbmlJNI.QualModelPlugin_createQualitativeSpecies(swigCPtr, this);
182    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, false);
183  }
184
185  
186/**
187   * Removes the nth {@link QualitativeSpecies} object from this plugin object and
188   * returns a pointer to it.
189   <p>
190   * The caller owns the returned object and is responsible for
191   *  deleting it.
192   <p>
193   * @param n the index of the {@link QualitativeSpecies} object to remove
194   <p>
195   * @return the {@link QualitativeSpecies} object removed.  As mentioned above, the 
196   * caller owns the returned object. null is returned if the 
197   * given index is out of range.
198   */ public
199 QualitativeSpecies removeQualitativeSpecies(long n) {
200    long cPtr = libsbmlJNI.QualModelPlugin_removeQualitativeSpecies__SWIG_0(swigCPtr, this, n);
201    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, true);
202  }
203
204  
205/**
206   * Removes the {@link QualitativeSpecies} object with the given id attribute from 
207   * this plugin object and returns a pointer to it.
208   <p>
209   * The caller owns the returned object and is responsible for
210   * deleting it.
211   <p>
212   * @param sid the id attribute of the {@link QualitativeSpecies} object to remove
213   <p>
214   * @return the {@link QualitativeSpecies} object removed.  As mentioned above, the 
215   * caller owns the returned object. null is returned if the 
216   * given index is out of range.
217   */ public
218 QualitativeSpecies removeQualitativeSpecies(String sid) {
219    long cPtr = libsbmlJNI.QualModelPlugin_removeQualitativeSpecies__SWIG_1(swigCPtr, this, sid);
220    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, true);
221  }
222
223  
224/**
225   * Returns the number of {@link QualitativeSpecies} object in this plugin object.
226   <p>
227   * @return the number of {@link QualitativeSpecies} object in this plugin object.
228   */ public
229 long getNumQualitativeSpecies() {
230    return libsbmlJNI.QualModelPlugin_getNumQualitativeSpecies(swigCPtr, this);
231  }
232
233  
234/**
235   * Returns the {@link ListOfTransitions} in this plugin object.
236   <p>
237   * @return {@link ListOfTransitions} object in this plugin object.
238   */ public
239 ListOfTransitions getListOfTransitions() {
240    long cPtr = libsbmlJNI.QualModelPlugin_getListOfTransitions__SWIG_0(swigCPtr, this);
241    return (cPtr == 0) ? null : new ListOfTransitions(cPtr, false);
242  }
243
244  
245/**
246   * Returns the {@link Transition} object that belongs to the given index. If the
247   * index is invalid, null is returned.
248   <p>
249   * @param n the index number of the {@link Transition} to get.
250   <p>
251   * @return the nth {@link Transition} in the {@link ListOfTransitions}.
252   */ public
253 Transition getTransition(long n) {
254    long cPtr = libsbmlJNI.QualModelPlugin_getTransition__SWIG_0(swigCPtr, this, n);
255    return (cPtr == 0) ? null : new Transition(cPtr, false);
256  }
257
258  
259/**
260   * Returns the qualitativeSpecies object based on its identifier.
261   <p>
262   * @param sid a string representing the identifier 
263   * of the {@link Transition} to get.
264   <p>
265   * @return {@link Transition} in the {@link ListOfTransitions} with the given id
266   * or null if no such {@link Transition} exists.
267   <p>
268   * @see #getTransition(long n)
269   * @see #getListOfTransitions()
270   */ public
271 Transition getTransition(String sid) {
272    long cPtr = libsbmlJNI.QualModelPlugin_getTransition__SWIG_2(swigCPtr, this, sid);
273    return (cPtr == 0) ? null : new Transition(cPtr, false);
274  }
275
276  
277/**
278   * Adds a copy of the given {@link Transition} object to the list of qual.
279   <p>
280   * @param transition the {@link Transition} object to be added to the list of qual.
281   <p>
282   * <p>
283 * @return integer value indicating success/failure of the
284 * function.   The possible values
285 * returned by this function are:
286   * <ul>
287   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
288   * </ul>
289   */ public
290 int addTransition(Transition transition) {
291    return libsbmlJNI.QualModelPlugin_addTransition(swigCPtr, this, Transition.getCPtr(transition), transition);
292  }
293
294  
295/**
296   * Creates a new qual object and adds it to the list of qual objects
297   * and returns it.
298   <p>
299   * @return a newly created {@link Transition} object
300   */ public
301 Transition createTransition() {
302    long cPtr = libsbmlJNI.QualModelPlugin_createTransition(swigCPtr, this);
303    return (cPtr == 0) ? null : new Transition(cPtr, false);
304  }
305
306  
307/**
308   * Removes the nth {@link Transition} object from this plugin object and
309   * returns a pointer to it.
310   <p>
311   * The caller owns the returned object and is responsible for
312   *  deleting it.
313   <p>
314   * @param n the index of the {@link Transition} object to remove
315   <p>
316   * @return the {@link Transition} object removed.  As mentioned above, the 
317   * caller owns the returned object. null is returned if the 
318   * given index is out of range.
319   */ public
320 Transition removeTransition(long n) {
321    long cPtr = libsbmlJNI.QualModelPlugin_removeTransition__SWIG_0(swigCPtr, this, n);
322    return (cPtr == 0) ? null : new Transition(cPtr, true);
323  }
324
325  
326/**
327   * Removes the {@link Transition} object with the given id attribute from 
328   * this plugin object and returns a pointer to it.
329   <p>
330   * The caller owns the returned object and is responsible for
331   * deleting it.
332   <p>
333   * @param sid the id attribute of the {@link Transition} object to remove
334   <p>
335   * @return the {@link Transition} object removed.  As mentioned above, the 
336   * caller owns the returned object. null is returned if the 
337   * given index is out of range.
338   */ public
339 Transition removeTransition(String sid) {
340    long cPtr = libsbmlJNI.QualModelPlugin_removeTransition__SWIG_1(swigCPtr, this, sid);
341    return (cPtr == 0) ? null : new Transition(cPtr, true);
342  }
343
344  
345/**
346   * Returns the number of {@link Transition} object in this plugin object.
347   <p>
348   * @return the number of {@link Transition} object in this plugin object.
349   */ public
350 long getNumTransitions() {
351    return libsbmlJNI.QualModelPlugin_getNumTransitions(swigCPtr, this);
352  }
353
354  
355/** * @internal */ public
356 void connectToChild() {
357    libsbmlJNI.QualModelPlugin_connectToChild(swigCPtr, this);
358  }
359
360  
361/** * @internal */ public
362 void connectToParent(SBase sbase) {
363    libsbmlJNI.QualModelPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase);
364  }
365
366  
367/** * @internal */ public
368 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
369    libsbmlJNI.QualModelPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
370  }
371
372}