001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 2.0.11
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 * 
013 * Implementation of SBML's Reaction construct.
014 * <p>
015 * A <em>reaction</em> represents any transformation, transport or binding
016 * process, typically a chemical reaction, that can change the quantity of
017 * one or more species.  In SBML, a reaction is defined primarily in terms
018 * of the participating reactants and products (and their corresponding
019 * stoichiometries), along with optional modifier species, an optional rate
020 * at which the reaction takes place, and optional parameters.  
021 * <p>
022 * As with other major object in SBML, {@link Reaction} has a mandatory attribute,
023 * 'id', used to give the compartment type an identifier.  The identifier
024 * must be a text string conforming to the identifer syntax permitted in
025 * SBML.  In SBML Level&nbsp;2 and Level&nbsp;3, the reaction 'id'
026 * identifier can be used in mathematical formulas elsewhere in an SBML
027 * model to represent the rate of that reaction; this usage is explained
028 * below.  {@link Reaction} also has an optional 'name' attribute, of type 
029 * <code>string.</code>  The 'id' and 'name' must be used according to the guidelines
030 * described in the SBML specification.
031 * <p>
032 * The species participating as reactants, products, and/or modifiers in a
033 * reaction are declared using lists of {@link SpeciesReference} and/or
034 * {@link ModifierSpeciesReference} instances stored in subelements
035 * 'listOfReactants', 'listOfProducts' and 'listOfModifiers'.  Certain
036 * restrictions are placed on the appearance of species in reaction
037 * definitions:
038 * <ul>
039 * <li> The ability of a species to appear as a reactant or product of any
040 * reaction in a model is governed by certain flags in that species'
041 * definition; see the definition of {@link Species} for more information.
042 * <p>
043 * <li> Any species appearing in the mathematical formula of the subelement
044 * 'kineticLaw' (described below) of a {@link Reaction} must be declared in at
045 * least one of that {@link Reaction}'s lists of reactants, products, and/or
046 * modifiers.  Put another way, it is an error for a reaction's kinetic law
047 * formula to refer to species that have not been declared for that
048 * reaction.
049 * <p>
050 * <li> A reaction definition can contain an empty list of reactants
051 * <em>or</em> an empty list of products, but it must have at least one
052 * reactant or product; in other words, a reaction without any reactant or
053 * product species is not permitted.  (This restriction does not apply to
054 * modifier species, which remain optional in all cases.)
055 * </ul>
056 * <p>
057 * A reaction can contain up to one {@link KineticLaw} object in a subelement named
058 * 'kineticLaw'.  It defines the speed at which the process defined by the
059 * reaction takes place.  The description of {@link KineticLaw} provides more
060 * details about its use.  Note that although the inclusion of a {@link KineticLaw}
061 * object in an instance of a {@link Reaction} component is optional, there is no
062 * useful default that can be substituted in place of a missing rate
063 * expression in a reaction.  Moreover, a reaction's rate cannot be defined
064 * in any other way in SBML&mdash;{@link InitialAssignment}, {@link AssignmentRule},
065 * {@link RateRule}, {@link AlgebraicRule}, {@link Event}, and other constructs in SBML cannot be
066 * used to set the reaction rate separately.  Nevertheless, for some
067 * modeling applications, reactions without any defined rate can be
068 * perfectly acceptable.
069 * <p>
070 * {@link Reaction} also has a boolean attribute named 'reversible' for indicating
071 * whether the reaction is reversible.  This attribute is optional in SBML
072 * Level&nbsp;2, with a default of <code>true</code>; it is mandatory in SBML
073 * Level&nbsp;3 (with no default value).  To say that a reaction is 
074 * <em>reversible</em> is to say it can proceed in either the forward or the reverse
075 * direction.  Although the reversibility of a reaction can sometimes be
076 * deduced by inspecting its rate expression, this is not always the case,
077 * especially for complicated expressions.  Moreover, the need in SBML to
078 * allow rate expressions (i.e., {@link KineticLaw}) to be optional leads to the
079 * need for a separate flag indicating reversibility.  Note that labeling a
080 * reaction as irreversible is an assertion that the reaction always
081 * proceeds in the given forward direction.  (Why else would it be flagged
082 * as irreversible?)  This implies the rate expression in the {@link KineticLaw}
083 * always has a non-negative value during simulations.  Software tools
084 * could provide a means of optionally testing that this condition holds.
085 * The presence of reversibility information in two places (i.e., the rate
086 * expression and the 'reversible' attribute on {@link Reaction}) leaves open the
087 * possibility that a model could contain contradictory information, but
088 * the creation of such a model would be an error on the part of the
089 * software generating it.
090 * <p>
091 * The {@link Reaction} object class has another boolean attribute called 'fast'.
092 * This attribute is optional in SBML Level&nbsp;2, with a default of 
093 * <code>false</code>; it is mandatory in SBML Level&nbsp;3 (with no default value).  It
094 * is used to indicate that a reaction occurs on a vastly faster time scale
095 * than others in a system.  Readers are directed to the SBML Level&nbsp;2
096 * Version&nbsp;4 specification, which provides more detail about the
097 * conditions under which a reaction can be considered to be fast in this
098 * sense.  The attribute's default value is <code>false.</code>  SBML Level&nbsp;1
099 * and Level&nbsp;2 Version&nbsp;1 incorrectly claimed that software tools
100 * could ignore this attribute if they did not implement support for the
101 * corresponding concept; however, further research in SBML has revealed
102 * that this is not true, and 'fast' <em>cannot be ignored</em> if it is
103 * set to <code>true.</code>  SBML Level&nbsp;2 Versions&nbsp;2&ndash;4 therefore
104 * stipulate that if a model has any reactions with 'fast' set to <code>true</code>,
105 * a software tool must be able to respect the attribute or else indicate
106 * to the user that it does not have the capacity to do so.  Analysis
107 * software cannot ignore the value of the 'fast' attribute because doing
108 * so may lead to different results as compared to a software system that
109 * <em>does</em> make use of 'fast'.
110 * <p>
111 * In SBML Level&nbsp;3 Version&nbsp;1, the {@link Reaction} object has an
112 * additional optional attribute named 'compartment', whose value must be
113 * the identifier of a compartment defined in the enclosing {@link Model} object.
114 * The 'compartment' attribute can be used to indicate the compartment in
115 * which the reaction is assumed to take place.  If the attribute is
116 * present, its value must be the identifier of a {@link Compartment} object
117 * defined in the enclosing {@link Model} object.  Similar to the 'reversible'
118 * attribute, the value of the 'compartment' attribute has no direct impact
119 * on the construction of mathematical equations for the SBML model.  When
120 * a kinetic law is given for a reaction, the compartment location may
121 * already be implicit in the kinetic law (although this cannot always be
122 * guaranteed).  Nevertheless, software tools may find the 'compartment'
123 * attribute value useful for such purposes as analyzing the structure of
124 * the model, guiding the modeler in constructing correct rate formulas,
125 * and visualization purposes.
126 * <p>
127 * Readers are urged to read the SBML specification for more details about
128 * the proper use of {@link Reaction}.
129 * <p>
130 * <p>
131 */
132
133public class Reaction extends SBase {
134   private long swigCPtr;
135
136   protected Reaction(long cPtr, boolean cMemoryOwn)
137   {
138     super(libsbmlJNI.Reaction_SWIGUpcast(cPtr), cMemoryOwn);
139     swigCPtr = cPtr;
140   }
141
142   protected static long getCPtr(Reaction obj)
143   {
144     return (obj == null) ? 0 : obj.swigCPtr;
145   }
146
147   protected static long getCPtrAndDisown (Reaction obj)
148   {
149     long ptr = 0;
150
151     if (obj != null)
152     {
153       ptr             = obj.swigCPtr;
154       obj.swigCMemOwn = false;
155     }
156
157     return ptr;
158   }
159
160  protected void finalize() {
161    delete();
162  }
163
164  public synchronized void delete() {
165    if (swigCPtr != 0) {
166      if (swigCMemOwn) {
167        swigCMemOwn = false;
168        libsbmlJNI.delete_Reaction(swigCPtr);
169      }
170      swigCPtr = 0;
171    }
172    super.delete();
173  }
174
175  
176/**
177   * Creates a new {@link Reaction} using the given SBML <code>level</code> and <code>version</code>
178   * values.
179   * <p>
180   * @param level a long integer, the SBML Level to assign to this {@link Reaction}
181   * <p>
182   * @param version a long integer, the SBML Version to assign to this
183   * {@link Reaction}
184   * <p>
185   * @throws SBMLConstructorException 
186   * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind
187   * of SBML object, are either invalid or mismatched with respect to the
188   * parent {@link SBMLDocument} object.
189   * <p>
190   * @note Upon the addition of a {@link Reaction} object to an {@link SBMLDocument} (e.g.,
191   * using {@link Model#addReaction(Reaction r)}), the SBML Level, SBML Version and
192   * XML namespace of the document <em>override</em> the values used when
193   * creating the {@link Reaction} object via this constructor.  This is necessary
194   * to ensure that an SBML document is a consistent structure.
195   * Nevertheless, the ability to supply the values at the time of creation
196   * of a {@link Reaction} is an important aid to producing valid SBML.  Knowledge
197   * of the intented SBML Level and Version determine whether it is valid
198   * to assign a particular value to an attribute, or whether it is valid
199   * to add an object to an existing {@link SBMLDocument}.
200   */ public
201 Reaction(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
202    this(libsbmlJNI.new_Reaction__SWIG_0(level, version), true);
203  }
204
205  
206/**
207   * Creates a new {@link Reaction} using the given {@link SBMLNamespaces} object
208   * <code>sbmlns</code>.
209   * <p>
210   * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces
211   * information.  It is used to communicate the SBML Level, Version, and
212   * (in Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.
213   * A common approach to using this class constructor is to create an
214   * {@link SBMLNamespaces} object somewhere in a program, once, then pass it to
215   * object constructors such as this one when needed.
216   * <p>
217   * @param sbmlns an {@link SBMLNamespaces} object.
218   * <p>
219   * @throws SBMLConstructorException 
220   * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind
221   * of SBML object, are either invalid or mismatched with respect to the
222   * parent {@link SBMLDocument} object.
223   * <p>
224   * @note Upon the addition of a {@link Reaction} object to an {@link SBMLDocument} (e.g.,
225   * using {@link Model#addReaction(Reaction r)}), the SBML XML namespace of the document
226   * <em>overrides</em> the value used when creating the {@link Reaction} object via
227   * this constructor.  This is necessary to ensure that an SBML document
228   * is a consistent structure.  Nevertheless, the ability to supply the
229   * values at the time of creation of a {@link Reaction} is an important aid to
230   * producing valid SBML.  Knowledge of the intented SBML Level and
231   * Version determine whether it is valid to assign a particular value to
232   * an attribute, or whether it is valid to add an object to an existing
233   * {@link SBMLDocument}.
234   */ public
235 Reaction(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException {
236    this(libsbmlJNI.new_Reaction__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true);
237  }
238
239  
240/**
241   * Copy constructor; creates a copy of this {@link Reaction}.
242   * <p>
243   * @param orig the object to copy.
244   * <p>
245   * @throws SBMLConstructorException 
246   * Thrown if the argument <code>orig</code> is <code>null.</code>
247   */ public
248 Reaction(Reaction orig) throws org.sbml.libsbml.SBMLConstructorException {
249    this(libsbmlJNI.new_Reaction__SWIG_2(Reaction.getCPtr(orig), orig), true);
250  }
251
252  
253/**
254   * Creates and returns a deep copy of this {@link Reaction}.
255   * <p>
256   * @return a (deep) copy of this {@link Reaction}.
257   */ public
258 Reaction cloneObject() {
259    long cPtr = libsbmlJNI.Reaction_cloneObject(swigCPtr, this);
260    return (cPtr == 0) ? null : new Reaction(cPtr, true);
261  }
262
263  
264/**
265   * Returns the first child element found that has the given <code>id</code> in the model-wide SId namespace, or <code>null</code> if no such object is found.
266   * <p>
267   * @param id string representing the id of objects to find.
268   * <p>
269   * @return pointer to the first element found with the given <code>id</code>.
270   */ public
271 SBase getElementBySId(String id) {
272  return libsbml.DowncastSBase(libsbmlJNI.Reaction_getElementBySId(swigCPtr, this, id), false);
273}
274
275  
276/**
277   * Returns the first child element it can find with the given <code>metaid</code>, or <code>null</code> if no such object is found.
278   * <p>
279   * @param metaid string representing the metaid of objects to find
280   * <p>
281   * @return pointer to the first element found with the given <code>metaid</code>.
282   */ public
283 SBase getElementByMetaId(String metaid) {
284  return libsbml.DowncastSBase(libsbmlJNI.Reaction_getElementByMetaId(swigCPtr, this, metaid), false);
285}
286
287  
288/**
289   * Renames all the SIdRef attributes on this element, including any found in MathML
290   */ public
291 void renameSIdRefs(String oldid, String newid) {
292    libsbmlJNI.Reaction_renameSIdRefs(swigCPtr, this, oldid, newid);
293  }
294
295  
296/**
297   * Initializes the fields of this {@link Reaction} object to 'typical' default
298   * values.
299   * <p>
300   * The SBML {@link Reaction} component has slightly different aspects and
301   * default attribute values in different SBML Levels and Versions.
302   * This method sets the values to certain common defaults, based
303   * mostly on what they are in SBML Level&nbsp;2.  Specifically:
304   * <ul>
305   * <li> Sets the 'reversible' attribute to <code>true</code>
306   * <li> Sets the 'fast' attribute to <code>false</code>
307   * <li> Marks the 'fast' attribute as <em>not</em> having been set
308   * </ul>
309   * <p>
310   * @warning The 'fast' attribute must be used with care.  SBML
311   * definitions before SBML Level&nbsp;2 Version&nbsp;2 incorrectly
312   * indicated that software tools could ignore this attribute if they did
313   * not implement support for the corresponding concept; however, further
314   * research in SBML has revealed that this is not true, and 'fast'
315   * <em>cannot be ignored</em> if it is set to <code>true.</code>  Beginning with
316   * SBML Level&nbsp;2 Versions&nbsp;2, the SBML specifications therefore
317   * stipulate that if a model has any reactions with 'fast' set to 
318   * <code>true</code>, a software tool must be able to respect the attribute or else
319   * indicate to the user that it does not have the capacity to do so.
320   * Readers are directed to the SBML specifications, which provides more
321   * detail about the conditions under which a reaction can be considered
322   * to be fast in this sense.
323   */ public
324 void initDefaults() {
325    libsbmlJNI.Reaction_initDefaults(swigCPtr, this);
326  }
327
328  
329/**
330   * Returns the value of the 'id' attribute of this {@link Reaction}.
331   * <p>
332   * @return the id of this {@link Reaction}.
333   */ public
334 String getId() {
335    return libsbmlJNI.Reaction_getId(swigCPtr, this);
336  }
337
338  
339/**
340   * Returns the value of the 'name' attribute of this {@link Reaction}.
341   * <p>
342   * @return the name of this {@link Reaction}.
343   */ public
344 String getName() {
345    return libsbmlJNI.Reaction_getName(swigCPtr, this);
346  }
347
348  
349/**
350   * Returns the {@link KineticLaw} object contained in this {@link Reaction}.
351   * <p>
352   * @return the {@link KineticLaw} instance.
353   */ public
354 KineticLaw getKineticLaw() {
355    long cPtr = libsbmlJNI.Reaction_getKineticLaw__SWIG_0(swigCPtr, this);
356    return (cPtr == 0) ? null : new KineticLaw(cPtr, false);
357  }
358
359  
360/**
361   * Returns the value of the 'reversible' attribute on the {@link Reaction} as a
362   * boolean value.
363   * <p>
364   * @return the reversibility status of this {@link Reaction}.
365   */ public
366 boolean getReversible() {
367    return libsbmlJNI.Reaction_getReversible(swigCPtr, this);
368  }
369
370  
371/**
372   * Returns the value of the 'fast' attribute of this {@link Reaction}.
373   * <p>
374   * @return the 'fast' status of this {@link Reaction}.
375   * <p>
376   * @warning SBML definitions before SBML Level&nbsp;2 Version&nbsp;2 incorrectly
377   * indicated that software tools could ignore this attribute if they did
378   * not implement support for the corresponding concept; however, further
379   * research in SBML has revealed that this is not true, and 'fast'
380   * <em>cannot be ignored</em> if it is set to <code>true.</code>  SBML Level&nbsp;2
381   * Versions 2, 3 and 4 therefore stipulate that if a model has any reactions
382   * with 'fast' set to <code>true</code>, a software tool must be able to respect
383   * the attribute or else indicate to the user that it does not have the
384   * capacity to do so.  Readers are directed to the SBML Level&nbsp;2 Version
385   * 4 specification, which provides more detail about the conditions under
386   * which a reaction can be considered to be fast in this sense.
387   */ public
388 boolean getFast() {
389    return libsbmlJNI.Reaction_getFast(swigCPtr, this);
390  }
391
392  
393/**
394   * (SBML Level&nbsp;3 only) Returns the value of the 'compartment'
395   * attribute on the {@link Reaction}.
396   * <p>
397   * @return the compartment of this {@link Reaction}.
398   * <p>
399   * @note The 'compartment' attribute is available in SBML Level&nbsp;3
400   * Version&nbsp;1 Core, but is not present on {@link Reaction} in lower Levels of
401   * SBML.
402   */ public
403 String getCompartment() {
404    return libsbmlJNI.Reaction_getCompartment(swigCPtr, this);
405  }
406
407  
408/**
409   * Predicate returning <code>true</code> if this
410   * {@link Reaction}'s 'id' attribute is set.
411   * <p>
412   * @return <code>true</code> if the 'id' attribute of this {@link Reaction} is
413   * set, <code>false</code> otherwise.
414   */ public
415 boolean isSetId() {
416    return libsbmlJNI.Reaction_isSetId(swigCPtr, this);
417  }
418
419  
420/**
421   * Predicate returning <code>true</code> if this
422   * {@link Reaction}'s 'name' attribute is set.
423   * <p>
424   * @return <code>true</code> if the 'name' attribute of this {@link Reaction} is
425   * set, <code>false</code> otherwise.
426   */ public
427 boolean isSetName() {
428    return libsbmlJNI.Reaction_isSetName(swigCPtr, this);
429  }
430
431  
432/**
433   * Predicate returning <code>true</code> if this
434   * {@link Reaction} contains a kinetic law object.
435   * <p>
436   * @return <code>true</code> if a {@link KineticLaw} is present in this {@link Reaction},, <code>false</code>
437   * otherwise.
438   */ public
439 boolean isSetKineticLaw() {
440    return libsbmlJNI.Reaction_isSetKineticLaw(swigCPtr, this);
441  }
442
443  
444/**
445   * Predicate returning <code>true</code> if the value of
446   * the 'fast' attribute on this {@link Reaction}.
447   * <p>
448   * @return <code>true</code> if the 'fast' attribute is true, <code>false</code> otherwise.
449   * <p>
450   * @warning SBML definitions before SBML Level&nbsp;2 Version&nbsp;2 incorrectly
451   * indicated that software tools could ignore this attribute if they did
452   * not implement support for the corresponding concept; however, further
453   * research in SBML has revealed that this is not true, and 'fast'
454   * <em>cannot be ignored</em> if it is set to <code>true.</code>  SBML Level&nbsp;2
455   * Versions 2, 3 and 4 therefore stipulate that if a model has any reactions
456   * with 'fast' set to <code>true</code>, a software tool must be able to respect
457   * the attribute or else indicate to the user that it does not have the
458   * capacity to do so.  Readers are directed to the SBML Level&nbsp;2 Version
459   * 4 specification, which provides more detail about the conditions under
460   * which a reaction can be considered to be fast in this sense.  Note
461   * also that in SBML Level&nbsp;1, 'fast' is defined as optional with a
462   * default of <code>false</code>, which means it is effectively always set.
463   */ public
464 boolean isSetFast() {
465    return libsbmlJNI.Reaction_isSetFast(swigCPtr, this);
466  }
467
468  
469/**
470   * Predicate returning <code>true</code> if this
471   * {@link Reaction}'s 'compartment' attribute is set.
472   * <p>
473   * @return <code>true</code> if the 'compartment' attribute of this {@link Reaction} is
474   * set, <code>false</code> otherwise.
475   * <p>
476   * @note The 'compartment' attribute is available in SBML
477   * Level&nbsp;3 Version&nbsp;1 Core, but is not present on {@link Reaction} in
478   * lower Levels of SBML.
479   */ public
480 boolean isSetCompartment() {
481    return libsbmlJNI.Reaction_isSetCompartment(swigCPtr, this);
482  }
483
484  
485/**
486   * Predicate returning <code>true</code> if this
487   * {@link Reaction}'s 'reversible' attribute is set.
488   * <p>
489   * @return <code>true</code> if the 'reversible' attribute of this {@link Reaction} is
490   * set, <code>false</code> otherwise.
491   */ public
492 boolean isSetReversible() {
493    return libsbmlJNI.Reaction_isSetReversible(swigCPtr, this);
494  }
495
496  
497/**
498   * Sets the value of the 'id' attribute of this {@link Reaction}.
499   * <p>
500   * The string <code>sid</code> is copied.  Note that SBML has strict requirements
501   * for the syntax of identifiers.  The following is a summary of the definition of the SBML identifier type 
502<code>SId</code>, which defines the permitted syntax of identifiers.  We
503express the syntax using an extended form of BNF notation: 
504<pre style='margin-left: 2em; border: none; font-weight: bold; font-size: 13px; color: black'>
505letter .= 'a'..'z','A'..'Z'
506digit  .= '0'..'9'
507idChar .= letter | digit | '_'
508SId    .= ( letter | '_' ) idChar*
509</pre>
510The characters <code>(</code> and <code>)</code> are used for grouping, the
511character <code>*</code> 'zero or more times', and the character
512<code>|</code> indicates logical 'or'.  The equality of SBML identifiers is
513determined by an exact character sequence match; i.e., comparisons must be
514performed in a case-sensitive manner.  In addition, there are a few
515conditions for the uniqueness of identifiers in an SBML model.  Please
516consult the SBML specifications for the exact formulations.
517<p>
518
519   * <p>
520   * @param sid the string to use as the identifier of this {@link Reaction}
521   * <p>
522   * @return integer value indicating success/failure of the
523   * function.   The possible values
524   * returned by this function are:
525   * <ul>
526   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
527   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
528   * </ul>
529   */ public
530 int setId(String sid) {
531    return libsbmlJNI.Reaction_setId(swigCPtr, this, sid);
532  }
533
534  
535/**
536   * Sets the value of the 'name' attribute of this {@link Reaction}.
537   * <p>
538   * The string in <code>name</code> is copied.
539   * <p>
540   * @param name the new name for the {@link Reaction}
541   * <p>
542   * @return integer value indicating success/failure of the
543   * function.   The possible values
544   * returned by this function are:
545   * <ul>
546   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
547   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
548   * </ul>
549   */ public
550 int setName(String name) {
551    return libsbmlJNI.Reaction_setName(swigCPtr, this, name);
552  }
553
554  
555/**
556   * Sets the 'kineticLaw' subelement of this {@link Reaction} to a copy of the
557   * given {@link KineticLaw} object.
558   * <p>
559   * @param kl the {@link KineticLaw} object to use.
560   * <p>
561   * @return integer value indicating success/failure of the
562   * function.   The possible values
563   * returned by this function are:
564   * <ul>
565   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
566   * <li> {@link  libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH }
567   * <li> {@link  libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH }
568   * </ul>
569  */ public
570 int setKineticLaw(KineticLaw kl) {
571    return libsbmlJNI.Reaction_setKineticLaw(swigCPtr, this, KineticLaw.getCPtr(kl), kl);
572  }
573
574  
575/**
576   * Sets the value of the 'reversible' attribute of this {@link Reaction}.
577   * <p>
578   * @param value the value of the 'reversible' attribute.
579   * <p>
580   * @return integer value indicating success/failure of the
581   * function.   The possible values
582   * returned by this function are:
583   * <ul>
584   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
585   * </ul>
586   */ public
587 int setReversible(boolean value) {
588    return libsbmlJNI.Reaction_setReversible(swigCPtr, this, value);
589  }
590
591  
592/**
593   * Sets the value of the 'fast' attribute of this {@link Reaction}.
594   * <p>
595   * @param value the value of the 'fast' attribute.
596   * <p>
597   * @return integer value indicating success/failure of the
598   * function.   The possible values
599   * returned by this function are:
600   * <ul>
601   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
602   * </ul>
603   * <p>
604   * @warning SBML definitions before SBML Level&nbsp;2 Version&nbsp;2 incorrectly
605   * indicated that software tools could ignore this attribute if they did
606   * not implement support for the corresponding concept; however, further
607   * research in SBML has revealed that this is not true, and 'fast'
608   * <em>cannot be ignored</em> if it is set to <code>true.</code>  SBML Level&nbsp;2
609   * Versions 2, 3 and 4 therefore stipulate that if a model has any reactions
610   * with 'fast' set to <code>true</code>, a software tool must be able to respect
611   * the attribute or else indicate to the user that it does not have the
612   * capacity to do so.  Readers are directed to the SBML Level&nbsp;2 Version
613   * 4 specification, which provides more detail about the conditions under
614   * which a reaction can be considered to be fast in this sense.
615   */ public
616 int setFast(boolean value) {
617    return libsbmlJNI.Reaction_setFast(swigCPtr, this, value);
618  }
619
620  
621/**
622   * Sets the value of the 'compartment' attribute of this {@link Reaction}.
623   * <p>
624   * The string <code>sid</code> is copied.  
625   * <p>
626   * @param sid the string to use as the compartment of this {@link Reaction}
627   * <p>
628   * @return integer value indicating success/failure of the
629   * function.   The possible values
630   * returned by this function are:
631   * <ul>
632   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
633   * <li> {@link  libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE }
634   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
635   * </ul>
636   * <p>
637   * @note The 'compartment' attribute is available in SBML
638   * Level&nbsp;3 Version&nbsp;1 Core, but is not present on {@link Reaction} in
639   * lower Levels of SBML.
640   */ public
641 int setCompartment(String sid) {
642    return libsbmlJNI.Reaction_setCompartment(swigCPtr, this, sid);
643  }
644
645  
646/**
647   * Unsets the value of the 'name' attribute of this {@link Reaction}.
648   * <p>
649   * @return integer value indicating success/failure of the
650   * function.   The possible values
651   * returned by this function are:
652   * <ul>
653   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
654   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
655   * </ul>
656   */ public
657 int unsetName() {
658    return libsbmlJNI.Reaction_unsetName(swigCPtr, this);
659  }
660
661  
662/**
663   * Unsets the 'kineticLaw' subelement of this {@link Reaction}.
664   * <p>
665   * @return integer value indicating success/failure of the
666   * function.   The possible values
667   * returned by this function are:
668   * <ul>
669   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
670   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
671   * </ul>
672   */ public
673 int unsetKineticLaw() {
674    return libsbmlJNI.Reaction_unsetKineticLaw(swigCPtr, this);
675  }
676
677  
678/**
679   * Unsets the value of the 'fast' attribute of this {@link Reaction}.
680   * <p>
681   * @return integer value indicating success/failure of the
682   * function.   The possible values
683   * returned by this function are:
684   * <ul>
685   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
686   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
687   * </ul>
688   * <p>
689   * @warning In SBML Level&nbsp;1, 'fast' is optional with a default of 
690   * <code>false</code>, which means it is effectively always set (and reset to <code>false</code>
691   * if this method is called).  Further, SBML definitions before SBML
692   * Level&nbsp;2 Version&nbsp;2 incorrectly indicated that software tools could
693   * ignore this attribute if they did not implement support for the
694   * corresponding concept; however, further research in SBML has revealed
695   * that this is not true, and 'fast' <em>cannot be ignored</em> if it is
696   * set to <code>true.</code>  SBML Level&nbsp;2 Versions 2, 3 and 4 therefore stipulate
697   * that if a model has any reactions with 'fast' set to <code>true</code>, a
698   * software tool must be able to respect the attribute or else indicate
699   * to the user that it does not have the capacity to do so.  Readers are
700   * directed to the SBML Level&nbsp;2 Version&nbsp;4 specification, which provides
701   * more detail about the conditions under which a reaction can be
702   * considered to be fast in this sense.
703   */ public
704 int unsetFast() {
705    return libsbmlJNI.Reaction_unsetFast(swigCPtr, this);
706  }
707
708  
709/**
710   * Unsets the value of the 'compartment' attribute of this {@link Reaction}.
711   * <p>
712   * @return integer value indicating success/failure of the
713   * function.   The possible values
714   * returned by this function are:
715   * <ul>
716   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
717   * <li> {@link  libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE }
718   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
719   * </ul>
720   * <p>
721   * @note The 'compartment' attribute is available in SBML
722   * Level&nbsp;3 Version&nbsp;1 Core, but is not present on {@link Reaction} in
723   * lower Levels of SBML.
724   */ public
725 int unsetCompartment() {
726    return libsbmlJNI.Reaction_unsetCompartment(swigCPtr, this);
727  }
728
729  
730/**
731   * Adds a given {@link SpeciesReference} object as a reactant in this {@link Reaction}.
732   * <p>
733   * The {@link SpeciesReference} instance in <code>sr</code> is copied.
734   * <p>
735   * @param sr a {@link SpeciesReference} object referring to a {@link Species} in the
736   * enclosing {@link Model}
737   * <p>
738   * @return integer value indicating success/failure of the
739   * function.   The possible values
740   * returned by this function are:
741   * <ul>
742   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
743   * <li> {@link  libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH }
744   * <li> {@link  libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH }
745   * <li> {@link  libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID }
746   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT }
747   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
748   * </ul>
749   * <p>
750   * @note This method should be used with some caution.  The fact that
751   * this method <em>copies</em> the object passed to it means that the caller
752   * will be left holding a physically different object instance than the
753   * one contained in this {@link Reaction}.  Changes made to the original object
754   * instance (such as resetting attribute values) will <em>not affect the
755   * instance in the {@link Reaction}</em>.  In addition, the caller should make
756   * sure to free the original object if it is no longer being used, or
757   * else a memory leak will result.  Please see {@link Reaction#createReactant()}
758   * for a method that does not lead to these issues.
759   * <p>
760   * @see #createReactant()
761   */ public
762 int addReactant(SpeciesReference sr) {
763    return libsbmlJNI.Reaction_addReactant(swigCPtr, this, SpeciesReference.getCPtr(sr), sr);
764  }
765
766  
767/**
768   * Adds a given {@link SpeciesReference} object as a product in this {@link Reaction}.
769   * <p>
770   * The {@link SpeciesReference} instance in <code>sr</code> is copied.
771   * <p>
772   * @param sr a {@link SpeciesReference} object referring to a {@link Species} in the
773   * enclosing {@link Model}
774   * <p>
775   * @return integer value indicating success/failure of the
776   * function.   The possible values
777   * returned by this function are:
778   * <ul>
779   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
780   * <li> {@link  libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH }
781   * <li> {@link  libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH }
782   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
783   * </ul>
784   * <p>
785   * @note This method should be used with some caution.  The fact that
786   * this method <em>copies</em> the object passed to it means that the caller
787   * will be left holding a physically different object instance than the
788   * one contained in this {@link Reaction}.  Changes made to the original object
789   * instance (such as resetting attribute values) will <em>not affect the
790   * instance in the {@link Reaction}</em>.  In addition, the caller should make
791   * sure to free the original object if it is no longer being used, or
792   * else a memory leak will result.  Please see {@link Reaction#createProduct()}
793   * for a method that does not lead to these issues.
794   * <p>
795   * @see #createProduct()
796   */ public
797 int addProduct(SpeciesReference sr) {
798    return libsbmlJNI.Reaction_addProduct(swigCPtr, this, SpeciesReference.getCPtr(sr), sr);
799  }
800
801  
802/**
803   * Adds a given {@link ModifierSpeciesReference} object as a product in this
804   * {@link Reaction}.
805   * <p>
806   * The {@link ModifierSpeciesReference} instance in <code>msr</code> is copied.
807   * <p>
808   * @param msr a {@link ModifierSpeciesReference} object referring to a {@link Species} in
809   * the enclosing {@link Model}
810   * <p>
811   * @return integer value indicating success/failure of the
812   * function.   The possible values
813   * returned by this function are:
814   * <ul>
815   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
816   * <li> {@link  libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE }
817   * <li> {@link  libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH }
818   * <li> {@link  libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID }
819   * <li> {@link  libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH }
820   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
821   * </ul>
822   * <p>
823   * @note This method should be used with some caution.  The fact that
824   * this method <em>copies</em> the object passed to it means that the caller
825   * will be left holding a physically different object instance than the
826   * one contained in this {@link Reaction}.  Changes made to the original object
827   * instance (such as resetting attribute values) will <em>not affect the
828   * instance in the {@link Reaction}</em>.  In addition, the caller should make
829   * sure to free the original object if it is no longer being used, or
830   * else a memory leak will result.  Please see {@link Reaction#createModifier()}
831   * for a method that does not lead to these issues.
832   * <p>
833   * @see #createModifier()
834   */ public
835 int addModifier(ModifierSpeciesReference msr) {
836    return libsbmlJNI.Reaction_addModifier(swigCPtr, this, ModifierSpeciesReference.getCPtr(msr), msr);
837  }
838
839  
840/**
841   * Creates a new {@link SpeciesReference}, adds it to this {@link Reaction}'s list of
842   * reactants, and returns it.
843   * <p>
844   * @return a new {@link SpeciesReference} object.
845   */ public
846 SpeciesReference createReactant() {
847    long cPtr = libsbmlJNI.Reaction_createReactant(swigCPtr, this);
848    return (cPtr == 0) ? null : new SpeciesReference(cPtr, false);
849  }
850
851  
852/**
853   * Creates a new {@link SpeciesReference}, adds it to this {@link Reaction}'s list of
854   * products, and returns it.
855   * <p>
856   * @return a new {@link SpeciesReference} object.
857   */ public
858 SpeciesReference createProduct() {
859    long cPtr = libsbmlJNI.Reaction_createProduct(swigCPtr, this);
860    return (cPtr == 0) ? null : new SpeciesReference(cPtr, false);
861  }
862
863  
864/**
865   * Creates a new {@link ModifierSpeciesReference}, adds it to this {@link Reaction}'s
866   * list of modifiers and returns it.
867   * <p>
868   * @return a new {@link ModifierSpeciesReference} object.
869   */ public
870 ModifierSpeciesReference createModifier() {
871    long cPtr = libsbmlJNI.Reaction_createModifier(swigCPtr, this);
872    return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, false);
873  }
874
875  
876/**
877   * Creates a new {@link KineticLaw} object, installs it as this {@link Reaction}'s
878   * 'kineticLaw' subelement, and returns it.
879   * <p>
880   * If this {@link Reaction} had a previous {@link KineticLaw}, it will be destroyed.
881   * <p>
882   * @return the new {@link KineticLaw} object
883   */ public
884 KineticLaw createKineticLaw() {
885    long cPtr = libsbmlJNI.Reaction_createKineticLaw(swigCPtr, this);
886    return (cPtr == 0) ? null : new KineticLaw(cPtr, false);
887  }
888
889  
890/**
891   * Returns the list of reactants in this {@link Reaction} object.
892   * <p>
893   * @return the {@link ListOfSpeciesReferences} containing the references to the
894   * species acting as reactants in this reaction
895   */ public
896 ListOfSpeciesReferences getListOfReactants() {
897    long cPtr = libsbmlJNI.Reaction_getListOfReactants__SWIG_0(swigCPtr, this);
898    return (cPtr == 0) ? null : new ListOfSpeciesReferences(cPtr, false);
899  }
900
901  
902/**
903   * Returns the list of products in this {@link Reaction} object.
904   * <p>
905   * @return the {@link ListOfSpeciesReferences} containing the references to the
906   * species acting as products in this reaction
907   */ public
908 ListOfSpeciesReferences getListOfProducts() {
909    long cPtr = libsbmlJNI.Reaction_getListOfProducts__SWIG_0(swigCPtr, this);
910    return (cPtr == 0) ? null : new ListOfSpeciesReferences(cPtr, false);
911  }
912
913  
914/**
915   * Returns the list of modifiers in this {@link Reaction} object.
916   * <p>
917   * @return the {@link ListOfSpeciesReferences} containing the references to the
918   * species acting as modifiers in this reaction
919   */ public
920 ListOfSpeciesReferences getListOfModifiers() {
921    long cPtr = libsbmlJNI.Reaction_getListOfModifiers__SWIG_0(swigCPtr, this);
922    return (cPtr == 0) ? null : new ListOfSpeciesReferences(cPtr, false);
923  }
924
925  
926/**
927   * Returns the nth reactant species (as a {@link SpeciesReference} object) in 
928   * the list of reactants in this {@link Reaction}.
929   * <p>
930   * Callers should first call getNumReactants() to find out how many
931   * reactants there are, to avoid using an invalid index number.
932   * <p>
933   * @param n the index of the reactant sought.
934   * <p>
935   * @return the nth reactant (as a {@link SpeciesReference} object) of this
936   * {@link Reaction}.
937   */ public
938 SpeciesReference getReactant(long n) {
939    long cPtr = libsbmlJNI.Reaction_getReactant__SWIG_0(swigCPtr, this, n);
940    return (cPtr == 0) ? null : new SpeciesReference(cPtr, false);
941  }
942
943  
944/**
945   * Returns the reactant species (as a {@link SpeciesReference} object) having 
946   * a specific identifier in this {@link Reaction}.
947   * <p>
948   * @param species the identifier of the reactant {@link Species} ('species' 
949   * attribute of the reactant {@link SpeciesReference} object)
950   * <p>
951   * @return a {@link SpeciesReference} object, or <code>null</code> if no species with the
952   * given identifier <code>species</code> appears as a reactant in this {@link Reaction}.
953   */ public
954 SpeciesReference getReactant(String species) {
955    long cPtr = libsbmlJNI.Reaction_getReactant__SWIG_2(swigCPtr, this, species);
956    return (cPtr == 0) ? null : new SpeciesReference(cPtr, false);
957  }
958
959  
960/**
961   * Returns the nth product species (as a {@link SpeciesReference} object) in 
962   * the list of products in this {@link Reaction}.
963   * <p>
964   * Callers should first call getNumProducts() to find out how many
965   * products there are, to avoid using an invalid index number.
966   * <p>
967   * @param n the index of the product sought.
968   * <p>
969   * @return the nth product (as a {@link SpeciesReference} object) of this
970   * {@link Reaction}.
971   */ public
972 SpeciesReference getProduct(long n) {
973    long cPtr = libsbmlJNI.Reaction_getProduct__SWIG_0(swigCPtr, this, n);
974    return (cPtr == 0) ? null : new SpeciesReference(cPtr, false);
975  }
976
977  
978/**
979   * Returns the product species (as a {@link SpeciesReference} object) having 
980   * a specific identifier in this {@link Reaction}.
981   * <p>
982   * @param species the identifier of the product {@link Species} ('species'
983   * attribute of the product {@link SpeciesReference} object)
984   * <p>
985   * @return a {@link SpeciesReference} object, or <code>null</code> if no species with the
986   * given identifier <code>species</code> appears as a product in this {@link Reaction}.
987   */ public
988 SpeciesReference getProduct(String species) {
989    long cPtr = libsbmlJNI.Reaction_getProduct__SWIG_2(swigCPtr, this, species);
990    return (cPtr == 0) ? null : new SpeciesReference(cPtr, false);
991  }
992
993  
994/**
995   * Returns the nth modifier species (as a {@link ModifierSpeciesReference} object) 
996   * in the list of modifiers of this {@link Reaction}.
997   * <p>
998   * Callers should first call getNumModifiers() to find out how many
999   * modifiers there are, to avoid using an invalid index number.
1000   * <p>
1001   * @param n the index of the modifier species sought
1002   * <p>
1003   * @return the nth modifier (as a {@link ModifierSpeciesReference} object) of
1004   * this {@link Reaction}.
1005   */ public
1006 ModifierSpeciesReference getModifier(long n) {
1007    long cPtr = libsbmlJNI.Reaction_getModifier__SWIG_0(swigCPtr, this, n);
1008    return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, false);
1009  }
1010
1011  
1012/**
1013   * Returns the modifier species (as a {@link ModifierSpeciesReference} object) 
1014   * having a specific identifier in this {@link Reaction}.
1015   * <p>
1016   * @param species the identifier of the modifier {@link Species} ('species' 
1017   * attribute of the {@link ModifierSpeciesReference} object)
1018   * <p>
1019   * @return a {@link ModifierSpeciesReference} object, or <code>null</code> if no species with
1020   * the given identifier <code>species</code> appears as a modifier in this
1021   * {@link Reaction}.
1022   */ public
1023 ModifierSpeciesReference getModifier(String species) {
1024    long cPtr = libsbmlJNI.Reaction_getModifier__SWIG_2(swigCPtr, this, species);
1025    return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, false);
1026  }
1027
1028  
1029/**
1030   * Returns the number of reactant species in this {@link Reaction}.
1031   * <p>
1032   * @return the number of reactants in this {@link Reaction}.
1033   */ public
1034 long getNumReactants() {
1035    return libsbmlJNI.Reaction_getNumReactants(swigCPtr, this);
1036  }
1037
1038  
1039/**
1040   * Returns the number of product species in this {@link Reaction}.
1041   * <p>
1042   * @return the number of products in this {@link Reaction}.
1043   */ public
1044 long getNumProducts() {
1045    return libsbmlJNI.Reaction_getNumProducts(swigCPtr, this);
1046  }
1047
1048  
1049/**
1050   * Returns the number of modifier species in this {@link Reaction}.
1051   * <p>
1052   * @return the number of modifiers in this {@link Reaction}.
1053   */ public
1054 long getNumModifiers() {
1055    return libsbmlJNI.Reaction_getNumModifiers(swigCPtr, this);
1056  }
1057
1058  
1059/**
1060   * Removes the nth reactant species (SpeciesReference object) in the list of 
1061   * reactants in this {@link Reaction} and returns a pointer to it.
1062   * <p>
1063   * The caller owns the returned object and is responsible for deleting it.
1064   * The caller should first call getNumReactants() to find out how many
1065   * reactants there are, to avoid using an invalid index number.
1066   * <p>
1067   * @param n the index of the reactant {@link SpeciesReference} object to remove
1068   * <p>
1069   * @return the removed reactant {@link SpeciesReference} object, or <code>null</code> if the 
1070   * given index is out of range.
1071   */ public
1072 SpeciesReference removeReactant(long n) {
1073    long cPtr = libsbmlJNI.Reaction_removeReactant__SWIG_0(swigCPtr, this, n);
1074    return (cPtr == 0) ? null : new SpeciesReference(cPtr, true);
1075  }
1076
1077  
1078/**
1079   * Removes the reactant species (SpeciesReference object) having the given  
1080   * 'species' attribute in this {@link Reaction} and returns a pointer to it.
1081   * <p>
1082   * The caller owns the returned object and is responsible for deleting it.
1083   * <p>
1084   * @param species the 'species' attribute of the reactant {@link SpeciesReference} 
1085   * object
1086   * <p>
1087   * @return the removed reactant {@link SpeciesReference} object, or <code>null</code> if no 
1088   * reactant {@link SpeciesReference} object with the given 'species' attribute 
1089   * <code>species</code> exists in this {@link Reaction}.
1090   */ public
1091 SpeciesReference removeReactant(String species) {
1092    long cPtr = libsbmlJNI.Reaction_removeReactant__SWIG_1(swigCPtr, this, species);
1093    return (cPtr == 0) ? null : new SpeciesReference(cPtr, true);
1094  }
1095
1096  
1097/**
1098   * Removes the nth product species (SpeciesReference object) in the list of 
1099   * products in this {@link Reaction} and returns a pointer to it.
1100   * <p>
1101   * The caller owns the returned object and is responsible for deleting it.
1102   * The caller should first call getNumProducts() to find out how many
1103   * products there are, to avoid using an invalid index number.
1104   * <p>
1105   * @param n the index of the product {@link SpeciesReference} object to remove
1106   * <p>
1107   * @return the removed product {@link SpeciesReference} object, or <code>null</code> if the 
1108   * given index is out of range.
1109   */ public
1110 SpeciesReference removeProduct(long n) {
1111    long cPtr = libsbmlJNI.Reaction_removeProduct__SWIG_0(swigCPtr, this, n);
1112    return (cPtr == 0) ? null : new SpeciesReference(cPtr, true);
1113  }
1114
1115  
1116/**
1117   * Removes the product species (SpeciesReference object) having the given  
1118   * 'species' attribute in this {@link Reaction} and returns a pointer to it.
1119   * <p>
1120   * The caller owns the returned object and is responsible for deleting it.
1121   * <p>
1122   * @param species the 'species' attribute of the product {@link SpeciesReference} 
1123   * object
1124   * <p>
1125   * @return the removed product {@link SpeciesReference} object, or <code>null</code> if no 
1126   * product {@link SpeciesReference} object with the given 'species' attribute 
1127   * <code>species</code> exists in this {@link Reaction}.
1128   */ public
1129 SpeciesReference removeProduct(String species) {
1130    long cPtr = libsbmlJNI.Reaction_removeProduct__SWIG_1(swigCPtr, this, species);
1131    return (cPtr == 0) ? null : new SpeciesReference(cPtr, true);
1132  }
1133
1134  
1135/**
1136   * Removes the nth modifier species (ModifierSpeciesReference object) in 
1137   * the list of  modifiers in this {@link Reaction} and returns a pointer to it.
1138   * <p>
1139   * The caller owns the returned object and is responsible for deleting it.
1140   * The caller should first call getNumModifiers() to find out how many
1141   * modifiers there are, to avoid using an invalid index number.
1142   * <p>
1143   * @param n the index of the {@link ModifierSpeciesReference} object to remove
1144   * <p>
1145   * @return the removed {@link ModifierSpeciesReference} object, or <code>null</code> if the 
1146   * given index is out of range.
1147   */ public
1148 ModifierSpeciesReference removeModifier(long n) {
1149    long cPtr = libsbmlJNI.Reaction_removeModifier__SWIG_0(swigCPtr, this, n);
1150    return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, true);
1151  }
1152
1153  
1154/**
1155   * Removes the modifier species (ModifierSpeciesReference object) having 
1156   * the given 'species' attribute in this {@link Reaction} and returns a pointer to it.
1157   * <p>
1158   * The caller owns the returned object and is responsible for deleting it.
1159   * <p>
1160   * @param species the 'species' attribute of the {@link ModifierSpeciesReference} 
1161   * object
1162   * <p>
1163   * @return the removed {@link ModifierSpeciesReference} object, or <code>null</code> if no 
1164   * {@link ModifierSpeciesReference} object with the given 'species' attribute @p 
1165   * species exists in this {@link Reaction}.
1166   */ public
1167 ModifierSpeciesReference removeModifier(String species) {
1168    long cPtr = libsbmlJNI.Reaction_removeModifier__SWIG_1(swigCPtr, this, species);
1169    return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, true);
1170  }
1171
1172  
1173/**
1174   * Sets this SBML object to child SBML objects (if any).
1175   * (Creates a child-parent relationship by the parent)
1176   * <p>
1177   * Subclasses must override this function if they define
1178   * one ore more child elements.
1179   * Basically, this function needs to be called in
1180   * constructor, copy constructor and assignment operator.
1181   * <p>
1182   * @see setSBMLDocument
1183   * @see enablePackageInternal
1184   * @internal
1185   */ public
1186 void connectToChild() {
1187    libsbmlJNI.Reaction_connectToChild(swigCPtr, this);
1188  }
1189
1190  
1191/**
1192   * Enables/Disables the given package with this element and child
1193   * elements (if any).
1194   * (This is an internal implementation for enablePackage function)
1195   * <p>
1196   * @note Subclasses of the SBML Core package in which one or more child
1197   * elements are defined must override this function.
1198   * @internal
1199   */ public
1200 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
1201    libsbmlJNI.Reaction_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
1202  }
1203
1204  
1205/**
1206   * Returns the libSBML type code for this SBML object.
1207   * <p>
1208   * LibSBML attaches an identifying code to every
1209   * kind of SBML object.  These are known as <em>SBML type codes</em>.  In
1210   * other languages, the set of type codes is stored in an enumeration; in
1211   * the Java language interface for libSBML, the type codes are defined as
1212   * static integer constants in the interface class {@link
1213   * libsbmlConstants}.  The names of the type codes all begin with the
1214   * characters <code>SBML_.</code> 
1215   * <p>
1216   * @return the SBML type code for this object, or {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (default).
1217   * <p>
1218   * @see #getElementName()
1219   */ public
1220 int getTypeCode() {
1221    return libsbmlJNI.Reaction_getTypeCode(swigCPtr, this);
1222  }
1223
1224  
1225/**
1226   * Returns the XML element name of this object, which for {@link Reaction}, is
1227   * always <code>'reaction'.</code>
1228   * <p>
1229   * @return the name of this element, i.e., <code>'reaction'.</code>
1230   */ public
1231 String getElementName() {
1232    return libsbmlJNI.Reaction_getElementName(swigCPtr, this);
1233  }
1234
1235  
1236/**
1237   * Predicate returning <code>true</code> if all the required attributes for this
1238   * {@link Reaction} object have been set.
1239   * <p>
1240   * @note The required attributes for a {@link Reaction} object are:
1241   * <ul>
1242   * <li> 'id' (or 'name' in SBML Level&nbsp;1)
1243   * <li> 'fast' (in Level&nbsp;3 only, where it is defined as a required attribute)
1244   * <li> 'reversible' (in Level&nbsp;3 only, where it is defined as a required attribute)
1245   * </ul>
1246   * <p>
1247   * @return a boolean value indicating whether all the required
1248   * attributes for this object have been defined.
1249   */ public
1250 boolean hasRequiredAttributes() {
1251    return libsbmlJNI.Reaction_hasRequiredAttributes(swigCPtr, this);
1252  }
1253
1254}