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 ListOfOutputs construct from the
015 * 'qual' package.
016 <p>
017 * The {@link ListOfOutputs} is a container for the {@link Output} elements of a {@link Transition}.
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 Output
063 */
064
065public class ListOfOutputs extends ListOf {
066   private long swigCPtr;
067
068   protected ListOfOutputs(long cPtr, boolean cMemoryOwn)
069   {
070     super(libsbmlJNI.ListOfOutputs_SWIGUpcast(cPtr), cMemoryOwn);
071     swigCPtr = cPtr;
072   }
073
074   protected static long getCPtr(ListOfOutputs obj)
075   {
076     return (obj == null) ? 0 : obj.swigCPtr;
077   }
078
079   protected static long getCPtrAndDisown (ListOfOutputs 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_ListOfOutputs(swigCPtr);
101      }
102      swigCPtr = 0;
103    }
104    super.delete();
105  }
106
107  
108/**
109   * Creates a new {@link ListOfOutputs} with the given level, version, and package version.
110   <p>
111   * @param level a long integer, the SBML Level to assign to this {@link ListOfOutputs}
112   <p>
113   * @param version a long integer, the SBML Version to assign to this {@link ListOfOutputs}
114   <p>
115   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfOutputs}
116   */ public
117 ListOfOutputs(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
118    this(libsbmlJNI.new_ListOfOutputs__SWIG_0(level, version, pkgVersion), true);
119  }
120
121  
122/**
123   * Creates a new {@link ListOfOutputs} with the given level, version, and package version.
124   <p>
125   * @param level a long integer, the SBML Level to assign to this {@link ListOfOutputs}
126   <p>
127   * @param version a long integer, the SBML Version to assign to this {@link ListOfOutputs}
128   <p>
129   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfOutputs}
130   */ public
131 ListOfOutputs(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
132    this(libsbmlJNI.new_ListOfOutputs__SWIG_1(level, version), true);
133  }
134
135  
136/**
137   * Creates a new {@link ListOfOutputs} with the given level, version, and package version.
138   <p>
139   * @param level a long integer, the SBML Level to assign to this {@link ListOfOutputs}
140   <p>
141   * @param version a long integer, the SBML Version to assign to this {@link ListOfOutputs}
142   <p>
143   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfOutputs}
144   */ public
145 ListOfOutputs(long level) throws org.sbml.libsbml.SBMLConstructorException {
146    this(libsbmlJNI.new_ListOfOutputs__SWIG_2(level), true);
147  }
148
149  
150/**
151   * Creates a new {@link ListOfOutputs} with the given level, version, and package version.
152   <p>
153   * @param level a long integer, the SBML Level to assign to this {@link ListOfOutputs}
154   <p>
155   * @param version a long integer, the SBML Version to assign to this {@link ListOfOutputs}
156   <p>
157   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfOutputs}
158   */ public
159 ListOfOutputs() throws org.sbml.libsbml.SBMLConstructorException {
160    this(libsbmlJNI.new_ListOfOutputs__SWIG_3(), true);
161  }
162
163  
164/**
165   * Creates a new {@link ListOfOutputs} with the given {@link QualPkgNamespaces} object.
166   <p>
167   * @param qualns the {@link QualPkgNamespaces} object
168   */ public
169 ListOfOutputs(QualPkgNamespaces qualns) throws org.sbml.libsbml.SBMLConstructorException {
170    this(libsbmlJNI.new_ListOfOutputs__SWIG_4(QualPkgNamespaces.getCPtr(qualns), qualns), true);
171  }
172
173  
174/**
175   * Creates and returns a deep copy of this {@link ListOfOutputs} object.
176   <p>
177   * @return a (deep) copy of this {@link ListOfOutputs} object.
178   */ public
179 ListOfOutputs cloneObject() {
180    long cPtr = libsbmlJNI.ListOfOutputs_cloneObject(swigCPtr, this);
181    return (cPtr == 0) ? null : new ListOfOutputs(cPtr, true);
182  }
183
184  
185/**
186   * Get a {@link Output} from the {@link ListOfOutputs}.
187   <p>
188   * @param n the index number of the {@link Output} to get.
189   <p>
190   * @return the nth {@link Output} in this {@link ListOfOutputs}.
191   <p>
192   * @see #size()
193   */ public
194 Output get(long n) {
195    long cPtr = libsbmlJNI.ListOfOutputs_get__SWIG_0(swigCPtr, this, n);
196    return (cPtr == 0) ? null : new Output(cPtr, false);
197  }
198
199  
200/**
201   * Get a {@link Output} from the {@link ListOfOutputs}
202   * based on its identifier.
203   <p>
204   * @param sid a string representing the identifier
205   * of the {@link Output} to get.
206   <p>
207   * @return {@link Output} in this {@link ListOfOutputs}
208   * with the given id or null if no such
209   * {@link Output} exists.
210   <p>
211   * @see #get(long n)   *
212   * @see #size()
213   */ public
214 Output get(String sid) {
215    long cPtr = libsbmlJNI.ListOfOutputs_get__SWIG_2(swigCPtr, this, sid);
216    return (cPtr == 0) ? null : new Output(cPtr, false);
217  }
218
219  
220/**
221   * Get a {@link Output} from the {@link ListOfOutputs}
222   * based on the qualitativeSpecies to which it refers.
223   <p>
224   * @param sid a string representing the qualitativeSpecies attribute
225   * of the {@link Output} to get.
226   <p>
227   * @return the first {@link Output} in this {@link ListOfOutputs}
228   * with the given qualitativeSpecies or null if no such
229   * {@link Output} exists.
230   <p>
231   * @see #get(long n)   *
232   * @see #size()
233   */ public
234 Output getBySpecies(String sid) {
235    long cPtr = libsbmlJNI.ListOfOutputs_getBySpecies__SWIG_0(swigCPtr, this, sid);
236    return (cPtr == 0) ? null : new Output(cPtr, false);
237  }
238
239  
240/**
241   * Removes the nth {@link Output} from this {@link ListOfOutputs}
242   * and returns a pointer to it.
243   <p>
244   * The caller owns the returned item and is responsible for deleting it.
245   <p>
246   * @param n the index of the {@link Output} to remove.
247   <p>
248   * @see #size()
249   */ public
250 Output remove(long n) {
251    long cPtr = libsbmlJNI.ListOfOutputs_remove__SWIG_0(swigCPtr, this, n);
252    return (cPtr == 0) ? null : new Output(cPtr, true);
253  }
254
255  
256/**
257   * Removes the {@link Output} from this {@link ListOfOutputs} with the given identifier
258   * and returns a pointer to it.
259   <p>
260   * The caller owns the returned item and is responsible for deleting it.
261   * If none of the items in this list have the identifier <code>sid</code>, then
262   * <code>null</code> is returned.
263   <p>
264   * @param sid the identifier of the {@link Output} to remove.
265   <p>
266   * @return the {@link Output} removed. As mentioned above, the caller owns the
267   * returned item.
268   */ public
269 Output remove(String sid) {
270    long cPtr = libsbmlJNI.ListOfOutputs_remove__SWIG_1(swigCPtr, this, sid);
271    return (cPtr == 0) ? null : new Output(cPtr, true);
272  }
273
274  
275/**
276   * Returns the XML element name of this object, which for {@link ListOfOutputs}, is
277   * always <code>'listOfOutputs'.</code>
278   <p>
279   * @return the name of this element, i.e. <code>'listOfOutputs'.</code>
280   */ public
281 String getElementName() {
282    return libsbmlJNI.ListOfOutputs_getElementName(swigCPtr, this);
283  }
284
285  
286/**
287   * Returns the libSBML type code for the SBML objects
288   * contained in this {@link ListOf} object.
289   <p>
290   * <p>
291 * LibSBML attaches an identifying code to every kind of SBML object.  These
292 * are integer constants known as <em>SBML type codes</em>.  The names of all
293 * the codes begin with the characters &ldquo;<code>SBML_</code>&rdquo;. 
294 * In the Java language interface for libSBML, the
295 * type codes are defined as static integer constants in the interface class
296 * {@link libsbmlConstants}.    Note that different Level&nbsp;3 
297 * package plug-ins may use overlapping type codes; to identify the package
298 * to which a given object belongs, call the <code>getPackageName()</code>
299 * method on the object.
300   <p>
301   * @return the SBML type code for objects contained in this list:
302   * {@link  libsbmlConstants#SBML_QUAL_OUTPUT SBML_QUAL_OUTPUT} (default).
303   <p>
304   * @see #getElementName()
305   * @see #getPackageName()
306   */ public
307 int getItemTypeCode() {
308    return libsbmlJNI.ListOfOutputs_getItemTypeCode(swigCPtr, this);
309  }
310
311}