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-fbc"><a href="group__fbc.html">fbc</a></span>
013 A list of {@link FluxObjective} objects.
014 <p>
015 * The {@link ListOfFluxObjectives} is a container for the &ldquo;fbc&rdquo;
016 * {@link Objective} that indicate which fluxes (and what ratios for those fluxes)
017 * are to be used in maximizing or minimizing the {@link Objective}.
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 * Readers may wonder about the motivations for using the ListOf___
033 * containers in SBML.  A simpler approach in XML might be to place the
034 * components all directly at the top level of the model definition.  The
035 * choice made in SBML is to group them within XML elements named after
036 * ListOf<em>Classname</em>, in part because it helps organize the
037 * components.  More importantly, the fact that the container classes are
038 * derived from {@link SBase} means that software tools can add information <em>about</em>
039 * the lists themselves into each list container's 'annotation'.
040 <p>
041 * @see ListOfFunctionDefinitions
042 * @see ListOfUnitDefinitions
043 * @see ListOfCompartmentTypes
044 * @see ListOfSpeciesTypes
045 * @see ListOfCompartments
046 * @see ListOfSpecies
047 * @see ListOfParameters
048 * @see ListOfInitialAssignments
049 * @see ListOfRules
050 * @see ListOfConstraints
051 * @see ListOfReactions
052 * @see ListOfEvents
053 <p>
054 * @see Objective
055 * @see FluxObjective
056 */
057
058public class ListOfFluxObjectives extends ListOf {
059   private long swigCPtr;
060
061   protected ListOfFluxObjectives(long cPtr, boolean cMemoryOwn)
062   {
063     super(libsbmlJNI.ListOfFluxObjectives_SWIGUpcast(cPtr), cMemoryOwn);
064     swigCPtr = cPtr;
065   }
066
067   protected static long getCPtr(ListOfFluxObjectives obj)
068   {
069     return (obj == null) ? 0 : obj.swigCPtr;
070   }
071
072   protected static long getCPtrAndDisown (ListOfFluxObjectives obj)
073   {
074     long ptr = 0;
075
076     if (obj != null)
077     {
078       ptr             = obj.swigCPtr;
079       obj.swigCMemOwn = false;
080     }
081
082     return ptr;
083   }
084
085  protected void finalize() {
086    delete();
087  }
088
089  public synchronized void delete() {
090    if (swigCPtr != 0) {
091      if (swigCMemOwn) {
092        swigCMemOwn = false;
093        libsbmlJNI.delete_ListOfFluxObjectives(swigCPtr);
094      }
095      swigCPtr = 0;
096    }
097    super.delete();
098  }
099
100  
101/**
102   * Creates a new {@link ListOfFluxObjectives} with the given level, version, and package version.
103   <p>
104   * @param level a long integer, the SBML Level to assign to this {@link ListOfFluxObjectives}
105   <p>
106   * @param version a long integer, the SBML Version to assign to this {@link ListOfFluxObjectives}
107   <p>
108   * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link ListOfFluxObjectives}
109   */ public
110 ListOfFluxObjectives(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
111    this(libsbmlJNI.new_ListOfFluxObjectives__SWIG_0(level, version, pkgVersion), true);
112  }
113
114  
115/**
116   * Creates a new {@link ListOfFluxObjectives} with the given level, version, and package version.
117   <p>
118   * @param level a long integer, the SBML Level to assign to this {@link ListOfFluxObjectives}
119   <p>
120   * @param version a long integer, the SBML Version to assign to this {@link ListOfFluxObjectives}
121   <p>
122   * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link ListOfFluxObjectives}
123   */ public
124 ListOfFluxObjectives(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
125    this(libsbmlJNI.new_ListOfFluxObjectives__SWIG_1(level, version), true);
126  }
127
128  
129/**
130   * Creates a new {@link ListOfFluxObjectives} with the given level, version, and package version.
131   <p>
132   * @param level a long integer, the SBML Level to assign to this {@link ListOfFluxObjectives}
133   <p>
134   * @param version a long integer, the SBML Version to assign to this {@link ListOfFluxObjectives}
135   <p>
136   * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link ListOfFluxObjectives}
137   */ public
138 ListOfFluxObjectives(long level) throws org.sbml.libsbml.SBMLConstructorException {
139    this(libsbmlJNI.new_ListOfFluxObjectives__SWIG_2(level), true);
140  }
141
142  
143/**
144   * Creates a new {@link ListOfFluxObjectives} with the given level, version, and package version.
145   <p>
146   * @param level a long integer, the SBML Level to assign to this {@link ListOfFluxObjectives}
147   <p>
148   * @param version a long integer, the SBML Version to assign to this {@link ListOfFluxObjectives}
149   <p>
150   * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link ListOfFluxObjectives}
151   */ public
152 ListOfFluxObjectives() throws org.sbml.libsbml.SBMLConstructorException {
153    this(libsbmlJNI.new_ListOfFluxObjectives__SWIG_3(), true);
154  }
155
156  
157/**
158   * Creates a new {@link ListOfFluxObjectives} with the given {@link FbcPkgNamespaces} object.
159   <p>
160   * @param fbcns the {@link FbcPkgNamespaces} object
161   */ public
162 ListOfFluxObjectives(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException {
163    this(libsbmlJNI.new_ListOfFluxObjectives__SWIG_4(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true);
164  }
165
166  
167/**
168   * Creates and returns a deep copy of this {@link ListOfFluxObjectives} object.
169   <p>
170   * @return a (deep) copy of this {@link ListOfFluxObjectives} object.
171   */ public
172 ListOfFluxObjectives cloneObject() {
173    long cPtr = libsbmlJNI.ListOfFluxObjectives_cloneObject(swigCPtr, this);
174    return (cPtr == 0) ? null : new ListOfFluxObjectives(cPtr, true);
175  }
176
177  
178/**
179   * Get a {@link FluxObjective} from the {@link ListOfFluxObjectives}.
180   <p>
181   * @param n the index number of the {@link FluxObjective} to get.
182   <p>
183   * @return the nth {@link FluxObjective} in this {@link ListOfFluxObjectives}.
184   <p>
185   * @see #size()
186   */ public
187 FluxObjective get(long n) {
188    long cPtr = libsbmlJNI.ListOfFluxObjectives_get__SWIG_0(swigCPtr, this, n);
189    return (cPtr == 0) ? null : new FluxObjective(cPtr, false);
190  }
191
192  
193/**
194   * Get a {@link FluxObjective} from the {@link ListOfFluxObjectives}
195   * based on its identifier.
196   <p>
197   * @param sid a string representing the identifier
198   * of the {@link FluxObjective} to get.
199   <p>
200   * @return {@link FluxObjective} in this {@link ListOfFluxObjectives}
201   * with the given id or null if no such
202   * {@link FluxObjective} exists.
203   <p>
204   * @see #get(long n)   *
205   * @see #size()
206   */ public
207 FluxObjective get(String sid) {
208    long cPtr = libsbmlJNI.ListOfFluxObjectives_get__SWIG_2(swigCPtr, this, sid);
209    return (cPtr == 0) ? null : new FluxObjective(cPtr, false);
210  }
211
212  
213/**
214     * Adds a copy the given 'FluxObjective' to this {@link ListOfFluxObjectives}.
215     <p>
216     * @param fo; the {@link FluxObjective} object to add
217     <p>
218     * @return integer value indicating success/failure of the
219     * function.   The possible values
220     * returned by this function are:
221     * <ul>
222     * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
223     * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
224     * </ul>
225     */ public
226 int addFluxObjective(FluxObjective fo) {
227    return libsbmlJNI.ListOfFluxObjectives_addFluxObjective(swigCPtr, this, FluxObjective.getCPtr(fo), fo);
228  }
229
230  
231/**
232     * Get the number of {@link FluxObjective} objects in this {@link ListOfFluxObjectives}.
233     <p>
234     * @return the number of {@link FluxObjective} objects in this {@link ListOfFluxObjectives}
235     */ public
236 long getNumFluxObjectives() {
237    return libsbmlJNI.ListOfFluxObjectives_getNumFluxObjectives(swigCPtr, this);
238  }
239
240  
241/**
242     * Creates a new {@link FluxObjective} object, adds it to the
243     * {@link ListOfFluxObjectives} and returns the {@link FluxObjective} object created. 
244     <p>
245     * @return a new {@link FluxObjective} object instance
246     <p>
247     * @see #addFluxObjective(FluxObjective fo)
248     */ public
249 FluxObjective createFluxObjective() {
250    long cPtr = libsbmlJNI.ListOfFluxObjectives_createFluxObjective(swigCPtr, this);
251    return (cPtr == 0) ? null : new FluxObjective(cPtr, false);
252  }
253
254  
255/**
256   * Removes the nth {@link FluxObjective} from this {@link ListOfFluxObjectives}
257   * and returns a pointer to it.
258   <p>
259   * The caller owns the returned item and is responsible for deleting it.
260   <p>
261   * @param n the index of the {@link FluxObjective} to remove.
262   <p>
263   * @see #size()
264   */ public
265 FluxObjective remove(long n) {
266    long cPtr = libsbmlJNI.ListOfFluxObjectives_remove__SWIG_0(swigCPtr, this, n);
267    return (cPtr == 0) ? null : new FluxObjective(cPtr, true);
268  }
269
270  
271/**
272   * Removes the {@link FluxObjective} from this {@link ListOfFluxObjectives} with the given identifier
273   * and returns a pointer to it.
274   <p>
275   * The caller owns the returned item and is responsible for deleting it.
276   * If none of the items in this list have the identifier <code>sid</code>, then
277   * <code>null</code> is returned.
278   <p>
279   * @param sid the identifier of the {@link FluxObjective} to remove.
280   <p>
281   * @return the {@link FluxObjective} removed. As mentioned above, the caller owns the
282   * returned item.
283   */ public
284 FluxObjective remove(String sid) {
285    long cPtr = libsbmlJNI.ListOfFluxObjectives_remove__SWIG_1(swigCPtr, this, sid);
286    return (cPtr == 0) ? null : new FluxObjective(cPtr, true);
287  }
288
289  
290/**
291   * Returns the XML element name of this object.
292   <p>
293   * For {@link ListOfFluxObjectives}, the XML element name is always <code>'listOfFluxObjectives'.</code>
294   <p>
295   * @return the name of this element, i.e. <code>'listOfFluxObjectives'.</code>
296   */ public
297 String getElementName() {
298    return libsbmlJNI.ListOfFluxObjectives_getElementName(swigCPtr, this);
299  }
300
301  
302/**
303   * Returns the libSBML type code for this SBML object.
304   <p>
305   * <p>
306 * LibSBML attaches an identifying code to every kind of SBML object.  These
307 * are integer constants known as <em>SBML type codes</em>.  The names of all
308 * the codes begin with the characters <code>SBML_</code>.
309 * In the Java language interface for libSBML, the
310 * type codes are defined as static integer constants in the interface class
311 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
312 * package plug-ins may use overlapping type codes; to identify the package
313 * to which a given object belongs, call the <code>getPackageName()</code>
314 * method on the object.
315   <p>
316   * @return the SBML type code for this object:
317   * {@link libsbmlConstants#SBML_LIST_OF SBML_LIST_OF} (default).
318   <p>
319   * <p>
320 * @warning <span class='warning'>The specific integer values of the possible
321 * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
322 * packages,  To fully identify the correct code, <strong>it is necessary to
323 * invoke both getTypeCode() and getPackageName()</strong>.</span>
324   <p>
325   * @see #getElementName()
326   * @see #getPackageName()
327   */ public
328 int getTypeCode() {
329    return libsbmlJNI.ListOfFluxObjectives_getTypeCode(swigCPtr, this);
330  }
331
332  
333/**
334   * Returns the libSBML type code for the objects contained in this {@link ListOf}.
335   <p>
336   * <p>
337 * LibSBML attaches an identifying code to every kind of SBML object.  These
338 * are integer constants known as <em>SBML type codes</em>.  The names of all
339 * the codes begin with the characters <code>SBML_</code>.
340 * In the Java language interface for libSBML, the
341 * type codes are defined as static integer constants in the interface class
342 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
343 * package plug-ins may use overlapping type codes; to identify the package
344 * to which a given object belongs, call the <code>getPackageName()</code>
345 * method on the object.
346   <p>
347   * @return the SBML type code for the objects contained in this {@link ListOf}
348   * instance: {@link libsbmlConstants#SBML_FBC_FLUXOBJECTIVE SBML_FBC_FLUXOBJECTIVE} (default).
349   <p>
350   * @see #getElementName()
351   * @see #getPackageName()
352   */ public
353 int getItemTypeCode() {
354    return libsbmlJNI.ListOfFluxObjectives_getItemTypeCode(swigCPtr, this);
355  }
356
357}