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