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