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 A list of {@link QualitativeSpecies} objects.
015 <p>
016 * The {@link ListOfQualitativeSpecies} is a container for the {@link QualitativeSpecies} elements of a {@link Model}.
017 <p>
018 * <p>
019 * The various ListOf___ classes in SBML
020 * are merely containers used for organizing the main components of an SBML
021 * model.  In libSBML's implementation, ListOf___
022 * classes are derived from the
023 * intermediate utility class {@link ListOf}, which
024 * is not defined by the SBML specifications but serves as a useful
025 * programmatic construct.  {@link ListOf} is itself is in turn derived from {@link SBase},
026 * which provides all of the various ListOf___
027 * classes with common features
028 * defined by the SBML specification, such as 'metaid' attributes and
029 * annotations.
030 <p>
031 * Readers may wonder about the motivations for using the ListOf___
032 * containers in SBML.  A simpler approach in XML might be to place the
033 * components all directly at the top level of the model definition.  The
034 * choice made in SBML is to group them within XML elements named after
035 * ListOf<em>Classname</em>, in part because it helps organize the
036 * components.  More importantly, the fact that the container classes are
037 * derived from {@link SBase} means that software tools can add information <em>about</em>
038 * the lists themselves into each list container's 'annotation'.
039 <p>
040 * @see ListOfFunctionDefinitions
041 * @see ListOfUnitDefinitions
042 * @see ListOfCompartmentTypes
043 * @see ListOfSpeciesTypes
044 * @see ListOfCompartments
045 * @see ListOfSpecies
046 * @see ListOfParameters
047 * @see ListOfInitialAssignments
048 * @see ListOfRules
049 * @see ListOfConstraints
050 * @see ListOfReactions
051 * @see ListOfEvents
052 <p>
053 * @see QualitativeSpecies
054 */
055
056public class ListOfQualitativeSpecies extends ListOf {
057   private long swigCPtr;
058
059   protected ListOfQualitativeSpecies(long cPtr, boolean cMemoryOwn)
060   {
061     super(libsbmlJNI.ListOfQualitativeSpecies_SWIGUpcast(cPtr), cMemoryOwn);
062     swigCPtr = cPtr;
063   }
064
065   protected static long getCPtr(ListOfQualitativeSpecies obj)
066   {
067     return (obj == null) ? 0 : obj.swigCPtr;
068   }
069
070   protected static long getCPtrAndDisown (ListOfQualitativeSpecies obj)
071   {
072     long ptr = 0;
073
074     if (obj != null)
075     {
076       ptr             = obj.swigCPtr;
077       obj.swigCMemOwn = false;
078     }
079
080     return ptr;
081   }
082
083  protected void finalize() {
084    delete();
085  }
086
087  public synchronized void delete() {
088    if (swigCPtr != 0) {
089      if (swigCMemOwn) {
090        swigCMemOwn = false;
091        libsbmlJNI.delete_ListOfQualitativeSpecies(swigCPtr);
092      }
093      swigCPtr = 0;
094    }
095    super.delete();
096  }
097
098  
099/**
100   * Creates a new {@link ListOfQualitativeSpecies} with the given level, version, and package version.
101   <p>
102   * @param level a long integer, the SBML Level to assign to this {@link ListOfQualitativeSpecies}
103   <p>
104   * @param version a long integer, the SBML Version to assign to this {@link ListOfQualitativeSpecies}
105   <p>
106   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfQualitativeSpecies}
107   */ public
108 ListOfQualitativeSpecies(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
109    this(libsbmlJNI.new_ListOfQualitativeSpecies__SWIG_0(level, version, pkgVersion), true);
110  }
111
112  
113/**
114   * Creates a new {@link ListOfQualitativeSpecies} with the given level, version, and package version.
115   <p>
116   * @param level a long integer, the SBML Level to assign to this {@link ListOfQualitativeSpecies}
117   <p>
118   * @param version a long integer, the SBML Version to assign to this {@link ListOfQualitativeSpecies}
119   <p>
120   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfQualitativeSpecies}
121   */ public
122 ListOfQualitativeSpecies(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
123    this(libsbmlJNI.new_ListOfQualitativeSpecies__SWIG_1(level, version), true);
124  }
125
126  
127/**
128   * Creates a new {@link ListOfQualitativeSpecies} with the given level, version, and package version.
129   <p>
130   * @param level a long integer, the SBML Level to assign to this {@link ListOfQualitativeSpecies}
131   <p>
132   * @param version a long integer, the SBML Version to assign to this {@link ListOfQualitativeSpecies}
133   <p>
134   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfQualitativeSpecies}
135   */ public
136 ListOfQualitativeSpecies(long level) throws org.sbml.libsbml.SBMLConstructorException {
137    this(libsbmlJNI.new_ListOfQualitativeSpecies__SWIG_2(level), true);
138  }
139
140  
141/**
142   * Creates a new {@link ListOfQualitativeSpecies} with the given level, version, and package version.
143   <p>
144   * @param level a long integer, the SBML Level to assign to this {@link ListOfQualitativeSpecies}
145   <p>
146   * @param version a long integer, the SBML Version to assign to this {@link ListOfQualitativeSpecies}
147   <p>
148   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfQualitativeSpecies}
149   */ public
150 ListOfQualitativeSpecies() throws org.sbml.libsbml.SBMLConstructorException {
151    this(libsbmlJNI.new_ListOfQualitativeSpecies__SWIG_3(), true);
152  }
153
154  
155/**
156   * Creates a new {@link ListOfQualitativeSpecies} with the given {@link QualPkgNamespaces} object.
157   <p>
158   * @param qualns the {@link QualPkgNamespaces} object
159   */ public
160 ListOfQualitativeSpecies(QualPkgNamespaces qualns) throws org.sbml.libsbml.SBMLConstructorException {
161    this(libsbmlJNI.new_ListOfQualitativeSpecies__SWIG_4(QualPkgNamespaces.getCPtr(qualns), qualns), true);
162  }
163
164  
165/**
166   * Creates and returns a deep copy of this {@link ListOfQualitativeSpecies} object.
167   <p>
168   * @return a (deep) copy of this {@link ListOfQualitativeSpecies} object.
169   */ public
170 ListOfQualitativeSpecies cloneObject() {
171    long cPtr = libsbmlJNI.ListOfQualitativeSpecies_cloneObject(swigCPtr, this);
172    return (cPtr == 0) ? null : new ListOfQualitativeSpecies(cPtr, true);
173  }
174
175  
176/**
177   * Get a {@link QualitativeSpecies} from the {@link ListOfQualitativeSpecies}.
178   <p>
179   * @param n the index number of the {@link QualitativeSpecies} to get.
180   <p>
181   * @return the nth {@link QualitativeSpecies} in this {@link ListOfQualitativeSpecies}.
182   <p>
183   * @see #size()
184   */ public
185 SBase get(long n) {
186    long cPtr = libsbmlJNI.ListOfQualitativeSpecies_get__SWIG_0(swigCPtr, this, n);
187    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, false);
188  }
189
190  
191/**
192   * Get a {@link QualitativeSpecies} from the {@link ListOfQualitativeSpecies}
193   * based on its identifier.
194   <p>
195   * @param sid a string representing the identifier
196   * of the {@link QualitativeSpecies} to get.
197   <p>
198   * @return {@link QualitativeSpecies} in this {@link ListOfQualitativeSpecies}
199   * with the given id or null if no such
200   * {@link QualitativeSpecies} exists.
201   <p>
202   * @see #get(long n)   *
203   * @see #size()
204   */ public
205 QualitativeSpecies get(String sid) {
206    long cPtr = libsbmlJNI.ListOfQualitativeSpecies_get__SWIG_2(swigCPtr, this, sid);
207    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, false);
208  }
209
210  
211/**
212   * Removes the nth {@link QualitativeSpecies} from this {@link ListOfQualitativeSpecies}
213   * and returns a pointer to it.
214   <p>
215   * The caller owns the returned item and is responsible for deleting it.
216   <p>
217   * @param n the index of the {@link QualitativeSpecies} to remove.
218   <p>
219   * @see #size()
220   */ public
221 SBase remove(long n) {
222    long cPtr = libsbmlJNI.ListOfQualitativeSpecies_remove__SWIG_0(swigCPtr, this, n);
223    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, true);
224  }
225
226  
227/**
228   * Removes the {@link QualitativeSpecies} from this {@link ListOfQualitativeSpecies} with the given identifier
229   * and returns a pointer to it.
230   <p>
231   * The caller owns the returned item and is responsible for deleting it.
232   * If none of the items in this list have the identifier <code>sid</code>, then
233   * <code>null</code> is returned.
234   <p>
235   * @param sid the identifier of the {@link QualitativeSpecies} to remove.
236   <p>
237   * @return the {@link QualitativeSpecies} removed. As mentioned above, the caller owns the
238   * returned item.
239   */ public
240 QualitativeSpecies remove(String sid) {
241    long cPtr = libsbmlJNI.ListOfQualitativeSpecies_remove__SWIG_1(swigCPtr, this, sid);
242    return (cPtr == 0) ? null : new QualitativeSpecies(cPtr, true);
243  }
244
245  
246/**
247   * Returns the XML name of this object.
248   <p>
249   * @return the name of this element.
250   */ public
251 String getElementName() {
252    return libsbmlJNI.ListOfQualitativeSpecies_getElementName(swigCPtr, this);
253  }
254
255  
256/**
257   * Returns the libSBML type code for the SBML objects
258   * contained in this {@link ListOf} object.
259   <p>
260   * <p>
261 * LibSBML attaches an identifying code to every kind of SBML object.  These
262 * are integer constants known as <em>SBML type codes</em>.  The names of all
263 * the codes begin with the characters <code>SBML_</code>.
264 * In the Java language interface for libSBML, the
265 * type codes are defined as static integer constants in the interface class
266 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
267 * package plug-ins may use overlapping type codes; to identify the package
268 * to which a given object belongs, call the <code>getPackageName()</code>
269 * method on the object.
270   <p>
271   * @return the SBML type code for objects contained in this list:
272   * {@link libsbmlConstants#SBML_QUAL_QUALITATIVE_SPECIES SBML_QUAL_QUALITATIVE_SPECIES} (default).
273   <p>
274   * @see #getElementName()
275   * @see #getPackageName()
276   */ public
277 int getItemTypeCode() {
278    return libsbmlJNI.ListOfQualitativeSpecies_getItemTypeCode(swigCPtr, this);
279  }
280
281}