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