001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 2.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-qual"><a href="group__qual.html">qual</a></span>
013
014 The {@link QualitativeSpecies} class for the Qualitative Models
015 * package.
016 <p>
017 * Similarly to the {@link Species} in SBML, the components of qualitative models
018 * refer to pools of entities that are considered indistinguishable and are
019 * each located in a specific {@link Compartment}. However, here components are
020 * characterised by their qualitative influences rather than by taking part
021 * in reactions. Therefore, we define the {@link QualitativeSpecies} element to
022 * represent such pools of entities.
023 <p>
024 * In a Petri net, qualitative species refer to the places of the model,
025 * while in a logical model, they refer to the variables of this model
026 * (i.e. nodes of the influence graph).
027 <p>
028 * A {@link QualitativeSpecies} describes a pool of indistinguishable entities in a
029 * {@link Compartment}. It is associated with a level (an integer representing
030 * e.g. an activity state, or a functional level of concentration, etc.)
031 */
032
033public class QualitativeSpecies extends SBase {
034   private long swigCPtr;
035
036   protected QualitativeSpecies(long cPtr, boolean cMemoryOwn)
037   {
038     super(libsbmlJNI.QualitativeSpecies_SWIGUpcast(cPtr), cMemoryOwn);
039     swigCPtr = cPtr;
040   }
041
042   protected static long getCPtr(QualitativeSpecies obj)
043   {
044     return (obj == null) ? 0 : obj.swigCPtr;
045   }
046
047   protected static long getCPtrAndDisown (QualitativeSpecies obj)
048   {
049     long ptr = 0;
050
051     if (obj != null)
052     {
053       ptr             = obj.swigCPtr;
054       obj.swigCMemOwn = false;
055     }
056
057     return ptr;
058   }
059
060  protected void finalize() {
061    delete();
062  }
063
064  public synchronized void delete() {
065    if (swigCPtr != 0) {
066      if (swigCMemOwn) {
067        swigCMemOwn = false;
068        libsbmlJNI.delete_QualitativeSpecies(swigCPtr);
069      }
070      swigCPtr = 0;
071    }
072    super.delete();
073  }
074
075  
076/**
077   * Creates a new {@link QualitativeSpecies} with the given level, version, and package version.
078   <p>
079   * @param level a long integer, the SBML Level to assign to this {@link QualitativeSpecies}
080   <p>
081   * @param version a long integer, the SBML Version to assign to this {@link QualitativeSpecies}
082   <p>
083   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link QualitativeSpecies}
084   */ public
085 QualitativeSpecies(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
086    this(libsbmlJNI.new_QualitativeSpecies__SWIG_0(level, version, pkgVersion), true);
087  }
088
089  
090/**
091   * Creates a new {@link QualitativeSpecies} with the given level, version, and package version.
092   <p>
093   * @param level a long integer, the SBML Level to assign to this {@link QualitativeSpecies}
094   <p>
095   * @param version a long integer, the SBML Version to assign to this {@link QualitativeSpecies}
096   <p>
097   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link QualitativeSpecies}
098   */ public
099 QualitativeSpecies(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
100    this(libsbmlJNI.new_QualitativeSpecies__SWIG_1(level, version), true);
101  }
102
103  
104/**
105   * Creates a new {@link QualitativeSpecies} with the given level, version, and package version.
106   <p>
107   * @param level a long integer, the SBML Level to assign to this {@link QualitativeSpecies}
108   <p>
109   * @param version a long integer, the SBML Version to assign to this {@link QualitativeSpecies}
110   <p>
111   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link QualitativeSpecies}
112   */ public
113 QualitativeSpecies(long level) throws org.sbml.libsbml.SBMLConstructorException {
114    this(libsbmlJNI.new_QualitativeSpecies__SWIG_2(level), true);
115  }
116
117  
118/**
119   * Creates a new {@link QualitativeSpecies} with the given level, version, and package version.
120   <p>
121   * @param level a long integer, the SBML Level to assign to this {@link QualitativeSpecies}
122   <p>
123   * @param version a long integer, the SBML Version to assign to this {@link QualitativeSpecies}
124   <p>
125   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link QualitativeSpecies}
126   */ public
127 QualitativeSpecies() throws org.sbml.libsbml.SBMLConstructorException {
128    this(libsbmlJNI.new_QualitativeSpecies__SWIG_3(), true);
129  }
130
131  
132/**
133   * Creates a new {@link QualitativeSpecies} with the given {@link QualPkgNamespaces} object.
134   <p>
135   * @param qualns the {@link QualPkgNamespaces} object
136   */ public
137 QualitativeSpecies(QualPkgNamespaces qualns) throws org.sbml.libsbml.SBMLConstructorException {
138    this(libsbmlJNI.new_QualitativeSpecies__SWIG_4(QualPkgNamespaces.getCPtr(qualns), qualns), true);
139  }
140
141  
142/**
143   * Copy constructor for {@link QualitativeSpecies}.
144   <p>
145   * @param orig the {@link QualitativeSpecies} instance to copy.
146   */ public
147 QualitativeSpecies(QualitativeSpecies orig) throws org.sbml.libsbml.SBMLConstructorException {
148    this(libsbmlJNI.new_QualitativeSpecies__SWIG_5(QualitativeSpecies.getCPtr(orig), orig), true);
149  }
150
151  
152/**
153   * Creates and returns a deep copy of this {@link QualitativeSpecies} object.
154   <p>
155   * @return a (deep) copy of this {@link QualitativeSpecies} object.
156   */ public
157 QualitativeSpecies cloneObject() {
158    long cPtr = libsbmlJNI.QualitativeSpecies_cloneObject(swigCPtr, this);
159    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, true);
160  }
161
162  
163/**
164   * Returns the value of the 'id' attribute of this {@link QualitativeSpecies}.
165   <p>
166   * @return the value of the 'id' attribute of this {@link QualitativeSpecies} as a string.
167   */ public
168 String getId() {
169    return libsbmlJNI.QualitativeSpecies_getId(swigCPtr, this);
170  }
171
172  
173/**
174   * Returns the value of the 'compartment' attribute of this {@link QualitativeSpecies}.
175   <p>
176   * @return the value of the 'compartment' attribute of this {@link QualitativeSpecies} as a string.
177   */ public
178 String getCompartment() {
179    return libsbmlJNI.QualitativeSpecies_getCompartment(swigCPtr, this);
180  }
181
182  
183/**
184   * Returns the value of the 'constant' attribute of this {@link QualitativeSpecies}.
185   <p>
186   * @return the value of the 'constant' attribute of this {@link QualitativeSpecies} as a boolean.
187   */ public
188 boolean getConstant() {
189    return libsbmlJNI.QualitativeSpecies_getConstant(swigCPtr, this);
190  }
191
192  
193/**
194   * Returns the value of the 'name' attribute of this {@link QualitativeSpecies}.
195   <p>
196   * @return the value of the 'name' attribute of this {@link QualitativeSpecies} as a string.
197   */ public
198 String getName() {
199    return libsbmlJNI.QualitativeSpecies_getName(swigCPtr, this);
200  }
201
202  
203/**
204   * Returns the value of the 'initialLevel' attribute of this {@link QualitativeSpecies}.
205   <p>
206   * @return the value of the 'initialLevel' attribute of this {@link QualitativeSpecies} as a integer.
207   */ public
208 int getInitialLevel() {
209    return libsbmlJNI.QualitativeSpecies_getInitialLevel(swigCPtr, this);
210  }
211
212  
213/**
214   * Returns the value of the 'maxLevel' attribute of this {@link QualitativeSpecies}.
215   <p>
216   * @return the value of the 'maxLevel' attribute of this {@link QualitativeSpecies} as a integer.
217   */ public
218 int getMaxLevel() {
219    return libsbmlJNI.QualitativeSpecies_getMaxLevel(swigCPtr, this);
220  }
221
222  
223/**
224   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
225   * {@link QualitativeSpecies}'s 'id' attribute has been set.
226   <p>
227   * @return <code>true</code> if this {@link QualitativeSpecies}'s 'id' attribute has been set,
228   * otherwise <code>false</code> is returned.
229   */ public
230 boolean isSetId() {
231    return libsbmlJNI.QualitativeSpecies_isSetId(swigCPtr, this);
232  }
233
234  
235/**
236   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
237   * {@link QualitativeSpecies}'s 'compartment' attribute has been set.
238   <p>
239   * @return <code>true</code> if this {@link QualitativeSpecies}'s 'compartment' attribute has been set,
240   * otherwise <code>false</code> is returned.
241   */ public
242 boolean isSetCompartment() {
243    return libsbmlJNI.QualitativeSpecies_isSetCompartment(swigCPtr, this);
244  }
245
246  
247/**
248   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
249   * {@link QualitativeSpecies}'s 'constant' attribute has been set.
250   <p>
251   * @return <code>true</code> if this {@link QualitativeSpecies}'s 'constant' attribute has been set,
252   * otherwise <code>false</code> is returned.
253   */ public
254 boolean isSetConstant() {
255    return libsbmlJNI.QualitativeSpecies_isSetConstant(swigCPtr, this);
256  }
257
258  
259/**
260   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
261   * {@link QualitativeSpecies}'s 'name' attribute has been set.
262   <p>
263   * @return <code>true</code> if this {@link QualitativeSpecies}'s 'name' attribute has been set,
264   * otherwise <code>false</code> is returned.
265   */ public
266 boolean isSetName() {
267    return libsbmlJNI.QualitativeSpecies_isSetName(swigCPtr, this);
268  }
269
270  
271/**
272   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
273   * {@link QualitativeSpecies}'s 'initialLevel' attribute has been set.
274   <p>
275   * @return <code>true</code> if this {@link QualitativeSpecies}'s 'initialLevel' attribute has been set,
276   * otherwise <code>false</code> is returned.
277   */ public
278 boolean isSetInitialLevel() {
279    return libsbmlJNI.QualitativeSpecies_isSetInitialLevel(swigCPtr, this);
280  }
281
282  
283/**
284   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
285   * {@link QualitativeSpecies}'s 'maxLevel' attribute has been set.
286   <p>
287   * @return <code>true</code> if this {@link QualitativeSpecies}'s 'maxLevel' attribute has been set,
288   * otherwise <code>false</code> is returned.
289   */ public
290 boolean isSetMaxLevel() {
291    return libsbmlJNI.QualitativeSpecies_isSetMaxLevel(swigCPtr, this);
292  }
293
294  
295/**
296   * Sets the value of the 'id' attribute of this {@link QualitativeSpecies}.
297   <p>
298   * @param id String value of the 'id' attribute to be set
299   <p>
300   * @return integer value indicating success/failure of the
301   * operation. The possible return values are:
302   * <ul>
303   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
304   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
305   * </ul>
306   */ public
307 int setId(String id) {
308    return libsbmlJNI.QualitativeSpecies_setId(swigCPtr, this, id);
309  }
310
311  
312/**
313   * Sets the value of the 'compartment' attribute of this {@link QualitativeSpecies}.
314   <p>
315   * @param compartment String value of the 'compartment' attribute to be set
316   <p>
317   * @return integer value indicating success/failure of the
318   * operation. The possible return values are:
319   * <ul>
320   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
321   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
322   * </ul>
323   */ public
324 int setCompartment(String compartment) {
325    return libsbmlJNI.QualitativeSpecies_setCompartment(swigCPtr, this, compartment);
326  }
327
328  
329/**
330   * Sets the value of the 'constant' attribute of this {@link QualitativeSpecies}.
331   <p>
332   * @param constant boolean value of the 'constant' attribute to be set
333   <p>
334   * @return integer value indicating success/failure of the
335   * operation. The possible return values are:
336   * <ul>
337   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
338   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
339   * </ul>
340   */ public
341 int setConstant(boolean constant) {
342    return libsbmlJNI.QualitativeSpecies_setConstant(swigCPtr, this, constant);
343  }
344
345  
346/**
347   * Sets the value of the 'name' attribute of this {@link QualitativeSpecies}.
348   <p>
349   * @param name String value of the 'name' attribute to be set
350   <p>
351   * @return integer value indicating success/failure of the
352   * operation. The possible return values are:
353   * <ul>
354   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
355   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
356   * </ul>
357   */ public
358 int setName(String name) {
359    return libsbmlJNI.QualitativeSpecies_setName(swigCPtr, this, name);
360  }
361
362  
363/**
364   * Sets the value of the 'initialLevel' attribute of this {@link QualitativeSpecies}.
365   <p>
366   * @param initialLevel int value of the 'initialLevel' attribute to be set
367   <p>
368   * @return integer value indicating success/failure of the
369   * operation. The possible return values are:
370   * <ul>
371   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
372   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
373   * </ul>
374   */ public
375 int setInitialLevel(int initialLevel) {
376    return libsbmlJNI.QualitativeSpecies_setInitialLevel(swigCPtr, this, initialLevel);
377  }
378
379  
380/**
381   * Sets the value of the 'maxLevel' attribute of this {@link QualitativeSpecies}.
382   <p>
383   * @param maxLevel int value of the 'maxLevel' attribute to be set
384   <p>
385   * @return integer value indicating success/failure of the
386   * operation. The possible return values are:
387   * <ul>
388   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
389   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
390   * </ul>
391   */ public
392 int setMaxLevel(int maxLevel) {
393    return libsbmlJNI.QualitativeSpecies_setMaxLevel(swigCPtr, this, maxLevel);
394  }
395
396  
397/**
398   * Unsets the value of the 'id' attribute of this {@link QualitativeSpecies}.
399   <p>
400   * @return integer value indicating success/failure of the
401   * operation. The possible return values are:
402   * <ul>
403   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
404   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
405   * </ul>
406   */ public
407 int unsetId() {
408    return libsbmlJNI.QualitativeSpecies_unsetId(swigCPtr, this);
409  }
410
411  
412/**
413   * Unsets the value of the 'compartment' attribute of this {@link QualitativeSpecies}.
414   <p>
415   * @return integer value indicating success/failure of the
416   * operation. The possible return values are:
417   * <ul>
418   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
419   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
420   * </ul>
421   */ public
422 int unsetCompartment() {
423    return libsbmlJNI.QualitativeSpecies_unsetCompartment(swigCPtr, this);
424  }
425
426  
427/**
428   * Unsets the value of the 'constant' attribute of this {@link QualitativeSpecies}.
429   <p>
430   * @return integer value indicating success/failure of the
431   * operation. The possible return values are:
432   * <ul>
433   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
434   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
435   * </ul>
436   */ public
437 int unsetConstant() {
438    return libsbmlJNI.QualitativeSpecies_unsetConstant(swigCPtr, this);
439  }
440
441  
442/**
443   * Unsets the value of the 'name' attribute of this {@link QualitativeSpecies}.
444   <p>
445   * @return integer value indicating success/failure of the
446   * operation. The possible return values are:
447   * <ul>
448   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
449   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
450   * </ul>
451   */ public
452 int unsetName() {
453    return libsbmlJNI.QualitativeSpecies_unsetName(swigCPtr, this);
454  }
455
456  
457/**
458   * Unsets the value of the 'initialLevel' attribute of this {@link QualitativeSpecies}.
459   <p>
460   * @return integer value indicating success/failure of the
461   * operation. The possible return values are:
462   * <ul>
463   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
464   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
465   * </ul>
466   */ public
467 int unsetInitialLevel() {
468    return libsbmlJNI.QualitativeSpecies_unsetInitialLevel(swigCPtr, this);
469  }
470
471  
472/**
473   * Unsets the value of the 'maxLevel' attribute of this {@link QualitativeSpecies}.
474   <p>
475   * @return integer value indicating success/failure of the
476   * operation. The possible return values are:
477   * <ul>
478   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
479   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
480   * </ul>
481   */ public
482 int unsetMaxLevel() {
483    return libsbmlJNI.QualitativeSpecies_unsetMaxLevel(swigCPtr, this);
484  }
485
486  
487/**
488   * Renames all the <code>SIdRef</code> attributes on this element, including any
489   * found in MathML content (if such exists).
490   <p>
491   * This method works by looking at all attributes and (if appropriate)
492   * mathematical formulas, comparing the identifiers to the value of @p
493   * oldid.  If any matches are found, the matching identifiers are replaced
494   * with <code>newid</code>.  The method does <em>not</em> descend into child elements.
495   <p>
496   * @param oldid the old identifier
497   * @param newid the new identifier
498   */ public
499 void renameSIdRefs(String oldid, String newid) {
500    libsbmlJNI.QualitativeSpecies_renameSIdRefs(swigCPtr, this, oldid, newid);
501  }
502
503  
504/**
505   * Returns the XML element name of this object, which for {@link QualitativeSpecies}, is
506   * always <code>'qualitativeSpecies'.</code>
507   <p>
508   * @return the name of this element, i.e. <code>'qualitativeSpecies'.</code>
509   */ public
510 String getElementName() {
511    return libsbmlJNI.QualitativeSpecies_getElementName(swigCPtr, this);
512  }
513
514  
515/**
516   * Returns the libSBML type code of this object instance.
517   <p>
518   * <p>
519 * LibSBML attaches an identifying code to every kind of SBML object.  These
520 * are integer constants known as <em>SBML type codes</em>.  The names of all
521 * the codes begin with the characters &ldquo;<code>SBML_</code>&rdquo;. 
522 * In the Java language interface for libSBML, the
523 * type codes are defined as static integer constants in the interface class
524 * {@link libsbmlConstants}.    Note that different Level&nbsp;3 
525 * package plug-ins may use overlapping type codes; to identify the package
526 * to which a given object belongs, call the <code>getPackageName()</code>
527 * method on the object.
528   <p>
529   * @return the SBML type code for this object:
530   * {@link  libsbmlConstants#SBML_QUAL_QUALITATIVE_SPECIES SBML_QUAL_QUALITATIVE_SPECIES}
531   <p>
532   * <p>
533 * @warning <span class='warning'>The specific integer values of the possible
534 * type codes may be reused by different Level&nbsp;3 package plug-ins.
535 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
536 * both getTypeCode() and getPackageName()</strong>.</span>
537   <p>
538   * @see #getElementName()
539   * @see #getPackageName()
540   */ public
541 int getTypeCode() {
542    return libsbmlJNI.QualitativeSpecies_getTypeCode(swigCPtr, this);
543  }
544
545  
546/**
547   * Predicate returning <code>true</code> if all the required attributes
548   * for this {@link QualitativeSpecies} object have been set.
549   <p>
550   * @note The required attributes for a {@link QualitativeSpecies} object are:
551   * <ul>
552   * <li> 'id'
553   * <li> 'compartment'
554   * <li> 'constant'
555   *
556   * </ul> <p>
557   * @return a boolean value indicating whether all the required
558   * attributes for this object have been defined.
559   */ public
560 boolean hasRequiredAttributes() {
561    return libsbmlJNI.QualitativeSpecies_hasRequiredAttributes(swigCPtr, this);
562  }
563
564  
565/**
566   * Enables/Disables the given package with this element.
567   * @internal
568   */ public
569 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
570    libsbmlJNI.QualitativeSpecies_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
571  }
572
573}