1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.2
4  *
5  * Do not make changes to this file unless you know what you are doing--modify
6  * the SWIG interface file instead.
7  * ----------------------------------------------------------------------------- */
8 
9 package org.sbml.libsbml;
10 
11 /**
12  *  The rate expression for an SBML reaction.
13  <p>
14  * An object of class {@link KineticLaw} is used to describe the rate at which the
15  * process defined by a given {@link Reaction} takes place.  {@link KineticLaw} has
16  * subelements called 'math' (for MathML content) and 'listOfParameters'
17  * (of class {@link ListOfParameters}), in addition to the attributes and
18  * subelements it inherits from {@link SBase}.
19  <p>
20  * {@link KineticLaw}'s 'math' subelement for holding a MathML formula (required
21  * through SBML Level&nbsp;3 Version&nbsp;1, but optional as of SBML
22  * Level&nbsp;3 Version&nbsp;2) defines the
23  * rate of the reaction.  The formula may refer to other entities in a
24  * model as well as local parameter definitions within the scope of the
25  * {@link Reaction} (see below).  It is important to keep in mind, however, that
26  * the only {@link Species} identifiers that can be used in this formula are those
27  * declared in the lists of reactants, products and modifiers in the
28  * {@link Reaction} structure.  (In other words, before a species can be referenced
29  * in the {@link KineticLaw}, it must be declared in one of those lists.)
30  <p>
31  * {@link KineticLaw} provides a way to define <em>local</em> parameters whose
32  * identifiers can be used in the 'math' formula of that {@link KineticLaw}
33  * instance.  Prior to SBML Level&nbsp;3, these parameter definitions are
34  * stored inside a 'listOfParameters' subelement containing {@link Parameter}
35  * objects; in SBML Level&nbsp;3, this is achieved using a specialized
36  * object class called {@link LocalParameter} and the containing subelement is
37  * called 'listOfLocalParameters'.  In both cases, the parameters so
38  * defined are only visible within the {@link KineticLaw} (or, as of SBML
39  * Level&nbsp;3 Version&nbsp;2, only visible within the parent {@link Reaction});
40  * they cannot be accessed
41  * outside.  A local parameter within one reaction is not visible from
42  * within another reaction, nor is it visible to any other construct
43  * outside of the {@link KineticLaw} in which it is defined.  In addition, another
44  * important feature is that if such a {@link Parameter} (or in Level&nbsp;3,
45  * {@link LocalParameter}) object has the same identifier as another object in the
46  * scope of the enclosing {@link Model}, the definition inside the {@link KineticLaw} takes
47  * precedence.  In other words, within the {@link KineticLaw}'s 'math' formula,
48  * references to local parameter identifiers <strong>shadow any identical
49  * global identifiers</strong>.
50  <p>
51  * The values of local parameters defined within {@link KineticLaw} objects cannot
52  * change.  In SBML Level&nbsp;3, this quality is built into the
53  * {@link LocalParameter} construct.  In Level&nbsp;2, where the same kind of
54  * {@link Parameter} object class is used as for global parameters, the {@link Parameter}
55  * objects' 'constant' attribute must always have a value of <code>true</code>
56  * (either explicitly or left to its default value).
57  <p>
58  * <h2>A warning about identifier shadowing</h2>
59  <p>
60  * A common misconception is that different classes of objects (e.g.,
61  * species, compartments, parameters) in SBML have different identifier
62  * scopes.  They do not.  The implication is that if a {@link KineticLaw}'s local
63  * parameter definition uses an identifier identical to <em>any</em> other
64  * identifier defined in the model outside the {@link KineticLaw}, even if the
65  * other identifier does <em>not</em> belong to a parameter type of object, the
66  * local parameter's identifier takes precedence within that {@link KineticLaw}'s
67  * 'math' formula.  It is not an error in SBML for identifiers to shadow
68  * each other this way, but can lead to confusing and subtle errors.
69  <p>
70  * <h2>SBML Level/Version differences</h2>
71  <p>
72  * In SBML Level&nbsp;2 Version&nbsp;1, the SBML specification
73  * included two additional attributes on {@link KineticLaw} called 'substanceUnits'
74  * and 'timeUnits'.  They were removed beginning with SBML Level&nbsp;2
75  * Version&nbsp;2 because further research determined they introduced many
76  * problems.  The most significant problem was that their use could easily
77  * lead to the creation of valid models whose reactions nevertheless could
78  * not be integrated into a system of equations without outside knowledge
79  * for converting the quantities used.  Examination of real-life models
80  * revealed that a common reason for using 'substanceUnits' on {@link KineticLaw}
81  * was to set the units of all reactions to the same set of substance
82  * units, something that is better achieved by using {@link UnitDefinition} to
83  * redefine <code>'substance'</code> for the whole {@link Model}.
84  <p>
85  * As mentioned above, in SBML Level&nbsp;2 Versions 2&ndash;4, local
86  * parameters are of class {@link Parameter}.  In SBML Level&nbsp;3, the class of
87  * object is {@link LocalParameter}.
88  <p>
89  * In SBML Level&nbsp;3 Version&nbsp;2, the scope of the {@link LocalParameter}
90  * was expanded to the entire {@link Reaction}, instead of just the {@link KineticLaw}.
91  * This introduced a single new restriction: an L3v2 {@link LocalParameter} may
92  * not now shadow the <code>id</code> of any {@link Species} referenced by a {@link SpeciesReference}
93  * in the same {@link Reaction}.  Other than that, there is no difference in any
94  * core construct.  However, packages may take advantage of this new scope by
95  * adding elements to the {@link Reaction} that may now reference a {@link LocalParameter}
96  * defined in the same {@link Reaction}.
97  */
98 
99 public class KineticLaw extends SBase {
100    private long swigCPtr;
101 
KineticLaw(long cPtr, boolean cMemoryOwn)102    protected KineticLaw(long cPtr, boolean cMemoryOwn)
103    {
104      super(libsbmlJNI.KineticLaw_SWIGUpcast(cPtr), cMemoryOwn);
105      swigCPtr = cPtr;
106    }
107 
getCPtr(KineticLaw obj)108    protected static long getCPtr(KineticLaw obj)
109    {
110      return (obj == null) ? 0 : obj.swigCPtr;
111    }
112 
getCPtrAndDisown(KineticLaw obj)113    protected static long getCPtrAndDisown (KineticLaw obj)
114    {
115      long ptr = 0;
116 
117      if (obj != null)
118      {
119        ptr             = obj.swigCPtr;
120        obj.swigCMemOwn = false;
121      }
122 
123      return ptr;
124    }
125 
126   @SuppressWarnings("deprecation")
finalize()127   protected void finalize() {
128     delete();
129   }
130 
delete()131   public synchronized void delete() {
132     if (swigCPtr != 0) {
133       if (swigCMemOwn) {
134         swigCMemOwn = false;
135         libsbmlJNI.delete_KineticLaw(swigCPtr);
136       }
137       swigCPtr = 0;
138     }
139     super.delete();
140   }
141 
142 
143 /**
144    * Creates a new {@link KineticLaw} using the given SBML <code>level</code> and <code>version</code>
145    * values.
146    <p>
147    * @param level a long integer, the SBML Level to assign to this {@link KineticLaw}.
148    <p>
149    * @param version a long integer, the SBML Version to assign to this
150    * {@link KineticLaw}.
151    <p>
152    * <p>
153  * @throws SBMLConstructorException
154  * Thrown if the given <code>level</code> and <code>version</code> combination are invalid
155  * or if this object is incompatible with the given level and version.
156    <p>
157    * <p>
158  * @note Attempting to add an object to an {@link SBMLDocument} having a different
159  * combination of SBML Level, Version and XML namespaces than the object
160  * itself will result in an error at the time a caller attempts to make the
161  * addition.  A parent object must have compatible Level, Version and XML
162  * namespaces.  (Strictly speaking, a parent may also have more XML
163  * namespaces than a child, but the reverse is not permitted.)  The
164  * restriction is necessary to ensure that an SBML model has a consistent
165  * overall structure.  This requires callers to manage their objects
166  * carefully, but the benefit is increased flexibility in how models can be
167  * created by permitting callers to create objects bottom-up if desired.  In
168  * situations where objects are not yet attached to parents (e.g.,
169  * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
170  * libSBML determine such things as whether it is valid to assign a
171  * particular value to an attribute.
172    */ public
KineticLaw(long level, long version)173  KineticLaw(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
174     this(libsbmlJNI.new_KineticLaw__SWIG_0(level, version), true);
175   }
176 
177 
178 /**
179    * Creates a new {@link KineticLaw} using the given {@link SBMLNamespaces} object
180    * <code>sbmlns</code>.
181    <p>
182    * <p>
183  * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces
184  * information.  It is used to communicate the SBML Level, Version, and (in
185  * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
186  * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an
187  * {@link SBMLNamespaces} object somewhere in a program once, then hand that object
188  * as needed to object constructors that accept {@link SBMLNamespaces} as arguments.
189    <p>
190    * @param sbmlns an {@link SBMLNamespaces} object.
191    <p>
192    * <p>
193  * @throws SBMLConstructorException
194  * Thrown if the given <code>sbmlns</code> is inconsistent or incompatible
195  * with this object.
196    <p>
197    * <p>
198  * @note Attempting to add an object to an {@link SBMLDocument} having a different
199  * combination of SBML Level, Version and XML namespaces than the object
200  * itself will result in an error at the time a caller attempts to make the
201  * addition.  A parent object must have compatible Level, Version and XML
202  * namespaces.  (Strictly speaking, a parent may also have more XML
203  * namespaces than a child, but the reverse is not permitted.)  The
204  * restriction is necessary to ensure that an SBML model has a consistent
205  * overall structure.  This requires callers to manage their objects
206  * carefully, but the benefit is increased flexibility in how models can be
207  * created by permitting callers to create objects bottom-up if desired.  In
208  * situations where objects are not yet attached to parents (e.g.,
209  * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
210  * libSBML determine such things as whether it is valid to assign a
211  * particular value to an attribute.
212    */ public
KineticLaw(SBMLNamespaces sbmlns)213  KineticLaw(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException {
214     this(libsbmlJNI.new_KineticLaw__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true);
215   }
216 
217 
218 /**
219    * Copy constructor; creates a copy of this {@link KineticLaw}.
220    <p>
221    * @param orig the object to copy.
222    */ public
KineticLaw(KineticLaw orig)223  KineticLaw(KineticLaw orig) throws org.sbml.libsbml.SBMLConstructorException {
224     this(libsbmlJNI.new_KineticLaw__SWIG_2(KineticLaw.getCPtr(orig), orig), true);
225   }
226 
227 
228 /**
229    * Creates and returns a deep copy of this {@link KineticLaw} object.
230    <p>
231    * @return the (deep) copy of this {@link KineticLaw} object.
232    */ public
cloneObject()233  KineticLaw cloneObject() {
234     long cPtr = libsbmlJNI.KineticLaw_cloneObject(swigCPtr, this);
235     return (cPtr == 0) ? null : new KineticLaw(cPtr, true);
236   }
237 
238 
239 /**
240    * Returns the first child element found that has the given <code>id</code> in the
241    * model-wide SId namespace, or <code>null</code> if no such object is found.
242    <p>
243    * @param id string representing the id of the object to find.
244    <p>
245    * @return pointer to the first element found with the given <code>id</code>.
246    */ public
getElementBySId(String id)247  SBase getElementBySId(String id) {
248   return libsbml.DowncastSBase(libsbmlJNI.KineticLaw_getElementBySId(swigCPtr, this, id), false);
249 }
250 
251 
252 /**
253    * Returns the first child element it can find with the given <code>metaid</code>, or
254    * <code>null</code> if no such object is found.
255    <p>
256    * @param metaid string representing the metaid of the object to find.
257    <p>
258    * @return pointer to the first element found with the given <code>metaid</code>.
259    */ public
getElementByMetaId(String metaid)260  SBase getElementByMetaId(String metaid) {
261   return libsbml.DowncastSBase(libsbmlJNI.KineticLaw_getElementByMetaId(swigCPtr, this, metaid), false);
262 }
263 
264 
265 /**
266    * Returns the mathematical formula for this {@link KineticLaw} object and return
267    * it as as a text string.
268    <p>
269    * This is fundamentally equivalent to
270    * {@link KineticLaw#getMath()}.
271    * This variant is provided principally for compatibility compatibility
272    * with SBML Level&nbsp;1.
273    <p>
274    * @return a string representing the formula of this {@link KineticLaw}.
275    <p>
276    * @note SBML Level&nbsp;1 uses a text-string format for mathematical formulas.
277 SBML Level&nbsp;2 uses MathML, an XML format for representing mathematical
278 expressions.  LibSBML provides an Abstract Syntax Tree API for working with
279 mathematical expressions; this API is more powerful than working with
280 formulas directly in text form, and ASTs can be translated into either
281 MathML or the text-string syntax.  The libSBML methods that accept
282 text-string formulas directly (such as this constructor) are provided for
283 SBML Level&nbsp;1 compatibility, but developers are encouraged to use the
284 AST mechanisms.
285 
286    <p>
287    * @see #getMath()
288    */ public
getFormula()289  String getFormula() {
290     return libsbmlJNI.KineticLaw_getFormula(swigCPtr, this);
291   }
292 
293 
294 /**
295    * Returns the mathematical formula for this {@link KineticLaw} object and return
296    * it as as an AST.
297    <p>
298    * This is fundamentally equivalent to
299    * {@link KineticLaw#getFormula()}.
300    * The latter is provided principally for compatibility compatibility
301    * with SBML Level&nbsp;1, which represented mathematical formulas in
302    * text-string form.
303    <p>
304    * @return the {@link ASTNode} representation of the mathematical formula,
305    * or <code>null</code> if the math is not set.
306    <p>
307    * @see #getFormula()
308    */ public
getMath()309  ASTNode getMath() {
310     long cPtr = libsbmlJNI.KineticLaw_getMath(swigCPtr, this);
311     return (cPtr == 0) ? null : new ASTNode(cPtr, false);
312   }
313 
314 
315 /**
316    * (SBML Level&nbsp;2 Version&nbsp;1 only) Returns the value of the
317    * 'timeUnits' attribute of this {@link KineticLaw} object.
318    <p>
319    * @return the 'timeUnits' attribute value.
320    <p>
321    * <p>
322  * @note The attributes 'timeUnits' and 'substanceUnits' are present only
323  * in SBML Level&nbsp;2 Version&nbsp;1.  In SBML Level&nbsp;2
324  * Version&nbsp;2, the 'timeUnits' and 'substanceUnits' attributes were
325  * removed.  For compatibility with new versions of SBML, users are
326  * cautioned to avoid these attributes.
327    */ public
getTimeUnits()328  String getTimeUnits() {
329     return libsbmlJNI.KineticLaw_getTimeUnits(swigCPtr, this);
330   }
331 
332 
333 /**
334    * (SBML Level&nbsp;2 Version&nbsp;1 only) Returns the value of the
335    * 'substanceUnits' attribute of this {@link KineticLaw} object.
336    <p>
337    * @return the 'substanceUnits' attribute value.
338    <p>
339    * <p>
340  * @note The attributes 'timeUnits' and 'substanceUnits' are present only
341  * in SBML Level&nbsp;2 Version&nbsp;1.  In SBML Level&nbsp;2
342  * Version&nbsp;2, the 'timeUnits' and 'substanceUnits' attributes were
343  * removed.  For compatibility with new versions of SBML, users are
344  * cautioned to avoid these attributes.
345    */ public
getSubstanceUnits()346  String getSubstanceUnits() {
347     return libsbmlJNI.KineticLaw_getSubstanceUnits(swigCPtr, this);
348   }
349 
350 
351 /**
352    * Predicate returning <code>true</code> if this {@link KineticLaw}'s 'formula' attribute is
353    * set.
354    <p>
355    * This is functionally identical to the method
356    * {@link KineticLaw#isSetMath()}.  It is
357    * provided in order to mirror the parallel between
358    * {@link KineticLaw#getFormula()} and
359    * {@link KineticLaw#getMath()}.
360    <p>
361    * @return <code>true</code> if the formula (meaning the <code>math</code> subelement) of
362    * this {@link KineticLaw} is set, <code>false</code> otherwise.
363    <p>
364    * @note SBML Level&nbsp;1 uses a text-string format for mathematical formulas.
365 SBML Level&nbsp;2 uses MathML, an XML format for representing mathematical
366 expressions.  LibSBML provides an Abstract Syntax Tree API for working with
367 mathematical expressions; this API is more powerful than working with
368 formulas directly in text form, and ASTs can be translated into either
369 MathML or the text-string syntax.  The libSBML methods that accept
370 text-string formulas directly (such as this constructor) are provided for
371 SBML Level&nbsp;1 compatibility, but developers are encouraged to use the
372 AST mechanisms.
373 
374    <p>
375    * @see #isSetMath()
376    */ public
isSetFormula()377  boolean isSetFormula() {
378     return libsbmlJNI.KineticLaw_isSetFormula(swigCPtr, this);
379   }
380 
381 
382 /**
383    * Predicate returning <code>true</code> if this Kinetic's 'math' subelement is set.
384    <p>
385    * This is identical to the method
386    * {@link KineticLaw#isSetFormula()}.
387    * It is provided in order to mirror the parallel between
388    * {@link KineticLaw#getFormula()} and
389    * {@link KineticLaw#getMath()}.
390    <p>
391    * @return <code>true</code> if the formula (meaning the <code>math</code> subelement) of
392    * this {@link KineticLaw} is set, <code>false</code> otherwise.
393    <p>
394    * @see #isSetFormula()
395    */ public
isSetMath()396  boolean isSetMath() {
397     return libsbmlJNI.KineticLaw_isSetMath(swigCPtr, this);
398   }
399 
400 
401 /**
402    * (SBML Level&nbsp;2 Version&nbsp;1 only) Predicate returning <code>true</code> if
403    * this {@link SpeciesReference}'s 'timeUnits' attribute is set.
404    <p>
405    * @return <code>true</code> if the 'timeUnits' attribute of this {@link KineticLaw} object
406    * is set, <code>false</code> otherwise.
407    <p>
408    * <p>
409  * @note The attributes 'timeUnits' and 'substanceUnits' are present only
410  * in SBML Level&nbsp;2 Version&nbsp;1.  In SBML Level&nbsp;2
411  * Version&nbsp;2, the 'timeUnits' and 'substanceUnits' attributes were
412  * removed.  For compatibility with new versions of SBML, users are
413  * cautioned to avoid these attributes.
414    */ public
isSetTimeUnits()415  boolean isSetTimeUnits() {
416     return libsbmlJNI.KineticLaw_isSetTimeUnits(swigCPtr, this);
417   }
418 
419 
420 /**
421    * (SBML Level&nbsp;2 Version&nbsp;1 only) Predicate returning <code>true</code> if
422    * this {@link SpeciesReference}'s 'substanceUnits' attribute is set.
423    <p>
424    * @return <code>true</code> if the 'substanceUnits' attribute of this {@link KineticLaw}
425    * object is set, <code>false</code> otherwise.
426    <p>
427    * <p>
428  * @note The attributes 'timeUnits' and 'substanceUnits' are present only
429  * in SBML Level&nbsp;2 Version&nbsp;1.  In SBML Level&nbsp;2
430  * Version&nbsp;2, the 'timeUnits' and 'substanceUnits' attributes were
431  * removed.  For compatibility with new versions of SBML, users are
432  * cautioned to avoid these attributes.
433    */ public
isSetSubstanceUnits()434  boolean isSetSubstanceUnits() {
435     return libsbmlJNI.KineticLaw_isSetSubstanceUnits(swigCPtr, this);
436   }
437 
438 
439 /**
440    * Sets the mathematical expression of this {@link KineticLaw} instance to the
441    * given <code>formula</code>.
442    <p>
443    * The given <code>formula</code> string is copied.  Internally, libSBML stores the
444    * mathematical expression as an {@link ASTNode}.
445    <p>
446    * @param formula the mathematical expression to use, represented in
447    * text-string form.
448    <p>
449    * <p>
450  * @return integer value indicating success/failure of the
451  * function.   The possible values
452  * returned by this function are:
453    * <ul>
454    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
455    * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT}
456    *
457    * </ul> <p>
458    * @note SBML Level&nbsp;1 uses a text-string format for mathematical formulas.
459 SBML Level&nbsp;2 uses MathML, an XML format for representing mathematical
460 expressions.  LibSBML provides an Abstract Syntax Tree API for working with
461 mathematical expressions; this API is more powerful than working with
462 formulas directly in text form, and ASTs can be translated into either
463 MathML or the text-string syntax.  The libSBML methods that accept
464 text-string formulas directly (such as this constructor) are provided for
465 SBML Level&nbsp;1 compatibility, but developers are encouraged to use the
466 AST mechanisms.
467 
468    <p>
469    * @see #setMath(ASTNode math)
470    */ public
setFormula(String formula)471  int setFormula(String formula) {
472     return libsbmlJNI.KineticLaw_setFormula(swigCPtr, this, formula);
473   }
474 
475 
476 /**
477    * Sets the mathematical expression of this {@link KineticLaw} instance to a copy
478    * of the given {@link ASTNode}.
479    <p>
480    * This is fundamentally identical to
481    * {@link KineticLaw#setFormula(String formula)}.
482    * The latter is provided principally for compatibility compatibility with
483    * SBML Level&nbsp;1, which represented mathematical formulas in text-string
484    * form.
485    <p>
486    * @param math an {@link ASTNode} representing a formula tree.
487    <p>
488    * <p>
489  * @return integer value indicating success/failure of the
490  * function.   The possible values
491  * returned by this function are:
492    * <ul>
493    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
494    * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT}
495    *
496    * </ul> <p>
497    * @see #setFormula(String formula)
498    */ public
setMath(ASTNode math)499  int setMath(ASTNode math) {
500     return libsbmlJNI.KineticLaw_setMath(swigCPtr, this, ASTNode.getCPtr(math), math);
501   }
502 
503 
504 /**
505    * (SBML Level&nbsp;2 Version&nbsp;1 only) Sets the 'timeUnits' attribute
506    * of this {@link KineticLaw} object to a copy of the identifier in <code>sid</code>.
507    <p>
508    * @param sid the identifier of the units to use.
509    <p>
510    * <p>
511  * @return integer value indicating success/failure of the
512  * function.   The possible values
513  * returned by this function are:
514    * <ul>
515    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
516    * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
517    * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
518    *
519    * </ul> <p>
520    * <p>
521  * @note The attributes 'timeUnits' and 'substanceUnits' are present only
522  * in SBML Level&nbsp;2 Version&nbsp;1.  In SBML Level&nbsp;2
523  * Version&nbsp;2, the 'timeUnits' and 'substanceUnits' attributes were
524  * removed.  For compatibility with new versions of SBML, users are
525  * cautioned to avoid these attributes.
526    */ public
setTimeUnits(String sid)527  int setTimeUnits(String sid) {
528     return libsbmlJNI.KineticLaw_setTimeUnits(swigCPtr, this, sid);
529   }
530 
531 
532 /**
533    * (SBML Level&nbsp;2 Version&nbsp;1 only) Sets the 'substanceUnits'
534    * attribute of this {@link KineticLaw} object to a copy of the identifier given
535    * in <code>sid</code>.
536    <p>
537    * @param sid the identifier of the units to use.
538    <p>
539    * <p>
540  * @return integer value indicating success/failure of the
541  * function.   The possible values
542  * returned by this function are:
543    * <ul>
544    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
545    * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
546    * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
547    *
548    * </ul> <p>
549    * <p>
550  * @note The attributes 'timeUnits' and 'substanceUnits' are present only
551  * in SBML Level&nbsp;2 Version&nbsp;1.  In SBML Level&nbsp;2
552  * Version&nbsp;2, the 'timeUnits' and 'substanceUnits' attributes were
553  * removed.  For compatibility with new versions of SBML, users are
554  * cautioned to avoid these attributes.
555    */ public
setSubstanceUnits(String sid)556  int setSubstanceUnits(String sid) {
557     return libsbmlJNI.KineticLaw_setSubstanceUnits(swigCPtr, this, sid);
558   }
559 
560 
561 /**
562    * (SBML Level&nbsp;2 Version&nbsp;1 only) Unsets the 'timeUnits'
563    * attribugte of this {@link KineticLaw} object.
564    <p>
565    * <p>
566  * @return integer value indicating success/failure of the
567  * function.   The possible values
568  * returned by this function are:
569    * <ul>
570    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
571    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
572    * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
573    *
574    * </ul> <p>
575    * <p>
576  * @note The attributes 'timeUnits' and 'substanceUnits' are present only
577  * in SBML Level&nbsp;2 Version&nbsp;1.  In SBML Level&nbsp;2
578  * Version&nbsp;2, the 'timeUnits' and 'substanceUnits' attributes were
579  * removed.  For compatibility with new versions of SBML, users are
580  * cautioned to avoid these attributes.
581    */ public
unsetTimeUnits()582  int unsetTimeUnits() {
583     return libsbmlJNI.KineticLaw_unsetTimeUnits(swigCPtr, this);
584   }
585 
586 
587 /**
588    * (SBML Level&nbsp;2 Version&nbsp;1 only) Unsets the 'substanceUnits'
589    * attribute of this {@link KineticLaw} object.
590    <p>
591    * <p>
592  * @return integer value indicating success/failure of the
593  * function.   The possible values
594  * returned by this function are:
595    * <ul>
596    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
597    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
598    * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
599    *
600    * </ul> <p>
601    * <p>
602  * @note The attributes 'timeUnits' and 'substanceUnits' are present only
603  * in SBML Level&nbsp;2 Version&nbsp;1.  In SBML Level&nbsp;2
604  * Version&nbsp;2, the 'timeUnits' and 'substanceUnits' attributes were
605  * removed.  For compatibility with new versions of SBML, users are
606  * cautioned to avoid these attributes.
607    */ public
unsetSubstanceUnits()608  int unsetSubstanceUnits() {
609     return libsbmlJNI.KineticLaw_unsetSubstanceUnits(swigCPtr, this);
610   }
611 
612 
613 /**
614    * Adds a copy of the given {@link Parameter} object to the list of local
615    * parameters in this {@link KineticLaw}.
616    * <p>
617  * This function should be used for SBML Level&nbsp;1 and Level&nbsp;2 documents,
618  * as the equivalent constructs in Level&nbsp;3 are {@link LocalParameter} objects instead.
619    <p>
620    * @param p the {@link Parameter} to add.
621    <p>
622    * <p>
623  * @return integer value indicating success/failure of the
624  * function.   The possible values
625  * returned by this function are:
626    * <ul>
627    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
628    * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH}
629    * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH}
630    * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID}
631    * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT}
632    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
633    *
634    * </ul> <p>
635    * <p>
636  * @note This method should be used with some caution.  The fact that this
637  * method <em>copies</em> the object passed to it means that the caller will be
638  * left holding a physically different object instance than the one contained
639  * inside this object.  Changes made to the original object instance (such as
640  * resetting attribute values) will <em>not affect the instance in this
641  * object</em>.  In addition, the caller should make sure to free the
642  * original object if it is no longer being used, or else a memory leak will
643  * result.  Please see other methods on this class (particularly a
644  * corresponding method whose name begins with the word <code>create</code>)
645  * for alternatives that do not lead to these issues.
646    <p>
647    * @see #createParameter()
648    */ public
addParameter(Parameter p)649  int addParameter(Parameter p) {
650     return libsbmlJNI.KineticLaw_addParameter(swigCPtr, this, Parameter.getCPtr(p), p);
651   }
652 
653 
654 /**
655    * Adds a copy of the given {@link LocalParameter} object to the list of local
656    * parameters in this {@link KineticLaw}.
657    * <p>
658  * This function should be used for SBML Level&nbsp;3 documents, as the equivalent
659  * constructs in Level&nbsp;2 and Level&nbsp;1 are {@link Parameter} objects instead.
660    <p>
661    * @param p the {@link LocalParameter} to add.
662    <p>
663    * <p>
664  * @return integer value indicating success/failure of the
665  * function.   The possible values
666  * returned by this function are:
667    * <ul>
668    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
669    * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH}
670    * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH}
671    * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID}
672    * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT}
673    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
674    *
675    * </ul> <p>
676    * <p>
677  * @note This method should be used with some caution.  The fact that this
678  * method <em>copies</em> the object passed to it means that the caller will be
679  * left holding a physically different object instance than the one contained
680  * inside this object.  Changes made to the original object instance (such as
681  * resetting attribute values) will <em>not affect the instance in this
682  * object</em>.  In addition, the caller should make sure to free the
683  * original object if it is no longer being used, or else a memory leak will
684  * result.  Please see other methods on this class (particularly a
685  * corresponding method whose name begins with the word <code>create</code>)
686  * for alternatives that do not lead to these issues.
687    <p>
688    * @see #createLocalParameter()
689    */ public
addLocalParameter(LocalParameter p)690  int addLocalParameter(LocalParameter p) {
691     return libsbmlJNI.KineticLaw_addLocalParameter(swigCPtr, this, LocalParameter.getCPtr(p), p);
692   }
693 
694 
695 /**
696    * Creates a new {@link Parameter} object, adds it to this {@link KineticLaw}'s list of
697    * parameters, and returns the {@link Parameter} object created.
698    * <p>
699  * This function should be used for SBML Level&nbsp;1 and Level&nbsp;2 documents,
700  * as the equivalent constructs in Level&nbsp;3 are {@link LocalParameter} objects instead.
701    <p>
702    * @return a new {@link Parameter} object instance.
703    <p>
704    * @see #addParameter(Parameter p)
705    */ public
createParameter()706  Parameter createParameter() {
707     long cPtr = libsbmlJNI.KineticLaw_createParameter(swigCPtr, this);
708     return (cPtr == 0) ? null : new Parameter(cPtr, false);
709   }
710 
711 
712 /**
713    * Creates a new {@link LocalParameter} object, adds it to this {@link KineticLaw}'s list
714    * of local parameters, and returns the {@link LocalParameter} object created.
715    * <p>
716  * This function should be used for SBML Level&nbsp;3 documents, as the equivalent
717  * constructs in Level&nbsp;2 and Level&nbsp;1 are {@link Parameter} objects instead.
718    <p>
719    * @return a new {@link LocalParameter} object instance.
720    <p>
721    * @see #addLocalParameter(LocalParameter p)
722    */ public
createLocalParameter()723  LocalParameter createLocalParameter() {
724     long cPtr = libsbmlJNI.KineticLaw_createLocalParameter(swigCPtr, this);
725     return (cPtr == 0) ? null : new LocalParameter(cPtr, false);
726   }
727 
728 
729 /**
730    * Returns the list of parameters in this {@link KineticLaw} object.
731    * <p>
732  * This function should be used for SBML Level&nbsp;1 and Level&nbsp;2 documents,
733  * as the equivalent constructs in Level&nbsp;3 are {@link LocalParameter} objects instead.
734    <p>
735    * @return the list of Parameters for this {@link KineticLaw}.
736    */ public
getListOfParameters()737  ListOfParameters getListOfParameters() {
738     long cPtr = libsbmlJNI.KineticLaw_getListOfParameters__SWIG_0(swigCPtr, this);
739     return (cPtr == 0) ? null : new ListOfParameters(cPtr, false);
740   }
741 
742 
743 /**
744    * Returns the list of local parameters in this {@link KineticLaw} object.
745    * <p>
746  * This function should be used for SBML Level&nbsp;3 documents, as the equivalent
747  * constructs in Level&nbsp;2 and Level&nbsp;1 are {@link Parameter} objects instead.
748    <p>
749    * @return the list of LocalParameters for this {@link KineticLaw}.
750    */ public
getListOfLocalParameters()751  ListOfLocalParameters getListOfLocalParameters() {
752     long cPtr = libsbmlJNI.KineticLaw_getListOfLocalParameters__SWIG_0(swigCPtr, this);
753     return (cPtr == 0) ? null : new ListOfLocalParameters(cPtr, false);
754   }
755 
756 
757 /**
758    * Returns the nth {@link Parameter} object in the list of parameters in
759    * this {@link KineticLaw} instance.
760    * <p>
761  * This function should be used for SBML Level&nbsp;1 and Level&nbsp;2 documents,
762  * as the equivalent constructs in Level&nbsp;3 are {@link LocalParameter} objects instead.
763    <p>
764    * @param n the index of the {@link Parameter} object sought.
765    <p>
766    * @return the nth {@link Parameter} of this {@link KineticLaw}.
767    * If the index <code>n</code> is invalid, <code>null</code> is returned.
768    */ public
getParameter(long n)769  Parameter getParameter(long n) {
770     long cPtr = libsbmlJNI.KineticLaw_getParameter__SWIG_0(swigCPtr, this, n);
771     return (cPtr == 0) ? null : new Parameter(cPtr, false);
772   }
773 
774 
775 /**
776    * Returns the nth {@link LocalParameter} object in the list of local parameters in
777    * this {@link KineticLaw} instance.
778    * <p>
779  * This function should be used for SBML Level&nbsp;3 documents, as the equivalent
780  * constructs in Level&nbsp;2 and Level&nbsp;1 are {@link Parameter} objects instead.
781    <p>
782    * @param n the index of the {@link LocalParameter} object sought.
783    <p>
784    * @return the nth {@link LocalParameter} of this {@link KineticLaw}.
785    * If the index <code>n</code> is invalid, <code>null</code> is returned.
786    */ public
getLocalParameter(long n)787  LocalParameter getLocalParameter(long n) {
788     long cPtr = libsbmlJNI.KineticLaw_getLocalParameter__SWIG_0(swigCPtr, this, n);
789     return (cPtr == 0) ? null : new LocalParameter(cPtr, false);
790   }
791 
792 
793 /**
794    * Returns a parameter based on its identifier.
795    * <p>
796  * This function should be used for SBML Level&nbsp;1 and Level&nbsp;2 documents,
797  * as the equivalent constructs in Level&nbsp;3 are {@link LocalParameter} objects instead.
798    <p>
799    * @param sid the identifier of the {@link Parameter} being sought.
800    <p>
801    * @return the {@link Parameter} object in this {@link KineticLaw} instace having the
802    * given 'id', or <code>null</code> if no such {@link Parameter} exists.
803    */ public
getParameter(String sid)804  Parameter getParameter(String sid) {
805     long cPtr = libsbmlJNI.KineticLaw_getParameter__SWIG_2(swigCPtr, this, sid);
806     return (cPtr == 0) ? null : new Parameter(cPtr, false);
807   }
808 
809 
810 /**
811    * Returns a local parameter based on its identifier.
812    * <p>
813  * This function should be used for SBML Level&nbsp;3 documents, as the equivalent
814  * constructs in Level&nbsp;2 and Level&nbsp;1 are {@link Parameter} objects instead.
815    <p>
816    * @param sid the identifier of the {@link LocalParameter} being sought.
817    <p>
818    * @return the {@link LocalParameter} object in this {@link KineticLaw} instace having the
819    * given 'id', or <code>null</code> if no such {@link LocalParameter} exists.
820    */ public
getLocalParameter(String sid)821  LocalParameter getLocalParameter(String sid) {
822     long cPtr = libsbmlJNI.KineticLaw_getLocalParameter__SWIG_2(swigCPtr, this, sid);
823     return (cPtr == 0) ? null : new LocalParameter(cPtr, false);
824   }
825 
826 
827 /**
828    * Returns the number of parameters in this {@link KineticLaw} instance.
829    * <p>
830  * This function should be used for SBML Level&nbsp;1 and Level&nbsp;2 documents,
831  * as the equivalent constructs in Level&nbsp;3 are {@link LocalParameter} objects instead.
832    <p>
833    * @return the number of Parameters in this {@link KineticLaw}.
834    */ public
getNumParameters()835  long getNumParameters() {
836     return libsbmlJNI.KineticLaw_getNumParameters(swigCPtr, this);
837   }
838 
839 
840 /**
841    * Returns the number of local parameters in this {@link KineticLaw} instance.
842    * <p>
843  * This function should be used for SBML Level&nbsp;3 documents, as the equivalent
844  * constructs in Level&nbsp;2 and Level&nbsp;1 are {@link Parameter} objects instead.
845    <p>
846    * @return the number of LocalParameters in this {@link KineticLaw}.
847    */ public
getNumLocalParameters()848  long getNumLocalParameters() {
849     return libsbmlJNI.KineticLaw_getNumLocalParameters(swigCPtr, this);
850   }
851 
852 
853 /**
854    * Calculates and returns a {@link UnitDefinition} that expresses the units of
855    * measurement assumed for the 'math' expression of this {@link KineticLaw}.
856    <p>
857    * <p>
858  * The units are calculated based on the mathematical expression in the
859  * {@link KineticLaw} and the model quantities referenced by <code>&lt;ci&gt;</code>
860  * elements used within that expression.  The
861  * {@link KineticLaw#getDerivedUnitDefinition()}
862  * method returns the calculated units.
863    <p>
864    * <p>
865  * @note The functionality that facilitates unit analysis depends on the
866  * model as a whole.  Thus, in cases where the object has not been added to
867  * a model or the model itself is incomplete, unit analysis is not possible
868  * and this method will return <code>null.</code>
869    <p>
870    * <p>
871  * @warning <span class='warning'>Note that it is possible the 'math'
872  * expression in the {@link KineticLaw} contains pure numbers or parameters with
873  * undeclared units.  In those cases, it is not possible to calculate the
874  * units of the overall expression without making assumptions.  LibSBML does
875  * not make assumptions about the units, and
876  * {@link KineticLaw#getDerivedUnitDefinition()} returns the units as far as it is
877  * able to determine them.  For example, in an expression <em>X + Y</em>, if
878  * <em>X</em> has unambiguously-defined units and <em>Y</em> does not, it
879  * will return the units of <em>X</em>.  <strong>It is important that callers
880  * also invoke the method</strong>
881  * {@link KineticLaw#containsUndeclaredUnits()}<strong>to determine whether this
882  * situation holds</strong>.  Callers may wish to take suitable actions in
883  * those scenarios.</span>
884    <p>
885    * @return a {@link UnitDefinition} that expresses the units of the math
886    * expression of this {@link KineticLaw}, or <code>null</code> if one cannot be constructed.
887    <p>
888    * @see #containsUndeclaredUnits()
889    */ public
getDerivedUnitDefinition()890  UnitDefinition getDerivedUnitDefinition() {
891     long cPtr = libsbmlJNI.KineticLaw_getDerivedUnitDefinition__SWIG_0(swigCPtr, this);
892     return (cPtr == 0) ? null : new UnitDefinition(cPtr, false);
893   }
894 
895 
896 /**
897    * Predicate returning <code>true</code> if the math expression of this {@link KineticLaw}
898    * contains parameters/numbers with undeclared units.
899    <p>
900    * @return <code>true</code> if the math expression of this {@link KineticLaw}
901    * includes parameters/numbers
902    * with undeclared units, <code>false</code> otherwise.
903    <p>
904    * @note A return value of <code>true</code> indicates that the {@link UnitDefinition}
905    * returned by
906    * {@link KineticLaw#getDerivedUnitDefinition()}
907    * may not accurately represent the units of the expression.
908    <p>
909    * @see #getDerivedUnitDefinition()
910    */ public
containsUndeclaredUnits()911  boolean containsUndeclaredUnits() {
912     return libsbmlJNI.KineticLaw_containsUndeclaredUnits__SWIG_0(swigCPtr, this);
913   }
914 
915 
916 /**
917    * Removes the nth {@link Parameter} object in the list of parameters
918    * in this {@link KineticLaw} instance and returns a pointer to it.
919    * <p>
920  * This function should be used for SBML Level&nbsp;1 and Level&nbsp;2 documents,
921  * as the equivalent constructs in Level&nbsp;3 are {@link LocalParameter} objects instead.
922    <p>
923    * The caller owns the returned object and is responsible for deleting it.
924    <p>
925    * @param n the index of the {@link Parameter} object to remove.
926    <p>
927    * @return the {@link Parameter} object removed.  As mentioned above,
928    * the caller owns the returned item. <code>null</code> is returned if the given index
929    * is out of range.
930    */ public
removeParameter(long n)931  Parameter removeParameter(long n) {
932     long cPtr = libsbmlJNI.KineticLaw_removeParameter__SWIG_0(swigCPtr, this, n);
933     return (cPtr == 0) ? null : new Parameter(cPtr, true);
934   }
935 
936 
937 /**
938    * Removes the nth {@link LocalParameter} object in the list of local parameters
939    * in this {@link KineticLaw} instance and returns a pointer to it.
940    * <p>
941  * This function should be used for SBML Level&nbsp;3 documents, as the equivalent
942  * constructs in Level&nbsp;2 and Level&nbsp;1 are {@link Parameter} objects instead.
943    <p>
944    * The caller owns the returned object and is responsible for deleting it.
945    <p>
946    * @param n the index of the {@link LocalParameter} object to remove.
947    <p>
948    * @return the {@link LocalParameter} object removed.  As mentioned above,
949    * the caller owns the returned item. <code>null</code> is returned if the given index
950    * is out of range.
951    */ public
removeLocalParameter(long n)952  LocalParameter removeLocalParameter(long n) {
953     long cPtr = libsbmlJNI.KineticLaw_removeLocalParameter__SWIG_0(swigCPtr, this, n);
954     return (cPtr == 0) ? null : new LocalParameter(cPtr, true);
955   }
956 
957 
958 /**
959    * Removes a {@link Parameter} object with the given identifier in the list of
960    * parameters in this {@link KineticLaw} instance and returns a pointer to it.
961    * <p>
962  * This function should be used for SBML Level&nbsp;1 and Level&nbsp;2 documents,
963  * as the equivalent constructs in Level&nbsp;3 are {@link LocalParameter} objects instead.
964    <p>
965    * The caller owns the returned object and is responsible for deleting it.
966    <p>
967    * @param sid the identifier of the {@link Parameter} to remove.
968    <p>
969    * @return the {@link Parameter} object removed.  As mentioned above, the
970    * caller owns the returned object. <code>null</code> is returned if no {@link Parameter}
971    * object with the identifier exists in this {@link KineticLaw} instance.
972    */ public
removeParameter(String sid)973  Parameter removeParameter(String sid) {
974     long cPtr = libsbmlJNI.KineticLaw_removeParameter__SWIG_1(swigCPtr, this, sid);
975     return (cPtr == 0) ? null : new Parameter(cPtr, true);
976   }
977 
978 
979 /**
980    * Removes a {@link LocalParameter} object with the given identifier in the list of
981    * local parameters in this {@link KineticLaw} instance and returns a pointer to it.
982    * <p>
983  * This function should be used for SBML Level&nbsp;3 documents, as the equivalent
984  * constructs in Level&nbsp;2 and Level&nbsp;1 are {@link Parameter} objects instead.
985    <p>
986    * The caller owns the returned object and is responsible for deleting it.
987    <p>
988    * @param sid the identifier of the {@link LocalParameter} to remove.
989    <p>
990    * @return the {@link LocalParameter} object removed.  As mentioned above, the
991    * caller owns the returned object. <code>null</code> is returned if no {@link LocalParameter}
992    * object with the identifier exists in this {@link KineticLaw} instance.
993    */ public
removeLocalParameter(String sid)994  LocalParameter removeLocalParameter(String sid) {
995     long cPtr = libsbmlJNI.KineticLaw_removeLocalParameter__SWIG_1(swigCPtr, this, sid);
996     return (cPtr == 0) ? null : new LocalParameter(cPtr, true);
997   }
998 
connectToChild()999   public void connectToChild() {
1000     libsbmlJNI.KineticLaw_connectToChild(swigCPtr, this);
1001   }
1002 
1003 
1004 /** * @internal */ public
enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag)1005  void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
1006     libsbmlJNI.KineticLaw_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
1007   }
1008 
1009 
1010 /** * @internal */ public
updateSBMLNamespace(String _package, long level, long version)1011  void updateSBMLNamespace(String _package, long level, long version) {
1012     libsbmlJNI.KineticLaw_updateSBMLNamespace(swigCPtr, this, _package, level, version);
1013   }
1014 
1015 
1016 /**
1017    * Returns the libSBML type code for this SBML object.
1018    <p>
1019    * <p>
1020  * LibSBML attaches an identifying code to every kind of SBML object.  These
1021  * are integer constants known as <em>SBML type codes</em>.  The names of all
1022  * the codes begin with the characters <code>SBML_</code>.
1023  * In the Java language interface for libSBML, the
1024  * type codes are defined as static integer constants in the interface class
1025  * {@link libsbmlConstants}.    Note that different Level&nbsp;3
1026  * package plug-ins may use overlapping type codes; to identify the package
1027  * to which a given object belongs, call the
1028  * <code>{@link SBase#getPackageName()}
1029  * </code>
1030  * method on the object.
1031  <p>
1032  * The exception to this is lists:  all SBML-style list elements have the type
1033  * {@link libsbmlConstants#SBML_LIST_OF SBML_LIST_OF}, regardless of what package they
1034  * are from.
1035    <p>
1036    * @return the SBML type code for this object:
1037    * {@link libsbmlConstants#SBML_KINETIC_LAW SBML_KINETIC_LAW} (default).
1038    <p>
1039    * <p>
1040  * @warning <span class='warning'>The specific integer values of the possible
1041  * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
1042  * packages,  To fully identify the correct code, <strong>it is necessary to
1043  * invoke both getPackageName() and getTypeCode()</strong> (or
1044  * {@link ListOf#getItemTypeCode()}).</span>
1045    <p>
1046    * @see #getElementName()
1047    * @see #getPackageName()
1048    */ public
getTypeCode()1049  int getTypeCode() {
1050     return libsbmlJNI.KineticLaw_getTypeCode(swigCPtr, this);
1051   }
1052 
1053 
1054 /**
1055    * Returns the XML element name of this object, which for {@link Species}, is
1056    * always <code>'kineticLaw'.</code>
1057    <p>
1058    * @return the name of this element, i.e., <code>'kineticLaw'.</code>
1059    */ public
getElementName()1060  String getElementName() {
1061     return libsbmlJNI.KineticLaw_getElementName(swigCPtr, this);
1062   }
1063 
1064 
1065 /**
1066    * Predicate returning <code>true</code> if all the required attributes for this
1067    * {@link KineticLaw} object have been set.
1068    <p>
1069    * The required attributes for a {@link KineticLaw} object are:
1070    * <ul>
1071    * <li> 'formula' (SBML Level&nbsp;1 only)
1072    *
1073    * </ul> <p>
1074    * @return <code>true</code> if the required attributes have been set, <code>false</code>
1075    * otherwise.
1076    */ public
hasRequiredAttributes()1077  boolean hasRequiredAttributes() {
1078     return libsbmlJNI.KineticLaw_hasRequiredAttributes(swigCPtr, this);
1079   }
1080 
1081 
1082 /**
1083    * Predicate returning <code>true</code> if all the required elements for this
1084    * {@link KineticLaw} object have been set.
1085    <p>
1086    * @note The required elements for a {@link KineticLaw} object are:
1087    * <ul>
1088    * <li> 'math' inSBML Level&nbsp;2 and Level&nbsp;3 Version&nbsp;1.
1089    *     (In SBML Level&nbsp;3 Version&nbsp;2+, it is no longer required.)
1090    *
1091    * </ul> <p>
1092    * @return a boolean value indicating whether all the required
1093    * elements for this object have been defined.
1094    */ public
hasRequiredElements()1095  boolean hasRequiredElements() {
1096     return libsbmlJNI.KineticLaw_hasRequiredElements(swigCPtr, this);
1097   }
1098 
1099 
1100 /**
1101    * Finds this {@link KineticLaw}'s {@link Reaction} parent and calls unsetKineticLaw() on
1102    * it, indirectly deleting itself.
1103    <p>
1104    * Overridden from the {@link SBase} function since the parent is not a {@link ListOf}.
1105    <p>
1106    * <p>
1107  * @return integer value indicating success/failure of the
1108  * function.   The possible values
1109  * returned by this function are:
1110    * <ul>
1111    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1112    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
1113    * </ul>
1114    */ public
removeFromParentAndDelete()1115  int removeFromParentAndDelete() {
1116     return libsbmlJNI.KineticLaw_removeFromParentAndDelete(swigCPtr, this);
1117   }
1118 
1119 
1120 /**
1121    * <p>
1122  * Replaces all uses of a given <code>SIdRef</code> type attribute value with another
1123  * value.
1124  <p>
1125  * <p>
1126  * In SBML, object identifiers are of a data type called <code>SId</code>.
1127  * In SBML Level&nbsp;3, an explicit data type called <code>SIdRef</code> was
1128  * introduced for attribute values that refer to <code>SId</code> values; in
1129  * previous Levels of SBML, this data type did not exist and attributes were
1130  * simply described to as 'referring to an identifier', but the effective
1131  * data type was the same as <code>SIdRef</code> in Level&nbsp;3.  These and
1132  * other methods of libSBML refer to the type <code>SIdRef</code> for all
1133  * Levels of SBML, even if the corresponding SBML specification did not
1134  * explicitly name the data type.
1135  <p>
1136  * This method works by looking at all attributes and (if appropriate)
1137  * mathematical formulas in MathML content, comparing the referenced
1138  * identifiers to the value of <code>oldid</code>.  If any matches are found, the
1139  * matching values are replaced with <code>newid</code>.  The method does <em>not</em>
1140  * descend into child elements.
1141  <p>
1142  * @param oldid the old identifier.
1143  * @param newid the new identifier.
1144    */ public
renameSIdRefs(String oldid, String newid)1145  void renameSIdRefs(String oldid, String newid) {
1146     libsbmlJNI.KineticLaw_renameSIdRefs(swigCPtr, this, oldid, newid);
1147   }
1148 
1149 
1150 /**
1151    * <p>
1152  * Replaces all uses of a given <code>UnitSIdRef</code> type attribute value with
1153  * another value.
1154  <p>
1155  * <p>
1156  * In SBML, unit definitions have identifiers of type <code>UnitSId</code>.  In
1157  * SBML Level&nbsp;3, an explicit data type called <code>UnitSIdRef</code> was
1158  * introduced for attribute values that refer to <code>UnitSId</code> values; in
1159  * previous Levels of SBML, this data type did not exist and attributes were
1160  * simply described to as 'referring to a unit identifier', but the effective
1161  * data type was the same as <code>UnitSIdRef</code> in Level&nbsp;3.  These and
1162  * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all
1163  * Levels of SBML, even if the corresponding SBML specification did not
1164  * explicitly name the data type.
1165  <p>
1166  * This method works by looking at all unit identifier attribute values
1167  * (including, if appropriate, inside mathematical formulas), comparing the
1168  * referenced unit identifiers to the value of <code>oldid</code>.  If any matches
1169  * are found, the matching values are replaced with <code>newid</code>.  The method
1170  * does <em>not</em> descend into child elements.
1171  <p>
1172  * @param oldid the old identifier.
1173  * @param newid the new identifier.
1174    */ public
renameUnitSIdRefs(String oldid, String newid)1175  void renameUnitSIdRefs(String oldid, String newid) {
1176     libsbmlJNI.KineticLaw_renameUnitSIdRefs(swigCPtr, this, oldid, newid);
1177   }
1178 
1179 
1180 /** * @internal */ public
replaceSIDWithFunction(String id, ASTNode function)1181  void replaceSIDWithFunction(String id, ASTNode function) {
1182     libsbmlJNI.KineticLaw_replaceSIDWithFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function);
1183   }
1184 
1185 
1186 /** * @internal */ public
divideAssignmentsToSIdByFunction(String id, ASTNode function)1187  void divideAssignmentsToSIdByFunction(String id, ASTNode function) {
1188     libsbmlJNI.KineticLaw_divideAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function);
1189   }
1190 
1191 
1192 /** * @internal */ public
multiplyAssignmentsToSIdByFunction(String id, ASTNode function)1193  void multiplyAssignmentsToSIdByFunction(String id, ASTNode function) {
1194     libsbmlJNI.KineticLaw_multiplyAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function);
1195   }
1196 
1197 }
1198