001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.7
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 *  Overall SBML container object.
013 <p>
014 * LibSBML uses the class {@link SBMLDocument} as a top-level
015 * container for storing SBML content and data associated with it (such as
016 * warnings and error messages).  The two primary means of reading an SBML
017 * model, {@link SBMLReader#readSBML(String filename)} and
018 * {@link SBMLReader#readSBMLFromString(String xml)}, both return an {@link SBMLDocument}
019 * object.  From there, callers can inquire about any errors encountered
020 * (e.g., using {@link SBMLDocument#getNumErrors()}), access the {@link Model} object, and
021 * perform other actions such as consistency-checking and model
022 * translation.
023 <p>
024 * When creating fresh models programmatically, the starting point is
025 * typically the creation of an {@link SBMLDocument} object instance.  The
026 * {@link SBMLDocument} constructor accepts arguments for the SBML Level and
027 * Version of the model to be created.  After creating the {@link SBMLDocument}
028 * object, calling programs then typically call {@link SBMLDocument#createModel()}
029 * almost immediately, and then proceed to call the methods on the {@link Model}
030 * object to fill out the model's contents.
031 <p>
032 * {@link SBMLDocument} corresponds roughly to the class <i>Sbml</i> defined in the
033 * SBML Level&nbsp;2 specification and <i>SBML</i> in the Level&nbsp;3
034 * specification.  It does not have a direct correspondence in SBML
035 * Level&nbsp;1.  (However, to make matters simpler for applications,
036 * libSBML creates an {@link SBMLDocument} no matter whether the model is
037 * Level&nbsp;1, Level&nbsp;2 or Level&nbsp;3.)  In its barest form, when written out in
038 * XML format for (e.g.) SBML Level&nbsp;2 Version&nbsp;4, the corresponding
039 * structure is the following:
040 * <pre class='fragment'>
041&lt;sbml xmlns='http://www.sbml.org/sbml/level2/version4' level='2' version='4'&gt;
042  ...
043&lt;/sbml&gt;</pre>
044 <p>
045 * {@link SBMLDocument} is derived from {@link SBase}, and therefore contains the usual {@link SBase}
046 * attributes (in SBML Level&nbsp;2 and Level&nbsp;3) of 'metaid' and 'sboTerm', as
047 * well as the subelements 'notes' and 'annotation'.  It also contains the
048 * attributes 'level' and 'version' indicating the Level and Version of the
049 * SBML data structure.  These can be accessed using the methods defined by
050 * the {@link SBase} class for that purpose.
051 <p>
052 * <h2>Checking consistency and adherence to SBML specifications</h2>
053 <p>
054 * One of the most important features of libSBML is its ability to perform
055 * SBML validation to ensure that a model adheres to the SBML specification
056 * for whatever Level+Version combination the model uses.  {@link SBMLDocument}
057 * provides the methods for running consistency-checking and validation
058 * rules on the SBML content.
059 <p>
060 * First, a brief explanation of the rationale is in order.  In libSBML
061 * versions up to and including the version&nbsp;3.3.x series, the
062 * individual methods for creating and setting attributes and other
063 * components were quite lenient, and allowed a caller to compose SBML
064 * entities that might not, in the end, represent valid SBML.  This allowed
065 * applications the freedom to do things such as save incomplete models
066 * (which is useful when models are being developed over long periods of
067 * time).  In the version&nbsp;4.x series, libSBML is somewhat stricter,
068 * but still permits structures to be created independently and the results
069 * to be combined in a separate step.  In all these cases, it means that a
070 * separate validation step is necessary when a calling program finally
071 * wants to finish a complete SBML document.
072 <p>
073 * The primary interface to this validation facility is {@link SBMLDocument}'s
074 * {@link SBMLDocument#checkInternalConsistency()} and
075 * {@link SBMLDocument#checkConsistency()}.  The former verifies the basic
076 * internal consistency and syntax of an SBML document, and the latter
077 * implements more elaborate validation rules (both those defined by the
078 * SBML specifications, as well as additional rules offered by libSBML).
079 <p>
080 * The checks performed by {@link SBMLDocument#checkInternalConsistency()} are
081 * hardwired and cannot be changed by calling programs, but the validation
082 * performed by {@link SBMLDocument#checkConsistency()} is under program control
083 * using the method {@link SBMLDocument#setConsistencyChecks(int categ, boolean
084 * onoff)}.  Applications can selectively disable specific kinds of checks
085 * that they may not be interested by calling
086 * {@link SBMLDocument#setConsistencyChecks(int categ, boolean onoff)} with
087 * appropriate parameters.
088 <p>
089 * These methods have slightly different relevance depending on whether a
090 * model is created programmaticaly from scratch, or whether it is read in
091 * from a file or data stream.  The following list summarizes the possible
092 * scenarios.
093 <p>
094 * <em>Scenario 1: Creating a model from scratch</em>.  Before writing out
095 * the model, 
096 <p>
097 * <ul>
098 * <li> Call {@link SBMLDocument#checkInternalConsistency()}, then inquire about
099 * the results by calling {@link SBMLDocument#getNumErrors()}
100 <p>
101 * <li> Call {@link SBMLDocument#setConsistencyChecks(int categ, boolean
102 * onoff)}  to configure
103 * which checks will be performed by {@link SBMLDocument#checkConsistency()}
104 <p>
105 * <li> Call {@link SBMLDocument#checkConsistency()}, then inquire about the results by
106 * calling {@link SBMLDocument#getNumErrors()}
107 *
108 * </ul> <p>
109 * <em>Scenario 2: Reading a model from a file or data stream.</em> After
110 * reading the model,
111 <p>
112 * <ul>
113 * <li> Basic consistency checks will have been performed automatically by
114 * libSBML upon reading the content, so you only need to inquire about the
115 * results by using {@link SBMLDocument#getNumErrors()}
116 <p>
117 * <li> Call {@link SBMLDocument#setConsistencyChecks(int categ, boolean
118 * onoff)}  to configure
119 * which checks are performed by {@link SBMLDocument#checkConsistency()}
120 <p>
121 * <li> Call {@link SBMLDocument#checkConsistency()}, then inquire about the results
122 * by calling {@link SBMLDocument#getNumErrors()}
123 *
124 * </ul> <p>
125 * <h2>Converting documents between Levels and Versions of SBML</h2>
126 <p>
127 * LibSBML provides facilities for limited translation of SBML between
128 * Levels and Versions of the SBML specifications.  The method for doing is
129 * is {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)} .  In 
130 * general, models can be converted upward without difficulty (e.g., from
131 * SBML Level&nbsp;1 to Level&nbsp;2, or from an earlier Version of
132 * Level&nbsp;2 to the latest Version of Level&nbsp;2).  Sometimes models
133 * can be translated downward as well, if they do not use constructs
134 * specific to more advanced Levels of SBML.
135 <p>
136 * Calling {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)}  will not <em>necessarily</em> lead
137 * to a successful conversion.  The method will return a boolean value
138 * to indicate success or failure.  Callers must check the error log (see 
139 * next section) attached to the {@link SBMLDocument} object after calling
140 * {@link SBMLDocument#setLevelAndVersion(long lev, long ver)}  in order to assess whether any
141 * problems arose.
142 <p>
143 * If an application is interested in translating to a lower Level and/or
144 * Version of SBML within a Level, the following methods allow for prior
145 * assessment of whether there is sufficient compatibility to make a
146 * translation possible:
147 <p>
148 * <ul>
149 * <li> {@link SBMLDocument#checkL1Compatibility()},
150 * <li> {@link SBMLDocument#checkL2v1Compatibility()},
151 * <li> {@link SBMLDocument#checkL2v2Compatibility()},
152 * <li> {@link SBMLDocument#checkL2v3Compatibility()}, 
153 * <li> {@link SBMLDocument#checkL2v4Compatibility()}, and
154 * <li> {@link SBMLDocument#checkL3v1Compatibility()}.
155 *
156 * </ul> <p>
157 * Some changes between Versions of SBML Level&nbsp;2 may lead to
158 * unexpected behaviors when attempting conversions in either direction.
159 * For example, SBML Level&nbsp;2 Version&nbsp;4 relaxed the requirement
160 * for consistency in units of measurement between expressions annd
161 * quantities in a model.  As a result, a model written in Version&nbsp;4,
162 * if converted to Version&nbsp;3 with no other changes, may fail
163 * validation as a Version&nbsp;3 model because Version&nbsp;3 imposed
164 * stricter requirements on unit consistency.
165 <p>
166 * Other changes between SBML Level 2 and Level 3 make downward conversions
167 * challenging.  In some cases, it means that a model converted to
168 * Level&nbsp;2 from Level&nbsp;3 will contain attributes that were not
169 * explicitly given in the Level&nbsp;3 model, because in Level&nbsp;2
170 * these attributes may have been optional or have default values.
171 <p>
172 * <h2>Error handling</h2>
173 <p>
174 * Upon reading a model, {@link SBMLDocument} logs any problems encountered while
175 * reading the model from the file or data stream.  The log contains
176 * objects that record diagnostic information about any notable issues that
177 * arose.  Whether the problems are warnings or errors, they are both
178 * reported through a single common interface involving the object class
179 * {@link SBMLError}.
180 <p>
181 * The methods {@link SBMLDocument#getNumErrors()}, {@link SBMLDocument#getError(long n)}  and
182 * {@link SBMLDocument#printErrors()} allow callers to interact with the warnings
183 * or errors logged.  Alternatively, callers may retrieve the entire log as
184 * an {@link SBMLErrorLog} object using the method {@link SBMLDocument#getErrorLog()}.
185 * The {@link SBMLErrorLog} object provides some alternative methods for
186 * interacting with the set of errors and warnings.  In either case,
187 * applications typically should first call {@link SBMLDocument#getNumErrors()} to
188 * find out if any issues have been logged after specific libSBML
189 * operations such as the ones discussed in the sections above.  If they
190 * have, then an application will should proceed to inspect the individual
191 * reports using either the direct interfaces on {@link SBMLDocument} or using the
192 * methods on the {@link SBMLErrorLog} object.
193 */
194
195public class SBMLDocument extends SBase {
196   private long swigCPtr;
197
198   protected SBMLDocument(long cPtr, boolean cMemoryOwn)
199   {
200     super(libsbmlJNI.SBMLDocument_SWIGUpcast(cPtr), cMemoryOwn);
201     swigCPtr = cPtr;
202   }
203
204   protected static long getCPtr(SBMLDocument obj)
205   {
206     return (obj == null) ? 0 : obj.swigCPtr;
207   }
208
209   protected static long getCPtrAndDisown (SBMLDocument obj)
210   {
211     long ptr = 0;
212
213     if (obj != null)
214     {
215       ptr             = obj.swigCPtr;
216       obj.swigCMemOwn = false;
217     }
218
219     return ptr;
220   }
221
222  protected void finalize() {
223    delete();
224  }
225
226  public synchronized void delete() {
227    if (swigCPtr != 0) {
228      if (swigCMemOwn) {
229        swigCMemOwn = false;
230        libsbmlJNI.delete_SBMLDocument(swigCPtr);
231      }
232      swigCPtr = 0;
233    }
234    super.delete();
235  }
236
237  
238/**
239   * The default SBML Level of new {@link SBMLDocument} objects.
240   <p>
241   * <p>
242 * This 'default Level' corresponds to the most recent SBML specification
243 * Level available at the time libSBML version 5.12.0
244 was released.  The default Level is used by
245 * {@link SBMLDocument} if no Level is explicitly specified at the time of the
246 * construction of an {@link SBMLDocument} instance.
247   <p>
248   * @return an integer indicating the most recent SBML specification Level
249   <p>
250   * 
251   <p>
252   * @see SBMLDocument#getDefaultVersion() 
253   */ public
254 static long getDefaultLevel() {
255    return libsbmlJNI.SBMLDocument_getDefaultLevel();
256  }
257
258  
259/**
260   * The default Version of new {@link SBMLDocument} objects.
261   <p>
262   * <p>
263 * This 'default Version' corresponds to the most recent Version within the
264 * most recent Level of SBML available at the time libSBML version
265 * 5.12.0
266 was released.  The default Version is
267 * used by {@link SBMLDocument} if no Version is explicitly specified at the time of
268 * the construction of an {@link SBMLDocument} instance. 
269   <p>
270   * @return an integer indicating the most recent SBML specification
271   * Version
272   <p>
273   * 
274   <p>
275   * @see SBMLDocument#getDefaultLevel() 
276   */ public
277 static long getDefaultVersion() {
278    return libsbmlJNI.SBMLDocument_getDefaultVersion();
279  }
280
281  
282/**
283   * Creates a new {@link SBMLDocument}, optionally with given values for the SBML
284   * Level and Version.
285   <p>
286   * If <em>both</em> the SBML Level and Version attributes are not
287   * specified, the SBML document is treated as having the latest Level and
288   * Version of SBML as determined by {@link SBMLDocument#getDefaultLevel()} and
289   * {@link SBMLDocument#getDefaultVersion()}; <em>however</em>, the {@link SBMLDocument}
290   * object is otherwise left blank.  In particular, the blank {@link SBMLDocument}
291   * object has no associated XML attributes, including (but not limited
292   * to) an XML namespace declaration.  The XML namespace declaration is
293   * not added until the model is written out, <em>or</em> the method
294   * {@link SBMLDocument#setLevelAndVersion(long, long, boolean)}
295   * is called.  This may be important to keep in mind
296   * if an application needs to add additional XML namespace declarations
297   * on the <code>&lt;sbml&gt;</code> element.  Application writers should
298   * either provide values for <code>level</code> and <code>version</code> on the call to this
299   * constructor, or else call
300   * {@link SBMLDocument#setLevelAndVersion(long, long, boolean)}
301   * shortly after creating the {@link SBMLDocument} object.
302   <p>
303   * @param level an integer for the SBML Level
304   <p>
305   * @param version an integer for the Version within the SBML Level
306   <p>
307   * <p>
308 * @throws SBMLConstructorException
309 * Thrown if the given <code>level</code> and <code>version</code> combination are invalid
310 * or if this object is incompatible with the given level and version.
311   <p>
312   * 
313</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
314The native C++ implementation of this method defines a default argument
315value. In the documentation generated for different libSBML language
316bindings, you may or may not see corresponding arguments in the method
317declarations. For example, in Java and C#, a default argument is handled by
318declaring two separate methods, with one of them having the argument and
319the other one lacking the argument. However, the libSBML documentation will
320be <em>identical</em> for both methods. Consequently, if you are reading
321this and do not see an argument even though one is described, please look
322for descriptions of other variants of this method near where this one
323appears in the documentation.
324</dd></dl>
325 
326   <p>
327   * @see SBMLDocument#setLevelAndVersion(long, long, boolean)
328   * @see #getDefaultLevel()
329   * @see #getDefaultVersion()
330   */ public
331 SBMLDocument(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
332    this(libsbmlJNI.new_SBMLDocument__SWIG_0(level, version), true);
333  }
334
335  
336/**
337   * Creates a new {@link SBMLDocument}, optionally with given values for the SBML
338   * Level and Version.
339   <p>
340   * If <em>both</em> the SBML Level and Version attributes are not
341   * specified, the SBML document is treated as having the latest Level and
342   * Version of SBML as determined by {@link SBMLDocument#getDefaultLevel()} and
343   * {@link SBMLDocument#getDefaultVersion()}; <em>however</em>, the {@link SBMLDocument}
344   * object is otherwise left blank.  In particular, the blank {@link SBMLDocument}
345   * object has no associated XML attributes, including (but not limited
346   * to) an XML namespace declaration.  The XML namespace declaration is
347   * not added until the model is written out, <em>or</em> the method
348   * {@link SBMLDocument#setLevelAndVersion(long, long, boolean)}
349   * is called.  This may be important to keep in mind
350   * if an application needs to add additional XML namespace declarations
351   * on the <code>&lt;sbml&gt;</code> element.  Application writers should
352   * either provide values for <code>level</code> and <code>version</code> on the call to this
353   * constructor, or else call
354   * {@link SBMLDocument#setLevelAndVersion(long, long, boolean)}
355   * shortly after creating the {@link SBMLDocument} object.
356   <p>
357   * @param level an integer for the SBML Level
358   <p>
359   * @param version an integer for the Version within the SBML Level
360   <p>
361   * <p>
362 * @throws SBMLConstructorException
363 * Thrown if the given <code>level</code> and <code>version</code> combination are invalid
364 * or if this object is incompatible with the given level and version.
365   <p>
366   * 
367</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
368The native C++ implementation of this method defines a default argument
369value. In the documentation generated for different libSBML language
370bindings, you may or may not see corresponding arguments in the method
371declarations. For example, in Java and C#, a default argument is handled by
372declaring two separate methods, with one of them having the argument and
373the other one lacking the argument. However, the libSBML documentation will
374be <em>identical</em> for both methods. Consequently, if you are reading
375this and do not see an argument even though one is described, please look
376for descriptions of other variants of this method near where this one
377appears in the documentation.
378</dd></dl>
379 
380   <p>
381   * @see SBMLDocument#setLevelAndVersion(long, long, boolean)
382   * @see #getDefaultLevel()
383   * @see #getDefaultVersion()
384   */ public
385 SBMLDocument(long level) throws org.sbml.libsbml.SBMLConstructorException {
386    this(libsbmlJNI.new_SBMLDocument__SWIG_1(level), true);
387  }
388
389  
390/**
391   * Creates a new {@link SBMLDocument}, optionally with given values for the SBML
392   * Level and Version.
393   <p>
394   * If <em>both</em> the SBML Level and Version attributes are not
395   * specified, the SBML document is treated as having the latest Level and
396   * Version of SBML as determined by {@link SBMLDocument#getDefaultLevel()} and
397   * {@link SBMLDocument#getDefaultVersion()}; <em>however</em>, the {@link SBMLDocument}
398   * object is otherwise left blank.  In particular, the blank {@link SBMLDocument}
399   * object has no associated XML attributes, including (but not limited
400   * to) an XML namespace declaration.  The XML namespace declaration is
401   * not added until the model is written out, <em>or</em> the method
402   * {@link SBMLDocument#setLevelAndVersion(long, long, boolean)}
403   * is called.  This may be important to keep in mind
404   * if an application needs to add additional XML namespace declarations
405   * on the <code>&lt;sbml&gt;</code> element.  Application writers should
406   * either provide values for <code>level</code> and <code>version</code> on the call to this
407   * constructor, or else call
408   * {@link SBMLDocument#setLevelAndVersion(long, long, boolean)}
409   * shortly after creating the {@link SBMLDocument} object.
410   <p>
411   * @param level an integer for the SBML Level
412   <p>
413   * @param version an integer for the Version within the SBML Level
414   <p>
415   * <p>
416 * @throws SBMLConstructorException
417 * Thrown if the given <code>level</code> and <code>version</code> combination are invalid
418 * or if this object is incompatible with the given level and version.
419   <p>
420   * 
421</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
422The native C++ implementation of this method defines a default argument
423value. In the documentation generated for different libSBML language
424bindings, you may or may not see corresponding arguments in the method
425declarations. For example, in Java and C#, a default argument is handled by
426declaring two separate methods, with one of them having the argument and
427the other one lacking the argument. However, the libSBML documentation will
428be <em>identical</em> for both methods. Consequently, if you are reading
429this and do not see an argument even though one is described, please look
430for descriptions of other variants of this method near where this one
431appears in the documentation.
432</dd></dl>
433 
434   <p>
435   * @see SBMLDocument#setLevelAndVersion(long, long, boolean)
436   * @see #getDefaultLevel()
437   * @see #getDefaultVersion()
438   */ public
439 SBMLDocument() throws org.sbml.libsbml.SBMLConstructorException {
440    this(libsbmlJNI.new_SBMLDocument__SWIG_2(), true);
441  }
442
443  
444/**
445   * Creates a new {@link SBMLDocument} using the given {@link SBMLNamespaces} object 
446   * <code>sbmlns</code>.
447   <p>
448   * <p>
449 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces
450 * information.  It is used to communicate the SBML Level, Version, and (in
451 * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
452 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an
453 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object
454 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 
455   <p>
456   * @param sbmlns an {@link SBMLNamespaces} object.
457   <p>
458   * <p>
459 * @throws SBMLConstructorException
460 * Thrown if the given <code>sbmlns</code> is inconsistent or incompatible
461 * with this object.
462   */ public
463 SBMLDocument(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException {
464    this(libsbmlJNI.new_SBMLDocument__SWIG_3(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true);
465  }
466
467  
468/**
469   * Copy constructor; creates a copy of this {@link SBMLDocument}.
470   <p>
471   * @param orig the object to copy.
472   */ public
473 SBMLDocument(SBMLDocument orig) throws org.sbml.libsbml.SBMLConstructorException {
474    this(libsbmlJNI.new_SBMLDocument__SWIG_4(SBMLDocument.getCPtr(orig), orig), true);
475  }
476
477  
478/**
479   * Creates and returns a deep copy of this {@link SBMLDocument} object.
480   <p>
481   * @return the (deep) copy of this {@link SBMLDocument} object.
482   */ public
483 SBMLDocument cloneObject() {
484    long cPtr = libsbmlJNI.SBMLDocument_cloneObject(swigCPtr, this);
485    return (cPtr == 0) ? null : new SBMLDocument(cPtr, true);
486  }
487
488  
489/**
490  * Returns <code>true</code> if the {@link Model} object has been set, otherwise 
491  * returns <code>false.</code>
492  <p>
493  * @return <code>true</code> if the {@link Model} object has been set
494  */ public
495 boolean isSetModel() {
496    return libsbmlJNI.SBMLDocument_isSetModel(swigCPtr, this);
497  }
498
499  
500/**
501   * Returns the {@link Model} object stored in this {@link SBMLDocument}.
502   <p>
503   * It is important to note that this method <em>does not create</em> a
504   * {@link Model} instance.  The model in the {@link SBMLDocument} must have been created
505   * at some prior time, for example using {@link SBMLDocument#createModel()} 
506   * or {@link SBMLDocument#setModel(Model)}.
507   * This method returns <code>null</code> if a model does not yet exist.
508   <p>
509   * @return the {@link Model} contained in this {@link SBMLDocument}.
510   <p>
511   * @see #createModel()
512   */ public
513 Model getModel() {
514    long cPtr = libsbmlJNI.SBMLDocument_getModel__SWIG_0(swigCPtr, this);
515    return (cPtr == 0) ? null : new Model(cPtr, false);
516  }
517
518  
519/**
520   * Returns the first child element found that has the given <code>id</code> in the
521   * model-wide SId namespace, or <code>null</code> if no such object is found.
522   <p>
523   * @param id string representing the id of objects to find
524   <p>
525   * @return pointer to the first element found with the given <code>id</code>.
526   */ public
527 SBase getElementBySId(String id) {
528  return libsbml.DowncastSBase(libsbmlJNI.SBMLDocument_getElementBySId(swigCPtr, this, id), false);
529}
530
531  
532/**
533   * Returns the first child element it can find with the given <code>metaid</code>, or
534   * itself if it has the given <code>metaid</code>, or <code>null</code> if no such object is
535   * found.
536   <p>
537   * @param metaid string representing the metaid of objects to find
538   <p>
539   * @return pointer to the first element found with the given <code>metaid</code>.
540   */ public
541 SBase getElementByMetaId(String metaid) {
542  return libsbml.DowncastSBase(libsbmlJNI.SBMLDocument_getElementByMetaId(swigCPtr, this, metaid), false);
543}
544
545  
546/**
547   * Removes {@link FunctionDefinition} constructs from the document and expands
548   * any instances of their use within <code>&lt;math&gt;</code> elements.
549   <p>
550   * For example, suppose a {@link Model} contains a {@link FunctionDefinition} with
551   * identifier <code>'f'</code> representing the math expression: <em>f(x, y) = x *
552   * y</em>.  Suppose further that there is a reaction in which the
553   * <code>&lt;math&gt;</code> element of the {@link KineticLaw} object contains
554   * <code>f(s, p)</code>, where <code>s</code> and <code>p</code> are other identifiers
555   * defined in the model.  The outcome of invoking this method is that the
556   * <code>&lt;math&gt;</code> of the {@link KineticLaw} now represents the
557   * expression <em>s * p</em> and the model no longer contains any
558   * {@link FunctionDefinition} objects.
559   <p>
560   * @return boolean <code>true</code> if the transformation was successful, 
561   * <code>false</code>, otherwise.
562   <p>
563   * @note This function will check the consistency of a model before
564   * attemptimg the transformation.  If the model is not valid SBML, the
565   * transformation will not be performed and the function will return 
566   * <code>false.</code>
567   */ public
568 boolean expandFunctionDefinitions() {
569    return libsbmlJNI.SBMLDocument_expandFunctionDefinitions(swigCPtr, this);
570  }
571
572  
573/**
574   * Removes {@link InitialAssignment} constructs from the document and
575   * replaces them with appropriate values.
576   <p>
577   * For example, suppose a {@link Model} contains a {@link InitialAssignment} to a symbol
578   * <code>'k'</code> where <code>'k'</code> is the identifier of a {@link Parameter}.  The outcome of
579   * invoking this method is that the 'value' attribute of the {@link Parameter}
580   * definition is set to the result calculated using the {@link InitialAssignment}
581   * object's <code>&lt;math&gt;</code> formula, and the corresponding
582   * {@link InitialAssignment} is then removed from the {@link Model}.
583   <p>
584   * @return boolean <code>true</code> if the transformation was successful, 
585   * <code>false</code>, otherwise.
586   <p>
587   * @note This function will check the consistency of a model before
588   * attemptimg the transformation.  If the model is not valid SBML, the
589   * transformation will not be performed and the function will return 
590   * <code>false.</code>  As part of that process, this method will check that it has
591   * values for any components referred to by the <code>&lt;math&gt;</code>
592   * elements of {@link InitialAssignment} objects.  In cases where not all of the
593   * values have been declared (e.g., if the mathematical expression refers
594   * to model entities that have no declared values), the {@link InitialAssignment}
595   * in question will <em>not</em> be removed and this method will return 
596   * <code>false.</code>
597   */ public
598 boolean expandInitialAssignments() {
599    return libsbmlJNI.SBMLDocument_expandInitialAssignments(swigCPtr, this);
600  }
601
602  
603/**
604   * Sets the SBML Level and Version of this {@link SBMLDocument} instance,
605   * attempting to convert the model as needed.
606   <p>
607   * This method is the principal way in libSBML to convert models between
608   * Levels and Versions of SBML.  Generally, models can be converted
609   * upward without difficulty (e.g., from SBML Level&nbsp;1 to
610   * Level&nbsp;2, or from an earlier Version of Level&nbsp;2 to the latest
611   * Version of Level&nbsp;2).  Sometimes models can be translated downward
612   * as well, if they do not use constructs specific to more advanced
613   * Levels of SBML.
614   <p>
615   * Before calling this method, callers may check compatibility directly
616   * using the methods {@link SBMLDocument#checkL1Compatibility()},
617   * {@link SBMLDocument#checkL2v1Compatibility()},
618   * {@link SBMLDocument#checkL2v2Compatibility()},
619   * {@link SBMLDocument#checkL2v3Compatibility()},
620   * {@link SBMLDocument#checkL2v4Compatibility()}, and
621   * {@link SBMLDocument#checkL3v1Compatibility()}.
622   <p>
623   * The valid combinations of SBML Level and Version as of this release
624   * of libSBML are the following: 
625   * <ul>
626   * <li> Level&nbsp;1 Version&nbsp;2
627   * <li> Level&nbsp;2 Version&nbsp;1
628   * <li> Level&nbsp;2 Version&nbsp;2
629   * <li> Level&nbsp;2 Version&nbsp;3
630   * <li> Level&nbsp;2 Version&nbsp;4
631   * <li> Level&nbsp;3 Version&nbsp;1
632   * </ul>
633   <p>
634   * Strict conversion applies the additional criteria that both the
635   * source and the target model must be consistent SBML.  Users can
636   * control the consistency checks that are applied using the
637   * {@link SBMLDocument#setConsistencyChecksForConversion(int, boolean)} method.  If either
638   * the source or the potential target model have validation errors, the
639   * conversion is not performed.  When a strict conversion is successful,
640   * the underlying SBML object model is altered to reflect the new level
641   * and version.  Thus, information that cannot be converted
642   * (e.g. sboTerms) will be lost.
643   <p>
644   * @param level the desired SBML Level
645   <p>
646   * @param version the desired Version within the SBML Level
647   <p>
648   * @param strict boolean indicating whether to check consistency
649   * of both the source and target model when performing
650   * conversion (defaults to <code> true </code>)
651   <p>
652   * @param ignorePackages boolean indicating whether the presence of
653   * packages should be ignored by the conversion routine 
654   * (defaults to <code> false </code>)
655   <p>
656   * @return <code>true</code> if the level and version of the document were
657   * successfully set to the requested values (which may have required
658   * conversion of the model), <code>false</code> otherwise.
659   <p>
660   * @note Calling this method will not <em>necessarily</em> lead to a successful
661   * conversion.  If the conversion fails, it will be logged in the error
662   * list associated with this {@link SBMLDocument}.  Callers should consult
663   * getNumErrors() to find out if the conversion succeeded without
664   * problems.  For conversions from Level&nbsp;2 to Level&nbsp;1, callers
665   * can also check the Level of the model after calling this method to
666   * find out whether it is Level&nbsp;1.  (If the conversion to
667   * Level&nbsp;1 failed, the Level of this model will be left unchanged.)
668   <p>
669   * 
670</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
671The native C++ implementation of this method defines a default argument
672value. In the documentation generated for different libSBML language
673bindings, you may or may not see corresponding arguments in the method
674declarations. For example, in Java and C#, a default argument is handled by
675declaring two separate methods, with one of them having the argument and
676the other one lacking the argument. However, the libSBML documentation will
677be <em>identical</em> for both methods. Consequently, if you are reading
678this and do not see an argument even though one is described, please look
679for descriptions of other variants of this method near where this one
680appears in the documentation.
681</dd></dl>
682 
683   <p>
684   * @see #checkL1Compatibility()
685   * @see #checkL2v1Compatibility()
686   * @see #checkL2v2Compatibility()
687   * @see #checkL2v3Compatibility()
688   * @see #checkL2v4Compatibility()
689   * @see #checkL3v1Compatibility()
690   * @see #checkL3v1Compatibility()
691   */ public
692 boolean setLevelAndVersion(long level, long version, boolean strict, boolean ignorePackages) {
693    return libsbmlJNI.SBMLDocument_setLevelAndVersion__SWIG_0(swigCPtr, this, level, version, strict, ignorePackages);
694  }
695
696  
697/**
698   * Sets the SBML Level and Version of this {@link SBMLDocument} instance,
699   * attempting to convert the model as needed.
700   <p>
701   * This method is the principal way in libSBML to convert models between
702   * Levels and Versions of SBML.  Generally, models can be converted
703   * upward without difficulty (e.g., from SBML Level&nbsp;1 to
704   * Level&nbsp;2, or from an earlier Version of Level&nbsp;2 to the latest
705   * Version of Level&nbsp;2).  Sometimes models can be translated downward
706   * as well, if they do not use constructs specific to more advanced
707   * Levels of SBML.
708   <p>
709   * Before calling this method, callers may check compatibility directly
710   * using the methods {@link SBMLDocument#checkL1Compatibility()},
711   * {@link SBMLDocument#checkL2v1Compatibility()},
712   * {@link SBMLDocument#checkL2v2Compatibility()},
713   * {@link SBMLDocument#checkL2v3Compatibility()},
714   * {@link SBMLDocument#checkL2v4Compatibility()}, and
715   * {@link SBMLDocument#checkL3v1Compatibility()}.
716   <p>
717   * The valid combinations of SBML Level and Version as of this release
718   * of libSBML are the following: 
719   * <ul>
720   * <li> Level&nbsp;1 Version&nbsp;2
721   * <li> Level&nbsp;2 Version&nbsp;1
722   * <li> Level&nbsp;2 Version&nbsp;2
723   * <li> Level&nbsp;2 Version&nbsp;3
724   * <li> Level&nbsp;2 Version&nbsp;4
725   * <li> Level&nbsp;3 Version&nbsp;1
726   * </ul>
727   <p>
728   * Strict conversion applies the additional criteria that both the
729   * source and the target model must be consistent SBML.  Users can
730   * control the consistency checks that are applied using the
731   * {@link SBMLDocument#setConsistencyChecksForConversion(int, boolean)} method.  If either
732   * the source or the potential target model have validation errors, the
733   * conversion is not performed.  When a strict conversion is successful,
734   * the underlying SBML object model is altered to reflect the new level
735   * and version.  Thus, information that cannot be converted
736   * (e.g. sboTerms) will be lost.
737   <p>
738   * @param level the desired SBML Level
739   <p>
740   * @param version the desired Version within the SBML Level
741   <p>
742   * @param strict boolean indicating whether to check consistency
743   * of both the source and target model when performing
744   * conversion (defaults to <code> true </code>)
745   <p>
746   * @param ignorePackages boolean indicating whether the presence of
747   * packages should be ignored by the conversion routine 
748   * (defaults to <code> false </code>)
749   <p>
750   * @return <code>true</code> if the level and version of the document were
751   * successfully set to the requested values (which may have required
752   * conversion of the model), <code>false</code> otherwise.
753   <p>
754   * @note Calling this method will not <em>necessarily</em> lead to a successful
755   * conversion.  If the conversion fails, it will be logged in the error
756   * list associated with this {@link SBMLDocument}.  Callers should consult
757   * getNumErrors() to find out if the conversion succeeded without
758   * problems.  For conversions from Level&nbsp;2 to Level&nbsp;1, callers
759   * can also check the Level of the model after calling this method to
760   * find out whether it is Level&nbsp;1.  (If the conversion to
761   * Level&nbsp;1 failed, the Level of this model will be left unchanged.)
762   <p>
763   * 
764</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
765The native C++ implementation of this method defines a default argument
766value. In the documentation generated for different libSBML language
767bindings, you may or may not see corresponding arguments in the method
768declarations. For example, in Java and C#, a default argument is handled by
769declaring two separate methods, with one of them having the argument and
770the other one lacking the argument. However, the libSBML documentation will
771be <em>identical</em> for both methods. Consequently, if you are reading
772this and do not see an argument even though one is described, please look
773for descriptions of other variants of this method near where this one
774appears in the documentation.
775</dd></dl>
776 
777   <p>
778   * @see #checkL1Compatibility()
779   * @see #checkL2v1Compatibility()
780   * @see #checkL2v2Compatibility()
781   * @see #checkL2v3Compatibility()
782   * @see #checkL2v4Compatibility()
783   * @see #checkL3v1Compatibility()
784   * @see #checkL3v1Compatibility()
785   */ public
786 boolean setLevelAndVersion(long level, long version, boolean strict) {
787    return libsbmlJNI.SBMLDocument_setLevelAndVersion__SWIG_1(swigCPtr, this, level, version, strict);
788  }
789
790  
791/**
792   * Sets the SBML Level and Version of this {@link SBMLDocument} instance,
793   * attempting to convert the model as needed.
794   <p>
795   * This method is the principal way in libSBML to convert models between
796   * Levels and Versions of SBML.  Generally, models can be converted
797   * upward without difficulty (e.g., from SBML Level&nbsp;1 to
798   * Level&nbsp;2, or from an earlier Version of Level&nbsp;2 to the latest
799   * Version of Level&nbsp;2).  Sometimes models can be translated downward
800   * as well, if they do not use constructs specific to more advanced
801   * Levels of SBML.
802   <p>
803   * Before calling this method, callers may check compatibility directly
804   * using the methods {@link SBMLDocument#checkL1Compatibility()},
805   * {@link SBMLDocument#checkL2v1Compatibility()},
806   * {@link SBMLDocument#checkL2v2Compatibility()},
807   * {@link SBMLDocument#checkL2v3Compatibility()},
808   * {@link SBMLDocument#checkL2v4Compatibility()}, and
809   * {@link SBMLDocument#checkL3v1Compatibility()}.
810   <p>
811   * The valid combinations of SBML Level and Version as of this release
812   * of libSBML are the following: 
813   * <ul>
814   * <li> Level&nbsp;1 Version&nbsp;2
815   * <li> Level&nbsp;2 Version&nbsp;1
816   * <li> Level&nbsp;2 Version&nbsp;2
817   * <li> Level&nbsp;2 Version&nbsp;3
818   * <li> Level&nbsp;2 Version&nbsp;4
819   * <li> Level&nbsp;3 Version&nbsp;1
820   * </ul>
821   <p>
822   * Strict conversion applies the additional criteria that both the
823   * source and the target model must be consistent SBML.  Users can
824   * control the consistency checks that are applied using the
825   * {@link SBMLDocument#setConsistencyChecksForConversion(int, boolean)} method.  If either
826   * the source or the potential target model have validation errors, the
827   * conversion is not performed.  When a strict conversion is successful,
828   * the underlying SBML object model is altered to reflect the new level
829   * and version.  Thus, information that cannot be converted
830   * (e.g. sboTerms) will be lost.
831   <p>
832   * @param level the desired SBML Level
833   <p>
834   * @param version the desired Version within the SBML Level
835   <p>
836   * @param strict boolean indicating whether to check consistency
837   * of both the source and target model when performing
838   * conversion (defaults to <code> true </code>)
839   <p>
840   * @param ignorePackages boolean indicating whether the presence of
841   * packages should be ignored by the conversion routine 
842   * (defaults to <code> false </code>)
843   <p>
844   * @return <code>true</code> if the level and version of the document were
845   * successfully set to the requested values (which may have required
846   * conversion of the model), <code>false</code> otherwise.
847   <p>
848   * @note Calling this method will not <em>necessarily</em> lead to a successful
849   * conversion.  If the conversion fails, it will be logged in the error
850   * list associated with this {@link SBMLDocument}.  Callers should consult
851   * getNumErrors() to find out if the conversion succeeded without
852   * problems.  For conversions from Level&nbsp;2 to Level&nbsp;1, callers
853   * can also check the Level of the model after calling this method to
854   * find out whether it is Level&nbsp;1.  (If the conversion to
855   * Level&nbsp;1 failed, the Level of this model will be left unchanged.)
856   <p>
857   * 
858</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
859The native C++ implementation of this method defines a default argument
860value. In the documentation generated for different libSBML language
861bindings, you may or may not see corresponding arguments in the method
862declarations. For example, in Java and C#, a default argument is handled by
863declaring two separate methods, with one of them having the argument and
864the other one lacking the argument. However, the libSBML documentation will
865be <em>identical</em> for both methods. Consequently, if you are reading
866this and do not see an argument even though one is described, please look
867for descriptions of other variants of this method near where this one
868appears in the documentation.
869</dd></dl>
870 
871   <p>
872   * @see #checkL1Compatibility()
873   * @see #checkL2v1Compatibility()
874   * @see #checkL2v2Compatibility()
875   * @see #checkL2v3Compatibility()
876   * @see #checkL2v4Compatibility()
877   * @see #checkL3v1Compatibility()
878   * @see #checkL3v1Compatibility()
879   */ public
880 boolean setLevelAndVersion(long level, long version) {
881    return libsbmlJNI.SBMLDocument_setLevelAndVersion__SWIG_2(swigCPtr, this, level, version);
882  }
883
884  
885/** * @internal */ public
886 void updateSBMLNamespace(String arg0, long level, long version) {
887    libsbmlJNI.SBMLDocument_updateSBMLNamespace(swigCPtr, this, arg0, level, version);
888  }
889
890  
891/**
892   * Sets the {@link Model} for this {@link SBMLDocument} to a copy of the given {@link Model}.
893   <p>
894   * @param m the new {@link Model} to use.
895   <p>
896   * <p>
897 * @return integer value indicating success/failure of the
898 * function.   The possible values
899 * returned by this function are:
900   * <ul>
901   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
902   * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH}
903   * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH}
904   *
905   * </ul> <p>
906   * @see #createModel()
907   * @see #getModel()
908   */ public
909 int setModel(Model m) {
910    return libsbmlJNI.SBMLDocument_setModel(swigCPtr, this, Model.getCPtr(m), m);
911  }
912
913  
914/**
915   * Creates a new {@link Model} inside this {@link SBMLDocument}, and returns a pointer to
916   * it.
917   <p>
918   * In SBML Level&nbsp;2, the use of an identifier on a {@link Model} object is
919   * optional.  This method takes an optional argument, <code>sid</code>, for setting
920   * the identifier.  If not supplied, the identifier attribute on the
921   * {@link Model} instance is not set.
922   <p>
923   * @param sid the identifier of the new {@link Model} to create.
924   <p>
925   * 
926</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
927The native C++ implementation of this method defines a default argument
928value. In the documentation generated for different libSBML language
929bindings, you may or may not see corresponding arguments in the method
930declarations. For example, in Java and C#, a default argument is handled by
931declaring two separate methods, with one of them having the argument and
932the other one lacking the argument. However, the libSBML documentation will
933be <em>identical</em> for both methods. Consequently, if you are reading
934this and do not see an argument even though one is described, please look
935for descriptions of other variants of this method near where this one
936appears in the documentation.
937</dd></dl>
938 
939   <p>
940   * @see #getModel()
941   * @see SBMLDocument#setModel(Model)
942   */ public
943 Model createModel(String sid) {
944    long cPtr = libsbmlJNI.SBMLDocument_createModel__SWIG_0(swigCPtr, this, sid);
945    return (cPtr == 0) ? null : new Model(cPtr, false);
946  }
947
948  
949/**
950   * Creates a new {@link Model} inside this {@link SBMLDocument}, and returns a pointer to
951   * it.
952   <p>
953   * In SBML Level&nbsp;2, the use of an identifier on a {@link Model} object is
954   * optional.  This method takes an optional argument, <code>sid</code>, for setting
955   * the identifier.  If not supplied, the identifier attribute on the
956   * {@link Model} instance is not set.
957   <p>
958   * @param sid the identifier of the new {@link Model} to create.
959   <p>
960   * 
961</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
962The native C++ implementation of this method defines a default argument
963value. In the documentation generated for different libSBML language
964bindings, you may or may not see corresponding arguments in the method
965declarations. For example, in Java and C#, a default argument is handled by
966declaring two separate methods, with one of them having the argument and
967the other one lacking the argument. However, the libSBML documentation will
968be <em>identical</em> for both methods. Consequently, if you are reading
969this and do not see an argument even though one is described, please look
970for descriptions of other variants of this method near where this one
971appears in the documentation.
972</dd></dl>
973 
974   <p>
975   * @see #getModel()
976   * @see SBMLDocument#setModel(Model)
977   */ public
978 Model createModel() {
979    long cPtr = libsbmlJNI.SBMLDocument_createModel__SWIG_1(swigCPtr, this);
980    return (cPtr == 0) ? null : new Model(cPtr, false);
981  }
982
983  
984/**
985   * Sets the location of this {@link SBMLDocument}.
986   <p>
987   * Called automatically when readSBMLFromFile is used, but may be set
988   * manually as well.
989   */ public
990 void setLocationURI(String uri) {
991    libsbmlJNI.SBMLDocument_setLocationURI(swigCPtr, this, uri);
992  }
993
994  
995/**
996   * Get the location of this {@link SBMLDocument}.
997   <p>
998   * If this document was read from a file or had its location set manually,
999   * that filename or set location will be returned, otherwise, an empty
1000   * string is returned.
1001   */ public
1002 String getLocationURI() {
1003    return libsbmlJNI.SBMLDocument_getLocationURI__SWIG_0(swigCPtr, this);
1004  }
1005
1006  
1007/**
1008   * Controls the consistency checks that are performed when
1009   * {@link SBMLDocument#checkConsistency()} is called.
1010   <p>
1011   * This method works by adding or subtracting consistency checks from the
1012   * set of all possible checks that {@link SBMLDocument#checkConsistency()} knows
1013   * how to perform.  This method may need to be called multiple times in
1014   * order to achieve the desired combination of checks.  The first
1015   * argument (<code>category</code>) in a call to this method indicates the category
1016   * of consistency/error checks that are to be turned on or off, and the
1017   * second argument (<code>apply</code>, a boolean) indicates whether to turn it on
1018   * (value of <code>true</code>) or off (value of <code>false</code>).
1019   <p>
1020   * The possible categories (values to the argument <code>category</code>) are the
1021   * set of constants whose names begin with the characters <code>LIBSBML_CAT_</code>
1022   * in the interface class {@link libsbmlConstants}.
1023   * The following are the possible choices:
1024   <p>
1025   * <ul>
1026   * <li> {@link libsbmlConstants#LIBSBML_CAT_GENERAL_CONSISTENCY LIBSBML_CAT_GENERAL_CONSISTENCY}:
1027   * Correctness and consistency of specific SBML language constructs.
1028   * Performing this set of checks is highly recommended.  With respect to
1029   * the SBML specification, these concern failures in applying the
1030   * validation rules numbered 2xxxx in the Level&nbsp;2
1031   * Versions&nbsp;2&ndash;4 and Level&nbsp;3 Version&nbsp;1 specifications.
1032   <p>
1033   * <li> {@link libsbmlConstants#LIBSBML_CAT_IDENTIFIER_CONSISTENCY LIBSBML_CAT_IDENTIFIER_CONSISTENCY}:
1034   * Correctness and consistency of identifiers used for model entities.  An
1035   * example of inconsistency would be using a species identifier in a
1036   * reaction rate formula without first having declared the species.  With
1037   * respect to the SBML specification, these concern failures in applying
1038   * the validation rules numbered 103xx in the Level&nbsp;2
1039   * Versions&nbsp;2&ndash;4 and Level&nbsp;3 Version&nbsp;1 specifications.
1040   <p>
1041   * <li> {@link libsbmlConstants#LIBSBML_CAT_UNITS_CONSISTENCY LIBSBML_CAT_UNITS_CONSISTENCY}:
1042   * Consistency of measurement units associated with quantities in a model.
1043   * With respect to the SBML specification, these concern failures in
1044   * applying the validation rules numbered 105xx in the Level&nbsp;2
1045   * Versions&nbsp;2&ndash;4 and Level&nbsp;3 Version&nbsp;1 specifications.
1046   <p>
1047   * <li> {@link libsbmlConstants#LIBSBML_CAT_MATHML_CONSISTENCY LIBSBML_CAT_MATHML_CONSISTENCY}:
1048   * Syntax of MathML constructs.  With respect to the SBML specification,
1049   * these concern failures in applying the validation rules numbered 102xx
1050   * in the Level&nbsp;2 Versions&nbsp;2&ndash;4 and Level&nbsp;3
1051   * Version&nbsp;1 specifications.
1052   <p>
1053   * <li> {@link libsbmlConstants#LIBSBML_CAT_SBO_CONSISTENCY LIBSBML_CAT_SBO_CONSISTENCY}:
1054   * Consistency and validity of SBO identifiers (if any) used in the model.
1055   * With respect to the SBML specification, these concern failures in
1056   * applying the validation rules numbered 107xx in the Level&nbsp;2
1057   * Versions&nbsp;2&ndash;4 and Level&nbsp;3 Version&nbsp;1 specifications.
1058   <p>
1059   * <li> {@link libsbmlConstants#LIBSBML_CAT_OVERDETERMINED_MODEL LIBSBML_CAT_OVERDETERMINED_MODEL}:
1060   * Static analysis of whether the system of equations implied by a model is
1061   * mathematically overdetermined.  With respect to the SBML specification,
1062   * this is validation rule #10601 in the Level&nbsp;2
1063   * Versions&nbsp;2&ndash;4 and Level&nbsp;3 Version&nbsp;1 specifications.
1064   <p>
1065   * <li> {@link libsbmlConstants#LIBSBML_CAT_MODELING_PRACTICE LIBSBML_CAT_MODELING_PRACTICE}:
1066   * Additional checks for recommended good modeling practice. (These are
1067   * tests performed by libSBML and do not have equivalent SBML validation
1068   * rules.)  </ul>
1069   <p>
1070   * <em>By default, all validation checks are applied</em> to the model in
1071   * an {@link SBMLDocument} object <em>unless</em>
1072   * {@link SBMLDocument#setConsistencyChecks(int categ, boolean onoff)}
1073   * is called to indicate that only a subset should be applied.  Further,
1074   * this default (i.e., performing all checks) applies separately to
1075   * <em>each new {@link SBMLDocument} object</em> created.  In other words, each
1076   * time a model is read using {@link SBMLReader#readSBML(String filename)},
1077   * {@link SBMLReader#readSBMLFromString(String xml)},
1078   * or the global functions readSBML() and readSBMLFromString(), a new
1079   * {@link SBMLDocument} is created and for that document, a call to
1080   * {@link SBMLDocument#checkConsistency()} will default to applying all possible checks.
1081   * Calling programs must invoke
1082   * {@link SBMLDocument#setConsistencyChecks(int categ, boolean onoff)}
1083   * for each such new model if they wish to change the consistency checks
1084   * applied.
1085   <p>
1086   * @param category a value drawn from * the set of SBML error categories indicating the
1087   * consistency checking/validation to be turned on or off.
1088   <p>
1089   * @param apply a boolean indicating whether the checks indicated by
1090   * <code>category</code> should be applied or not.
1091   <p>
1092   * @see SBMLDocument#checkConsistency()
1093   */ public
1094 void setConsistencyChecks(int category, boolean apply) {
1095    libsbmlJNI.SBMLDocument_setConsistencyChecks(swigCPtr, this, category, apply);
1096  }
1097
1098  
1099/**
1100   * Controls the consistency checks that are performed when
1101   * {@link SBMLDocument#setLevelAndVersion(long, long, boolean)} is called.
1102   <p>
1103   * This method works by adding or subtracting consistency checks from the
1104   * set of all possible checks that may be performed to avoid conversion
1105   * to or from an invalid document.  This method may need to be called 
1106   * multiple times in
1107   * order to achieve the desired combination of checks.  The first
1108   * argument (<code>category</code>) in a call to this method indicates the category
1109   * of consistency/error checks that are to be turned on or off, and the
1110   * second argument (<code>apply</code>, a boolean) indicates whether to turn it on
1111   * (value of <code>true</code>) or off (value of <code>false</code>).
1112   <p>
1113   * The possible categories (values to the argument <code>category</code>) are the
1114   * set of constants whose names begin with the characters <code>LIBSBML_CAT_</code>
1115   * in the interface class {@link libsbmlConstants}.
1116   * The following are the possible choices:
1117   <p>
1118   * <ul>
1119   * <li> {@link libsbmlConstants#LIBSBML_CAT_GENERAL_CONSISTENCY LIBSBML_CAT_GENERAL_CONSISTENCY}:
1120   * Correctness and consistency of specific SBML language constructs.
1121   * Performing this set of checks is highly recommended.  With respect to
1122   * the SBML specification, these concern failures in applying the
1123   * validation rules numbered 2xxxx in the Level&nbsp;2
1124   * Versions&nbsp;2&ndash;4 and Level&nbsp;3 Version&nbsp;1 specifications.
1125   <p>
1126   * <li> {@link libsbmlConstants#LIBSBML_CAT_IDENTIFIER_CONSISTENCY LIBSBML_CAT_IDENTIFIER_CONSISTENCY}:
1127   * Correctness and consistency of identifiers used for model entities.  An
1128   * example of inconsistency would be using a species identifier in a
1129   * reaction rate formula without first having declared the species.  With
1130   * respect to the SBML specification, these concern failures in applying
1131   * the validation rules numbered 103xx in the Level&nbsp;2
1132   * Versions&nbsp;2&ndash;4 and Level&nbsp;3 Version&nbsp;1 specifications.
1133   <p>
1134   * <li> {@link libsbmlConstants#LIBSBML_CAT_UNITS_CONSISTENCY LIBSBML_CAT_UNITS_CONSISTENCY}:
1135<p>
1136   * Consistency of measurement units associated with quantities in a model.
1137   * With respect to the SBML specification, these concern failures in
1138   * applying the validation rules numbered 105xx in the Level&nbsp;2
1139   * Versions&nbsp;2&ndash;4 and Level&nbsp;3 Version&nbsp;1 specifications.
1140   <p>
1141   * <li> {@link libsbmlConstants#LIBSBML_CAT_MATHML_CONSISTENCY LIBSBML_CAT_MATHML_CONSISTENCY}:
1142   * Syntax of MathML constructs.  With respect to the SBML specification,
1143   * these concern failures in applying the validation rules numbered 102xx
1144   * in the Level&nbsp;2 Versions&nbsp;2&ndash;4 and Level&nbsp;3
1145   * Version&nbsp;1 specifications.
1146   <p>
1147   * <li> {@link libsbmlConstants#LIBSBML_CAT_SBO_CONSISTENCY LIBSBML_CAT_SBO_CONSISTENCY}:
1148   * Consistency and validity of SBO identifiers (if any) used in the model.
1149   * With respect to the SBML specification, these concern failures in
1150   * applying the validation rules numbered 107xx in the Level&nbsp;2
1151   * Versions&nbsp;2&ndash;4 and Level&nbsp;3 Version&nbsp;1 specifications.
1152   <p>
1153   * <li> {@link libsbmlConstants#LIBSBML_CAT_OVERDETERMINED_MODEL LIBSBML_CAT_OVERDETERMINED_MODEL}:
1154   * Static analysis of whether the system of equations implied by a model is
1155   * mathematically overdetermined.  With respect to the SBML specification,
1156   * this is validation rule #10601 in the Level&nbsp;2
1157   * Versions&nbsp;2&ndash;4 and Level&nbsp;3 Version&nbsp;1 specifications.
1158   <p>
1159   * <li> {@link libsbmlConstants#LIBSBML_CAT_MODELING_PRACTICE LIBSBML_CAT_MODELING_PRACTICE}:
1160   * Additional checks for recommended good modeling practice. (These are
1161   * tests performed by libSBML and do not have equivalent SBML validation
1162   * rules.)
1163   * </ul>
1164   <p>
1165   * <em>By default, all validation checks are applied</em> to the model in
1166   * an {@link SBMLDocument} object <em>unless</em>
1167   * {@link SBMLDocument#setConsistencyChecks(int, boolean)}
1168   * is called to indicate that only a subset should be applied.  Further,
1169   * this default (i.e., performing all checks) applies separately to
1170   * <em>each new {@link SBMLDocument} object</em> created.  In other words, each
1171   * time a model is read using {@link SBMLReader#readSBML(String)},
1172   * {@link SBMLReader#readSBMLFromString(String)},
1173   * or the global functions readSBML() and readSBMLFromString(), a new
1174   * {@link SBMLDocument} is created and for that document, a call to
1175   * {@link SBMLDocument#checkConsistency()} will default to applying all possible checks.
1176   * Calling programs must invoke
1177   * {@link SBMLDocument#setConsistencyChecks(int, boolean)}
1178   * for each such new model if they wish to change the consistency checks
1179   * applied.
1180   <p>
1181   * @param category a value drawn from * the set of SBML error categories indicating the consistency
1182   * checking/validation to be turned on or off.
1183   <p>
1184   * @param apply a boolean indicating whether the checks indicated by
1185   * <code>category</code> should be applied or not.
1186   <p>
1187   * @see SBMLDocument#setLevelAndVersion(long, long, boolean)
1188   */ public
1189 void setConsistencyChecksForConversion(int category, boolean apply) {
1190    libsbmlJNI.SBMLDocument_setConsistencyChecksForConversion(swigCPtr, this, category, apply);
1191  }
1192
1193  
1194/**
1195   * Performs consistency checking and validation on this SBML document.
1196   <p>
1197   * If this method returns a nonzero value (meaning, one or more
1198   * consistency checks have failed for SBML document), the failures may be
1199   * due to warnings <em>or</em> errors.  Callers should inspect the severity
1200   * flag in the individual {@link SBMLError} objects returned by
1201   * {@link SBMLDocument#getError(long)} to determine the nature of the failures.
1202   <p>
1203   * @return the number of failed checks (errors) encountered.
1204   <p>
1205   * @see SBMLDocument#checkInternalConsistency()
1206   */ public
1207 long checkConsistency() {
1208    return libsbmlJNI.SBMLDocument_checkConsistency(swigCPtr, this);
1209  }
1210
1211  
1212/**
1213   * Performs consistency checking and validation on this SBML document
1214   * using the ultra strict units validator that assumes that there
1215   * are no hidden numerical conversion factors.
1216   <p>
1217   * If this method returns a nonzero value (meaning, one or more
1218   * consistency checks have failed for SBML document), the failures may be
1219   * due to warnings <em>or</em> errors.  Callers should inspect the severity
1220   * flag in the individual {@link SBMLError} objects returned by
1221   * {@link SBMLDocument#getError(long)} to determine the nature of the failures.
1222   <p>
1223   * @return the number of failed checks (errors) encountered.
1224   <p>
1225   * @see SBMLDocument#checkInternalConsistency()
1226   */ public
1227 long checkConsistencyWithStrictUnits() {
1228    return libsbmlJNI.SBMLDocument_checkConsistencyWithStrictUnits(swigCPtr, this);
1229  }
1230
1231  
1232/**
1233   * Performs consistency checking and validation on this SBML document.
1234   <p>
1235   * If this method returns a nonzero value (meaning, one or more
1236   * consistency checks have failed for SBML document), the failures may be
1237   * due to warnings <em>or</em> errors.  Callers should inspect the severity
1238   * flag in the individual {@link SBMLError} objects returned by
1239   * {@link SBMLDocument#getError(long)} to determine the nature of the failures.
1240   <p>
1241   * @note unlike checkConsistency this method will write the document
1242   *       in order to determine all errors for the document. This will 
1243   *       also clear the error log. 
1244   <p>
1245   * @return the number of failed checks (errors) encountered.
1246   <p>
1247   * @see SBMLDocument#checkConsistency()
1248   */ public
1249 long validateSBML() {
1250    return libsbmlJNI.SBMLDocument_validateSBML(swigCPtr, this);
1251  }
1252
1253  
1254/**
1255   * Performs consistency checking on libSBML's internal representation of 
1256   * an SBML {@link Model}.
1257   <p>
1258   * Callers should query the results of the consistency check by calling
1259   * {@link SBMLDocument#getError(long)}.
1260   <p>
1261   * @return the number of failed checks (errors) encountered.
1262   <p>
1263   * The distinction between this method and
1264   * {@link SBMLDocument#checkConsistency()} is that this method reports on
1265   * fundamental syntactic and structural errors that violate the XML
1266   * Schema for SBML; by contrast, {@link SBMLDocument#checkConsistency()}
1267   * performs more elaborate model verifications and also validation
1268   * according to the validation rules written in the appendices of the
1269   * SBML Level&nbsp;2 Versions&nbsp;2&ndash;4 specification documents.
1270   <p>
1271   * @see SBMLDocument#checkConsistency()
1272   */ public
1273 long checkInternalConsistency() {
1274    return libsbmlJNI.SBMLDocument_checkInternalConsistency(swigCPtr, this);
1275  }
1276
1277  
1278/**
1279   * Performs a set of consistency checks on the document to establish
1280   * whether it is compatible with SBML Level&nbsp;1 and can be converted
1281   * to Level&nbsp;1.
1282   <p>
1283   * Callers should query the results of the consistency check by calling
1284   * {@link SBMLDocument#getError(long)}.
1285   <p>
1286   * @return the number of failed checks (errors) encountered.
1287   */ public
1288 long checkL1Compatibility() {
1289    return libsbmlJNI.SBMLDocument_checkL1Compatibility(swigCPtr, this);
1290  }
1291
1292  
1293/**
1294   * Performs a set of consistency checks on the document to establish
1295   * whether it is compatible with SBML Level&nbsp;2 Version&nbsp;1 and can
1296   * be converted to Level&nbsp;2 Version&nbsp;1.
1297   <p>
1298   * Callers should query the results of the consistency check by calling
1299   * {@link SBMLDocument#getError(long)}.
1300   <p>
1301   * @return the number of failed checks (errors) encountered.
1302   */ public
1303 long checkL2v1Compatibility() {
1304    return libsbmlJNI.SBMLDocument_checkL2v1Compatibility(swigCPtr, this);
1305  }
1306
1307  
1308/**
1309   * Performs a set of consistency checks on the document to establish
1310   * whether it is compatible with SBML Level&nbsp;2 Version&nbsp;2 and can
1311   * be converted to Level&nbsp;2 Version&nbsp;2.
1312   <p>
1313   * Callers should query the results of the consistency check by calling
1314   * {@link SBMLDocument#getError(long)}.
1315   <p>
1316   * @return the number of failed checks (errors) encountered.
1317   */ public
1318 long checkL2v2Compatibility() {
1319    return libsbmlJNI.SBMLDocument_checkL2v2Compatibility(swigCPtr, this);
1320  }
1321
1322  
1323/**
1324   * Performs a set of consistency checks on the document to establish
1325   * whether it is compatible with SBML Level&nbsp;2 Version&nbsp;3 and can
1326   * be converted to Level&nbsp;2 Version&nbsp;3.
1327   <p>
1328   * Callers should query the results of the consistency check by calling
1329   * {@link SBMLDocument#getError(long)}.
1330   <p>
1331   * @return the number of failed checks (errors) encountered.
1332   */ public
1333 long checkL2v3Compatibility() {
1334    return libsbmlJNI.SBMLDocument_checkL2v3Compatibility(swigCPtr, this);
1335  }
1336
1337  
1338/**
1339   * Performs a set of consistency checks on the document to establish
1340   * whether it is compatible with SBML Level&nbsp;2 Version&nbsp;4 and can
1341   * be converted to Level&nbsp;2 Version&nbsp;4.
1342   <p>
1343   * Callers should query the results of the consistency check by calling
1344   * {@link SBMLDocument#getError(long)}.
1345   <p>
1346   * @return the number of failed checks (errors) encountered.
1347   */ public
1348 long checkL2v4Compatibility() {
1349    return libsbmlJNI.SBMLDocument_checkL2v4Compatibility(swigCPtr, this);
1350  }
1351
1352  
1353/**
1354   * Performs a set of consistency checks on the document to establish
1355   * whether it is compatible with SBML Level&nbsp;3 Version&nbsp;1 and can
1356   * be converted to Level&nbsp;3 Version&nbsp;1.
1357   <p>
1358   * Callers should query the results of the consistency check by calling
1359   * {@link SBMLDocument#getError(long)}.
1360   <p>
1361   * @return the number of failed checks (errors) encountered.
1362   */ public
1363 long checkL3v1Compatibility() {
1364    return libsbmlJNI.SBMLDocument_checkL3v1Compatibility(swigCPtr, this);
1365  }
1366
1367  
1368/**
1369   * Returns the nth error or warning encountered during parsing,
1370   * consistency checking, or attempted translation of this model.
1371   <p>
1372   * Callers can use method {@link XMLError#getSeverity()} on the result to assess
1373   * the severity of the problem.  The possible severity levels range from
1374   * informational messages to fatal errors.
1375   <p>
1376   * @return the error or warning indexed by integer <code>n</code>, or return 
1377   * <code>null</code> if <code>n &gt; (getNumErrors() - 1)</code>.
1378   <p>
1379   * @param n the integer index of the error sought.
1380   <p>
1381   * @see SBMLDocument#getNumErrors()
1382   */ public
1383 SBMLError getError(long n) {
1384    long cPtr = libsbmlJNI.SBMLDocument_getError(swigCPtr, this, n);
1385    return (cPtr == 0) ? null : new SBMLError(cPtr, false);
1386  }
1387
1388  
1389/**
1390   * Returns the nth error or warning with the given severity
1391   * encountered during parsing, consistency checking, or attempted
1392   * translation of this model.
1393   <p>
1394   * @return the error or warning indexed by integer <code>n</code>, or return 
1395   * <code>null</code> if <code>n &gt; (getNumErrors(severity) - 1)</code>.
1396   <p>
1397   * @param n the integer index of the error sought.
1398   * @param severity the severity of the error sought.
1399   <p>
1400   * @see SBMLDocument#getNumErrors()
1401   */ public
1402 SBMLError getErrorWithSeverity(long n, long severity) {
1403    long cPtr = libsbmlJNI.SBMLDocument_getErrorWithSeverity(swigCPtr, this, n, severity);
1404    return (cPtr == 0) ? null : new SBMLError(cPtr, false);
1405  }
1406
1407  
1408/**
1409   * Returns the number of errors or warnings encountered during parsing,
1410   * consistency checking, or attempted translation of this model.
1411   <p>
1412   * @return the number of errors or warnings encountered
1413   <p>
1414   * @see SBMLDocument#getError(long n)
1415   */ public
1416 long getNumErrors() {
1417    return libsbmlJNI.SBMLDocument_getNumErrors__SWIG_0(swigCPtr, this);
1418  }
1419
1420  
1421/**
1422   * Returns the number of errors or warnings encountered with the given 
1423   * severity during parsing,
1424   * consistency checking, or attempted translation of this model.
1425   <p>
1426   * @param severity the severity of the error sought. 
1427   <p>
1428   * @return the number of errors or warnings encountered
1429   <p>
1430   * @see SBMLDocument#getError(long n)
1431   */ public
1432 long getNumErrors(long severity) {
1433    return libsbmlJNI.SBMLDocument_getNumErrors__SWIG_1(swigCPtr, this, severity);
1434  }
1435
1436  
1437/**
1438   * Prints all the errors or warnings encountered trying to parse,
1439   * check, or translate this SBML document.
1440   <p>
1441   * It prints the text to the stream given by the optional parameter 
1442   * <code>stream</code>.  If no parameter is given, it prints the output to the
1443   * standard error stream.
1444   <p>
1445   * If no errors have occurred, i.e., <code>getNumErrors() == 0</code>, no
1446   * output will be sent to the stream.
1447   <p>
1448   * The format of the output is:
1449   * <pre class='fragment'>
1450   N error(s):
1451     line NNN: (id) message
1452 </pre>
1453   <p>
1454   * @param stream the ostream or ostringstream object indicating where
1455   * the output should be printed.
1456   <p>
1457   * 
1458</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
1459The native C++ implementation of this method defines a default argument
1460value. In the documentation generated for different libSBML language
1461bindings, you may or may not see corresponding arguments in the method
1462declarations. For example, in Java and C#, a default argument is handled by
1463declaring two separate methods, with one of them having the argument and
1464the other one lacking the argument. However, the libSBML documentation will
1465be <em>identical</em> for both methods. Consequently, if you are reading
1466this and do not see an argument even though one is described, please look
1467for descriptions of other variants of this method near where this one
1468appears in the documentation.
1469</dd></dl>
1470 
1471   <p>
1472   * @see #getNumErrors()
1473   * @see #getErrorLog()
1474   * @see SBMLDocument#getError(long n)
1475   */ public
1476 void printErrors(OStream stream) {
1477    libsbmlJNI.SBMLDocument_printErrors__SWIG_0(swigCPtr, this, SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream()), stream);
1478  }
1479
1480  
1481/**
1482   * Prints all the errors or warnings encountered trying to parse,
1483   * check, or translate this SBML document.
1484   <p>
1485   * It prints the text to the stream given by the optional parameter 
1486   * <code>stream</code>.  If no parameter is given, it prints the output to the
1487   * standard error stream.
1488   <p>
1489   * If no errors have occurred, i.e., <code>getNumErrors() == 0</code>, no
1490   * output will be sent to the stream.
1491   <p>
1492   * The format of the output is:
1493   * <pre class='fragment'>
1494   N error(s):
1495     line NNN: (id) message
1496 </pre>
1497   <p>
1498   * @param stream the ostream or ostringstream object indicating where
1499   * the output should be printed.
1500   <p>
1501   * 
1502</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
1503The native C++ implementation of this method defines a default argument
1504value. In the documentation generated for different libSBML language
1505bindings, you may or may not see corresponding arguments in the method
1506declarations. For example, in Java and C#, a default argument is handled by
1507declaring two separate methods, with one of them having the argument and
1508the other one lacking the argument. However, the libSBML documentation will
1509be <em>identical</em> for both methods. Consequently, if you are reading
1510this and do not see an argument even though one is described, please look
1511for descriptions of other variants of this method near where this one
1512appears in the documentation.
1513</dd></dl>
1514 
1515   <p>
1516   * @see #getNumErrors()
1517   * @see #getErrorLog()
1518   * @see SBMLDocument#getError(long n)
1519   */ public
1520 void printErrors() {
1521    libsbmlJNI.SBMLDocument_printErrors__SWIG_1(swigCPtr, this);
1522  }
1523
1524  
1525/**
1526    * Prints all the errors or warnings with the given severity encountered 
1527    * trying to parse, check, or translate this SBML document.
1528    <p>
1529    * It prints the text to the stream given by the parameter 
1530    * <code>stream</code>.  
1531    <p>
1532    * If no errors have occurred, i.e., <code>getNumErrors(severity) == 0</code>, no
1533    * output will be sent to the stream.
1534    <p>
1535    * The format of the output is:
1536    * <pre class='fragment'>
1537    N error(s):
1538      line NNN: (id) message
1539</pre>
1540    <p>
1541    * @param stream the ostream or ostringstream object indicating where
1542    * the output should be printed.
1543    * @param severity of the errors sought.
1544    <p>
1545    * @see #getNumErrors(long severity)
1546    * @see #getErrorLog()
1547    * @see SBMLDocument#getErrorWithSeverity(long n, long severity)
1548    */ public
1549 void printErrors(OStream stream, long severity) {
1550    libsbmlJNI.SBMLDocument_printErrors__SWIG_2(swigCPtr, this, SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream()), stream, severity);
1551  }
1552
1553  public void connectToChild() {
1554    libsbmlJNI.SBMLDocument_connectToChild(swigCPtr, this);
1555  }
1556
1557  
1558/**
1559   * Converts this document using the converter that best matches
1560   * the given conversion properties. 
1561   <p>
1562   * @param props the conversion properties to use
1563   <p>
1564   * <p>
1565 * @return integer value indicating success/failure of the
1566 * function.   The possible values
1567 * returned by this function are:
1568   * <ul>
1569   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1570   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
1571   * <li> {@link libsbmlConstants#LIBSBML_CONV_CONVERSION_NOT_AVAILABLE LIBSBML_CONV_CONVERSION_NOT_AVAILABLE}
1572   * </ul>
1573   */ public
1574 int convert(ConversionProperties props) {
1575    return libsbmlJNI.SBMLDocument_convert(swigCPtr, this, ConversionProperties.getCPtr(props), props);
1576  }
1577
1578  
1579/** * @internal */ public
1580 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
1581    libsbmlJNI.SBMLDocument_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
1582  }
1583
1584  
1585/**
1586   * Returns the libSBML type code for this SBML object.
1587   <p>
1588   * <p>
1589 * LibSBML attaches an identifying code to every kind of SBML object.  These
1590 * are integer constants known as <em>SBML type codes</em>.  The names of all
1591 * the codes begin with the characters <code>SBML_</code>.
1592 * In the Java language interface for libSBML, the
1593 * type codes are defined as static integer constants in the interface class
1594 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
1595 * package plug-ins may use overlapping type codes; to identify the package
1596 * to which a given object belongs, call the <code>getPackageName()</code>
1597 * method on the object.
1598   <p>
1599   * @return the SBML type code for this object:
1600   * {@link libsbmlConstants#SBML_DOCUMENT SBML_DOCUMENT} (default).
1601   <p>
1602   * <p>
1603 * @warning <span class='warning'>The specific integer values of the possible
1604 * type codes may be reused by different Level&nbsp;3 package plug-ins.
1605 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
1606 * both getTypeCode() and getPackageName()</strong>.</span>
1607   <p>
1608   * @see SBMLDocument#getElementName()
1609   * @see #getPackageName()
1610   */ public
1611 int getTypeCode() {
1612    return libsbmlJNI.SBMLDocument_getTypeCode(swigCPtr, this);
1613  }
1614
1615  
1616/**
1617   * Returns the XML element name of this object, which for {@link SBMLDocument},
1618   * is always <code>'sbml'.</code>
1619   <p>
1620   * @return the name of this element, i.e., <code>'sbml'.</code>
1621   */ public
1622 String getElementName() {
1623    return libsbmlJNI.SBMLDocument_getElementName(swigCPtr, this);
1624  }
1625
1626  
1627/**
1628   * Returns the list of errors or warnings logged during parsing, 
1629   * consistency checking, or attempted translation of this model.
1630   <p>
1631   * @return the {@link SBMLErrorLog} used for this {@link SBMLDocument}
1632   <p>
1633   * @see SBMLDocument#getNumErrors()
1634   */ public
1635 SBMLErrorLog getErrorLog() {
1636    long cPtr = libsbmlJNI.SBMLDocument_getErrorLog__SWIG_0(swigCPtr, this);
1637    return (cPtr == 0) ? null : new SBMLErrorLog(cPtr, false);
1638  }
1639
1640  
1641/**
1642   * Returns a list of XML Namespaces associated with the XML content
1643   * of this SBML document.
1644   <p>
1645   * @return the XML Namespaces associated with this SBML object
1646   */ public
1647 XMLNamespaces getNamespaces() {
1648    long cPtr = libsbmlJNI.SBMLDocument_getNamespaces(swigCPtr, this);
1649    return (cPtr == 0) ? null : new XMLNamespaces(cPtr, false);
1650  }
1651
1652  
1653/**
1654   * Set/unset default namespace to each top-level element defined in the
1655   * given package extension.
1656   <p>
1657   * This works by adding a <code>xmlns=&quot;...&quot;</code> attribute.  No
1658   * prefix will be written when writing elements defined in the given
1659   * package extension if <code>true</code> is given as second argument.
1660   <p>
1661   * @param package the name or URI of the package extension.
1662   * @param flag boolean value to indicate whether to write a namespace
1663   * prefix.
1664   <p>
1665   * <p>
1666 * @return integer value indicating success/failure of the
1667 * function.   The possible values
1668 * returned by this function are:
1669   * <ul>
1670   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1671   * <li> {@link libsbmlConstants#LIBSBML_PKG_UNKNOWN_VERSION LIBSBML_PKG_UNKNOWN_VERSION}
1672   * </ul>
1673   */ public
1674 int enableDefaultNS(String arg0, boolean flag) {
1675    return libsbmlJNI.SBMLDocument_enableDefaultNS(swigCPtr, this, arg0, flag);
1676  }
1677
1678  
1679/**
1680   * Returns <code>true</code> if a default namespace is added to each top-level
1681   * element defined in the given package extension, otherwise returns
1682   * <code>false.</code>
1683   <p>
1684   * This basically checks if the attribute
1685   * <code>xmlns=&quot;...&quot;</code> is present.
1686   <p>
1687   * @param package the name or URI of the package extension.
1688   <p>
1689   * @return a boolean 
1690   */ public
1691 boolean isEnabledDefaultNS(String arg0) {
1692    return libsbmlJNI.SBMLDocument_isEnabledDefaultNS(swigCPtr, this, arg0);
1693  }
1694
1695  
1696/**
1697   * Sets the <code>required</code> attribute value of the given package
1698   * extension.
1699   <p>
1700   * @note The name of package must not be given if the package is not
1701   * enabled.
1702   <p>
1703   * @param package the name or URI of the package extension.
1704   * @param flag Boolean value indicating whether the package is required.
1705   <p>
1706   * <p>
1707 * @return integer value indicating success/failure of the
1708 * function.   The possible values
1709 * returned by this function are:
1710   * <ul>
1711   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1712   * <li> {@link libsbmlConstants#LIBSBML_PKG_UNKNOWN_VERSION LIBSBML_PKG_UNKNOWN_VERSION}
1713   * </ul>
1714   */ public
1715 int setPackageRequired(String arg0, boolean flag) {
1716    return libsbmlJNI.SBMLDocument_setPackageRequired(swigCPtr, this, arg0, flag);
1717  }
1718
1719  
1720/**
1721   * Returns the <code>required</code> attribute of the given package
1722   * extension.
1723   <p>
1724   * @note The name of package must not be given if the package is not
1725   * enabled.
1726   <p>
1727   * @param package the name or URI of the package extension.
1728   <p>
1729   * @return Boolean flag indicating whether the package is flagged as
1730   * being required.
1731   */ public
1732 boolean getPackageRequired(String arg0) {
1733    return libsbmlJNI.SBMLDocument_getPackageRequired(swigCPtr, this, arg0);
1734  }
1735
1736  
1737/**
1738   * Returns <code>true</code> if the required attribute of the given package extension
1739   * is defined, otherwise returns <code>false.</code>
1740   <p>
1741   * @note The name of package must not be given if the package is not
1742   * enabled.
1743   <p>
1744   * @param package the name or URI of the package extension.
1745   <p>
1746   * @return a Boolean
1747   */ public
1748 boolean isSetPackageRequired(String arg0) {
1749    return libsbmlJNI.SBMLDocument_isSetPackageRequired(swigCPtr, this, arg0);
1750  }
1751
1752  
1753/**
1754   * Returns <code>true</code> if the given package extension is one of an ignored
1755   * packages, otherwise returns <code>false.</code>
1756   <p>
1757   * An ignored package is one that is defined to be used in this SBML
1758   * document, but the package is not enabled in this copy of libSBML.
1759   <p>
1760   * @param pkgURI the URI of the package extension.
1761   <p>
1762   * @return a Boolean, <code>true</code> if the package is being ignored and
1763   * <code>false</code> otherwise.
1764   */ public
1765 boolean isIgnoredPackage(String pkgURI) {
1766    return libsbmlJNI.SBMLDocument_isIgnoredPackage(swigCPtr, this, pkgURI);
1767  }
1768
1769  
1770/**
1771   * Returns <code>true</code> if the given package extension is one of an ignored
1772   * packages that has been disabled, otherwise returns <code>false.</code>
1773   <p>
1774   * An ignored package is one that is defined to be used in this SBML
1775   * document, but the package is not enabled in this copy of libSBML.
1776   * It may have been disabled to avoid reproducing the package
1777   * information when writing out the file.
1778   <p>
1779   * @param pkgURI the URI of the package extension.
1780   <p>
1781   * @return a Boolean, <code>true</code> if the package is being ignored and
1782   * <code>false</code> otherwise.
1783   */ public
1784 boolean isDisabledIgnoredPackage(String pkgURI) {
1785    return libsbmlJNI.SBMLDocument_isDisabledIgnoredPackage(swigCPtr, this, pkgURI);
1786  }
1787
1788  
1789/**
1790   * Sets the value of the <code>required</code> attribute for the given
1791   * package.
1792   <p>
1793   * @note The name of package must not be given if the package is not
1794   * enabled.
1795   <p>
1796   * @param package the name or URI of the package extension.
1797   * @param flag a Boolean value.
1798   <p>
1799   * <p>
1800 * @return integer value indicating success/failure of the
1801 * function.   The possible values
1802 * returned by this function are:
1803   * <ul>
1804   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1805   * <li> {@link libsbmlConstants#LIBSBML_PKG_UNKNOWN_VERSION LIBSBML_PKG_UNKNOWN_VERSION}
1806   *
1807   * </ul> <p>
1808   * @deprecated <div class='deprecated'>Replaced in libSBML 5.2.0 by
1809   * setPackageRequired(String, boolean)
1810   </div>
1811   * */ public
1812 int setPkgRequired(String arg0, boolean flag) {
1813    return libsbmlJNI.SBMLDocument_setPkgRequired(swigCPtr, this, arg0, flag);
1814  }
1815
1816  
1817/**
1818   * Returns the <code>required</code> attribute of the given package
1819   * extension.
1820   <p>
1821   * @note The name of package must not be given if the package is not
1822   * enabled.
1823   <p>
1824   * @param package the name or URI of the package extension.
1825   <p>
1826   * @return a Boolean value indicating whether the package is flagged as
1827   * being required in this SBML document.
1828   <p>
1829   * @deprecated <div class='deprecated'>Replaced in libSBML 5.2.0 by
1830   * getPackageRequired(String)
1831   </div>
1832   * */ public
1833 boolean getPkgRequired(String arg0) {
1834    return libsbmlJNI.SBMLDocument_getPkgRequired(swigCPtr, this, arg0);
1835  }
1836
1837  
1838/**
1839   * Returns <code>true</code> if the required attribute of the given package extension
1840   * is defined, otherwise returns <code>false.</code>
1841   <p>
1842   * @note The name of package must not be given if the package is not
1843   * enabled.
1844   <p>
1845   * @param package the name or URI of the package extension.
1846   <p>
1847   * @return a Boolean value.
1848   <p>
1849   * @deprecated <div class='deprecated'>Replaced in libSBML 5.2.0 by
1850   * isSetPackageRequired(String)
1851   </div>
1852   * */ public
1853 boolean isSetPkgRequired(String arg0) {
1854    return libsbmlJNI.SBMLDocument_isSetPkgRequired(swigCPtr, this, arg0);
1855  }
1856
1857  
1858/**
1859   * Returns <code>true</code> if the given package extension is one of ignored
1860   * packages, otherwise returns <code>false.</code>
1861   <p>
1862   * An ignored package is one that is defined to be used in this SBML
1863   * document, but the package is not enabled in this copy of libSBML.
1864   <p>
1865   * @param pkgURI the URI of the package extension.
1866   <p>
1867   * @return a boolean
1868   <p>
1869   * @deprecated <div class='deprecated'>Replaced in libSBML 5.2.0 by
1870   * isIgnoredPackage(String)
1871   </div>
1872   * */ public
1873 boolean isIgnoredPkg(String pkgURI) {
1874    return libsbmlJNI.SBMLDocument_isIgnoredPkg(swigCPtr, this, pkgURI);
1875  }
1876
1877  
1878/** * @internal */ public
1879 short getApplicableValidators() {
1880    return libsbmlJNI.SBMLDocument_getApplicableValidators(swigCPtr, this);
1881  }
1882
1883  
1884/** * @internal */ public
1885 short getConversionValidators() {
1886    return libsbmlJNI.SBMLDocument_getConversionValidators(swigCPtr, this);
1887  }
1888
1889  
1890/** * @internal */ public
1891 void setApplicableValidators(short appl) {
1892    libsbmlJNI.SBMLDocument_setApplicableValidators(swigCPtr, this, appl);
1893  }
1894
1895  
1896/** * @internal */ public
1897 void setConversionValidators(short appl) {
1898    libsbmlJNI.SBMLDocument_setConversionValidators(swigCPtr, this, appl);
1899  }
1900
1901  
1902/** * @internal */ public
1903 long getNumValidators() {
1904    return libsbmlJNI.SBMLDocument_getNumValidators(swigCPtr, this);
1905  }
1906
1907  
1908/** * @internal */ public
1909 int clearValidators() {
1910    return libsbmlJNI.SBMLDocument_clearValidators(swigCPtr, this);
1911  }
1912
1913  
1914/** * @internal */ public
1915 int addValidator(SBMLValidator validator) {
1916    return libsbmlJNI.SBMLDocument_addValidator(swigCPtr, this, SBMLValidator.getCPtr(validator), validator);
1917  }
1918
1919  
1920/** * @internal */ public
1921 SBMLValidator getValidator(long index) {
1922    long cPtr = libsbmlJNI.SBMLDocument_getValidator(swigCPtr, this, index);
1923    return (cPtr == 0) ? null : new SBMLValidator(cPtr, false);
1924  }
1925
1926  
1927/** * @internal */ public
1928 int addUnknownPackageRequired(String pkgURI, String prefix, boolean flag) {
1929    return libsbmlJNI.SBMLDocument_addUnknownPackageRequired(swigCPtr, this, pkgURI, prefix, flag);
1930  }
1931
1932  
1933/** * @internal */ public
1934 boolean hasUnknownPackage(String pkgURI) {
1935    return libsbmlJNI.SBMLDocument_hasUnknownPackage(swigCPtr, this, pkgURI);
1936  }
1937
1938  
1939/** * @internal */ public
1940 int getNumUnknownPackages() {
1941    return libsbmlJNI.SBMLDocument_getNumUnknownPackages(swigCPtr, this);
1942  }
1943
1944  
1945/** * @internal */ public
1946 String getUnknownPackageURI(int index) {
1947    return libsbmlJNI.SBMLDocument_getUnknownPackageURI(swigCPtr, this, index);
1948  }
1949
1950  
1951/** * @internal */ public
1952 String getUnknownPackagePrefix(int index) {
1953    return libsbmlJNI.SBMLDocument_getUnknownPackagePrefix(swigCPtr, this, index);
1954  }
1955
1956}