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  *  An SBML compartment, where species are located.
13  <p>
14  * A compartment in SBML represents a bounded space in which species are
15  * located.  Compartments do not necessarily have to correspond to actual
16  * structures inside or outside of a biological cell.
17  <p>
18  * It is important to note that although compartments are optional in the
19  * overall definition of {@link Model}, every species in an SBML model must be
20  * located in a compartment.  This in turn means that if a model defines
21  * any species, the model must also define at least one compartment.  The
22  * reason is simply that species represent physical things, and therefore
23  * must exist <em>somewhere</em>.  Compartments represent the <em>somewhere</em>.
24  <p>
25  * {@link Compartment} has one required attribute, 'id', to give the compartment a
26  * unique identifier by which other parts of an SBML model definition can
27  * refer to it.  A compartment can also have an optional 'name' attribute
28  * of type <code>string.</code>  Identifiers and names must be used according to the
29  * guidelines described in the SBML specifications.
30  <p>
31  * {@link Compartment} also has an optional attribute 'spatialDimensions' that is
32  * used to indicate the number of spatial dimensions possessed by the
33  * compartment.  Most modeling scenarios involve compartments with integer
34  * values of 'spatialDimensions' of <code>3</code> (i.e., a three-dimensional
35  * compartment, which is to say, a volume), or 2 (a two-dimensional
36  * compartment, a surface), or <code>1</code> (a one-dimensional compartment, a
37  * line).  In SBML Level&nbsp;3, the type of this attribute is <code>double</code>,
38  * there are no restrictions on the permitted values of the
39  * 'spatialDimensions' attribute, and there are no default values.  In SBML
40  * Level&nbsp;2, the value must be a positive <code>integer</code>, and the default
41  * value is <code>3</code>; the permissible values in SBML Level&nbsp;2 are <code>3</code>,
42  * <code>2</code>, <code>1</code>, and <code>0</code> (for a point).
43  <p>
44  * Another optional attribute on {@link Compartment} is 'size', representing the
45  * <em>initial</em> total size of that compartment in the model.  The 'size' attribute
46  * must be a floating-point value and may represent a volume (if the
47  * compartment is a three-dimensional one), or an area (if the compartment is
48  * two-dimensional), or a length (if the compartment is one-dimensional).
49  * There is no default value of compartment size in SBML Level&nbsp;2 or
50  * Level&nbsp;3.  In particular, a missing 'size' value <em>does not imply
51  * that the compartment size is 1</em>.  (This is unlike the definition of
52  * compartment 'volume' in SBML Level&nbsp;1.)  When the compartment's
53  * 'spatialDimensions' attribute does not have a value of <code>0</code>, a missing
54  * value of 'size' for a given compartment signifies that the value either is
55  * unknown, or to be obtained from an external source, or determined by an
56  * {@link InitialAssignment}, {@link AssignmentRule}, {@link AlgebraicRule} or {@link RateRule}
57  * object elsewhere in the model.  In SBML
58  * Level&nbsp;2, there are additional special requirements on the values of
59  * 'size'; we discuss them in a <a href='#comp-l2'>separate section
60  * below</a>.
61  <p>
62  * The units associated with a compartment's 'size' attribute value may be
63  * set using the optional attribute 'units'.  The rules for setting and
64  * using compartment size units differ between SBML Level&nbsp;2 and
65  * Level&nbsp;3, and are discussed separately below.
66  <p>
67  * Finally, the {@link Compartment} attribute named 'constant' is used to
68  * indicate whether the compartment's size stays constant after simulation
69  * begins.  A value of <code>true</code> indicates the compartment's 'size' cannot be
70  * changed by any other construct except {@link InitialAssignment}; a value of
71  * <code>false</code> indicates the compartment's 'size' can be changed by other
72  * constructs in SBML.  In SBML Level&nbsp;2, there is an additional
73  * explicit restriction that if 'spatialDimensions'=<code>'0'</code>, the value
74  * cannot be changed by {@link InitialAssignment} either.  Further, in
75  * Level&nbsp;2, 'constant' is optional, and has a default value of <code>true.</code>  In SBML
76  * Level&nbsp;3, there is no default value for the 'constant' attribute,
77  * and it is required.
78  <p>
79  * <h2>Additional considerations in SBML Level&nbsp;2</h2>
80  <p>
81  * In SBML Level&nbsp;2, the default units of compartment size, and the kinds
82  * of units allowed as values of the attribute 'units', interact with the
83  * number of spatial dimensions of the compartment.  The value of the 'units'
84  * attribute of a {@link Compartment} object must
85  * be one of the base units (see {@link Unit}), or the predefined unit identifiers
86  * <code>volume</code>, <code>area</code>, <code>length</code> or <code>dimensionless</code>, or a new unit defined by a
87  * {@link UnitDefinition} object in the enclosing
88  * {@link Model}, subject to the restrictions detailed in the following table:
89  <p>
90  * <table border='0' class='centered text-table width80 normal-font alt-row-colors'
91  *        style='padding-bottom: 0.5em'>
92  * <caption class='top-caption'>Restrictions on values permitted for
93  * compartment <code>size</code> and <code>units</code> attributes.</caption>
94  *  <tr>
95  *      <th align='left' valign='bottom'>
96  *        Value of<br><code>spatialDimensions</code>
97  *      </th>
98  *      <th align='left' valign='bottom'>
99  *        <code>size</code><br>allowed?
100  *      </th>
101  *      <th align='left' valign='bottom'>
102  *        <code>units</code><br>allowed?
103  *      </th>
104  *      <th align='left' valign='bottom'>
105  * 	  Allowable kinds of units
106  *      </th>
107  *      <th align='left' valign='bottom'>
108  * 	  Default value of attribute <code>units</code>
109  *      </th>
110  *  </tr>
111  *  <tr>
112  *      <td><code>3</code></td>
113  *      <td>yes</td>
114  *      <td>yes</td>
115  *      <td>units of volume, or <code>dimensionless</code></td>
116  *      <td><code>volume</code></td>
117  *  </tr>
118  *  <tr>
119  *      <td><code>2</code></td>
120  *      <td>yes</td>
121  *      <td>yes</td>
122  *      <td>units of area, or <code>dimensionless</code></td>
123  *      <td><code>area</code></td>
124  *  </tr>
125  *  <tr>
126  *      <td><code>1</code></td>
127  *      <td>yes</td>
128  *      <td>yes</td>
129  *      <td>units of length, or <code>dimensionless</code></td>
130  *      <td><code>length</code></td>
131  *  </tr>
132  *  <tr>
133  *      <td><code>0</code></td>
134  *      <td>no</td>
135  *      <td>no</td>
136  *      <td>(no units allowed)</td>
137  *      <td></td>
138  *  </tr>
139  *  </tr>
140  * </table>
141  <p>
142  * In SBML Level&nbsp;2, the units of the compartment size, as defined by the
143  * 'units' attribute or (if 'units' is not set) the default value listed in
144  * the table above, are used in the following ways when the compartment has
145  * a 'spatialDimensions' value greater than <code>0:</code>
146  * <ul>
147  * <li> The value of the 'units' attribute is used as the units of the
148  * compartment identifier when the identifier appears as a numerical
149  * quantity in a mathematical formula expressed in MathML.
150  <p>
151  * <li> The <code>math</code> element of an {@link AssignmentRule} or {@link InitialAssignment}
152  * referring to this compartment <em>must</em> (in Level&nbsp;2 Versions&nbsp;1-3)
153  * or <em>should</em> (in Level&nbsp;2 Version 4) have identical units.
154  <p>
155  * <li> In {@link RateRule} objects that set the rate of change of the compartment's
156  * size, the units of the rule's <code>math</code> element <em>must</em> (in Level&nbsp;2
157  * Versions&nbsp;1&ndash;3) or <em>should</em> (in Level&nbsp;2 Version 4) be identical to the
158  * compartment's units (whether defined by the 'units' attribute or by taking the
159  * default value from the {@link Model}) divided by the default <em>time</em> units.
160  * (In other words, the units for the rate of change of compartment size
161  * are <em>compartment size</em>/<em>time</em> units.
162  <p>
163  * <li> When a {@link Species} is to be treated in terms of concentrations or
164  * density, the units of the spatial size portion of the concentration
165  * value (i.e., the denominator in the units formula <em>substance</em>/
166  * <em>size</em>) are those indicated by the value of the 'units' attribute on the
167  * compartment in which the species is located.
168  * </ul>
169  <p>
170  * Compartments with 'spatialDimensions'=<code>0</code> require special treatment in
171  * this framework.  As implied above, the 'size' attribute must not have a
172  * value on an SBML Level&nbsp;2 {@link Compartment}
173  * object if the 'spatialDimensions'
174  * attribute has a value of <code>0.</code>  An additional related restriction is that
175  * the 'constant' attribute must default to or be set to <code>true</code> if the value
176  * of the 'spatialDimensions' attribute is <code>0</code>, because a zero-dimensional
177  * compartment cannot ever have a size.
178  <p>
179  * If a compartment has no size or dimensional units, how should such a
180  * compartment's identifier be interpreted when it appears in mathematical
181  * formulas?  The answer is that such a compartment's identifier should not
182  * appear in mathematical formulas in the first place&mdash;it has no
183  * value, and its value cannot change.  Note also that a zero-dimensional
184  * compartment is a point, and species located at points can only be
185  * described in terms of amounts, not spatially-dependent measures such as
186  * concentration.  Since SBML {@link KineticLaw} formulas are already in terms of
187  * <em>substance</em>/<em>time</em> and not (say) <em>concentration</em>/<em>time</em>, volume
188  * or other factors in principle are not needed for species located in
189  * zero-dimensional compartments.
190  <p>
191  * Finally, in SBML Level&nbsp;2 Versions 2&ndash;4, each compartment in a
192  * model may optionally be designated as belonging to a particular
193  * compartment <em>type</em>.  The optional attribute 'compartmentType' is used
194  * identify the compartment type represented by the {@link Compartment} structure.
195  * The 'compartmentType' attribute's value must be the identifier of a
196  * {@link CompartmentType} instance defined in the model.  If the 'compartmentType'
197  * attribute is not present on a particular compartment definition, a
198  * unique virtual compartment type is assumed for that compartment, and no
199  * other compartment can belong to that compartment type.  The values of
200  * 'compartmentType' attributes on compartments have no effect on the
201  * numerical interpretation of a model.  Simulators and other numerical
202  * analysis software may ignore 'compartmentType' attributes.  The
203  * 'compartmentType' attribute and the {@link CompartmentType}
204  * class of objects are
205  * not present in SBML Level&nbsp;3 Core nor in SBML Level&nbsp;1.
206  <p>
207  * <h2>Additional considerations in SBML Level&nbsp;3</h2>
208  <p>
209  * One difference between SBML Level&nbsp;3 and lower Levels of SBML is
210  * that there are no restrictions on the permissible values of the
211  * 'spatialDimensions' attribute, and there is no default value defined for
212  * the attribute.  The value of 'spatialDimensions' does not have to be an
213  * integer, either; this is to allow for the possibility of representing
214  * structures with fractal dimensions.
215  <p>
216  * The number of spatial dimensions possessed by a compartment cannot enter
217  * into mathematical formulas, and therefore cannot directly alter the
218  * numerical interpretation of a model.  However, the value of
219  * 'spatialDimensions' <em>does</em> affect the interpretation of the units
220  * associated with a compartment's size.  Specifically, the value of
221  * 'spatialDimensions' is used to select among the {@link Model} attributes
222  * 'volumeUnits', 'areaUnits' and 'lengthUnits' when a {@link Compartment}
223  * structure does not define a value for its
224  * 'units' attribute.
225  <p>
226  * The 'units' attribute may be left unspecified for a given compartment in a
227  * model; in that case, the compartment inherits the unit of measurement
228  * specified by one of the attributes on the enclosing {@link Model}
229  * object instance.  The applicable
230  * attribute on {@link Model} depends on the value of the compartment's
231  * 'spatialDimensions' attribute; the relationship is shown in the table
232  * below.  If the {@link Model} object does not
233  * define the relevant attribute ('volumeUnits', 'areaUnits' or
234  * 'lengthUnits') for a given 'spatialDimensions' value, the unit associated
235  * with that {@link Compartment} object's size is
236  * undefined.  If a given {@link Compartment}'s 'units' are left unset and
237  * the 'spatialDimensions' either has a value other than <code>1</code>, <code>2</code>, or
238  * <code>3</code> or is left unset itself (as it has no default value),
239  * then no unit can be chosen from among the {@link Model}'s 'volumeUnits',
240  * 'areaUnits' or 'lengthUnits' attributes (even if the {@link Model} instance
241  * provides values for those attributes), because there is no basis to select
242  * between them.
243  * Leaving the units of compartments' sizes undefined in an SBML model does
244  * not render the model invalid; however, as a matter of best practice, we
245  * strongly recommend that all models specify the units of measurement for
246  * all compartment sizes.
247  <p>
248  * <table border='0' class='centered text-table width80 normal-font alt-row-colors'
249  *        style='padding-bottom: 0.5em'>
250  * <caption class='top-caption'>Interpretation of the {@link Compartment} 'units' attribute.</caption>
251  *  <tr>
252  *      <th align='left' valign='bottom'>
253  *        Value of attribute<br>'spatialDimensions'
254  *      </th>
255  *      <th align='left' valign='bottom'>
256  *        Attribute of {@link Model} used<br>for inheriting the unit
257  *      </th>
258  *      <th align='left' valign='bottom'>
259  *        Recommended candidate units
260  *      </th>
261  *  </tr>
262  *  <tr>
263  *      <td><code>3</code></td>
264  *      <td>&quot;volumeUnits&quot;</td>
265  *      <td>units of volume, or <code>dimensionless</code></td>
266  *  </tr>
267  *  <tr>
268  *      <td><code>2</code></td>
269  *      <td>&quot;areaUnits&quot;</td>
270  *      <td>units of area, or <code>dimensionless</code></td>
271  *  </tr>
272  *  <tr>
273  *      <td><code>1</code></td>
274  *      <td>&quot;lengthUnits&quot;</td>
275  *      <td>units of length, or <code>dimensionless</code></td>
276  *  </tr>
277  *  <tr>
278  *      <td><em>other</em></td>
279  *      <td><em>no units inherited</em></td>
280  *      <td><em>no specific recommendations</em></td>
281  *  </tr>
282  *  </tr>
283  * </table>
284  <p>
285  * The unit of measurement associated with a compartment's size, as defined
286  * by the 'units' attribute or (if 'units' is not set) the inherited value
287  * from {@link Model} according to the table above, is used in the following ways:
288  <p>
289  * <ul>
290  <p>
291  * <li> When the identifier of the compartment appears as a numerical
292  * quantity in a mathematical formula expressed in MathML, it represents
293  * the size of the compartment, and the unit associated with the size is
294  * the value of the 'units' attribute.
295  <p>
296  * <li> When a {@link Species} is to be treated in terms of concentrations or
297  * density, the unit associated with the spatial size portion of the
298  * concentration value (i.e., the denominator in the formula
299  * <em>amount</em>/<em>size</em>) is specified by the value of the 'units'
300  * attribute on the compartment in which the species is located.
301  <p>
302  * <li> The 'math' elements of {@link AssignmentRule}, {@link InitialAssignment} and
303  * {@link EventAssignment} objects setting the
304  * value of the compartment size should all have the same units as the unit
305  * associated with the compartment's size.
306  <p>
307  * <li> In a {@link RateRule} object that defines a
308  * rate of change for a compartment's size, the unit of the rule's 'math'
309  * element should be identical to the compartment's 'units' attribute divided
310  * by the model-wide unit of <em>time</em>.  (In other words, {<em>unit of
311  * compartment size</em>}/{<em>unit of time</em>}.)
312  <p>
313  * </ul>
314  <p>
315  * <h2>Other aspects of {@link Compartment}</h2>
316  <p>
317  * In SBML Level&nbsp;1 and Level&nbsp;2, {@link Compartment} has an optional
318  * attribute named 'outside', whose value can be the identifier of another
319  * {@link Compartment} object defined in the
320  * enclosing {@link Model} object.  Doing so means
321  * that the other compartment contains it or is outside of it.  This enables
322  * the representation of simple topological relationships between
323  * compartments, for those simulation systems that can make use of the
324  * information (e.g., for drawing simple diagrams of compartments).  It is
325  * worth noting that in SBML, there is no relationship between compartment
326  * sizes when compartment positioning is expressed using the 'outside'
327  * attribute.  The size of a given compartment does not in any sense include
328  * the sizes of other compartments having it as the value of their 'outside'
329  * attributes.  In other words, if a compartment <em>B</em> has the identifier of
330  * compartment <em>A</em> as its 'outside' attribute value, the size of <em>A</em> does
331  * not include the size of <em>B</em>.  The compartment sizes are separate.
332  <p>
333  * In Level&nbsp;2, there are two restrictions on the 'outside' attribute.
334  * First, because a compartment with 'spatialDimensions' of <code>0</code> has no
335  * size, such a compartment cannot act as the container of any other
336  * compartment <em>except</em> compartments that <em>also</em> have
337  * 'spatialDimensions' values of <code>0.</code>  Second, the directed graph formed
338  * by representing {@link Compartment} structures as vertexes and the 'outside'
339  * attribute values as edges must be acyclic.  The latter condition is
340  * imposed to prevent a compartment from being contained inside itself.  In
341  * the absence of a value for 'outside', compartment definitions in SBML
342  * Level&nbsp;2 do not have any implied spatial relationships between each
343  * other.
344  */
345 
346 public class Compartment extends SBase {
347    private long swigCPtr;
348 
Compartment(long cPtr, boolean cMemoryOwn)349    protected Compartment(long cPtr, boolean cMemoryOwn)
350    {
351      super(libsbmlJNI.Compartment_SWIGUpcast(cPtr), cMemoryOwn);
352      swigCPtr = cPtr;
353    }
354 
getCPtr(Compartment obj)355    protected static long getCPtr(Compartment obj)
356    {
357      return (obj == null) ? 0 : obj.swigCPtr;
358    }
359 
getCPtrAndDisown(Compartment obj)360    protected static long getCPtrAndDisown (Compartment obj)
361    {
362      long ptr = 0;
363 
364      if (obj != null)
365      {
366        ptr             = obj.swigCPtr;
367        obj.swigCMemOwn = false;
368      }
369 
370      return ptr;
371    }
372 
373   @SuppressWarnings("deprecation")
finalize()374   protected void finalize() {
375     delete();
376   }
377 
delete()378   public synchronized void delete() {
379     if (swigCPtr != 0) {
380       if (swigCMemOwn) {
381         swigCMemOwn = false;
382         libsbmlJNI.delete_Compartment(swigCPtr);
383       }
384       swigCPtr = 0;
385     }
386     super.delete();
387   }
388 
389 
390 /**
391    * Creates a new {@link Compartment} object using the given SBML <code>level</code> and
392    * <code>version</code> values.
393    <p>
394    * @param level a long integer, the SBML Level to assign to this {@link Compartment}.
395    <p>
396    * @param version a long integer, the SBML Version to assign to this
397    * {@link Compartment}.
398    <p>
399    * <p>
400  * @throws SBMLConstructorException
401  * Thrown if the given <code>level</code> and <code>version</code> combination are invalid
402  * or if this object is incompatible with the given level and version.
403    <p>
404    * <p>
405  * @note Attempting to add an object to an {@link SBMLDocument} having a different
406  * combination of SBML Level, Version and XML namespaces than the object
407  * itself will result in an error at the time a caller attempts to make the
408  * addition.  A parent object must have compatible Level, Version and XML
409  * namespaces.  (Strictly speaking, a parent may also have more XML
410  * namespaces than a child, but the reverse is not permitted.)  The
411  * restriction is necessary to ensure that an SBML model has a consistent
412  * overall structure.  This requires callers to manage their objects
413  * carefully, but the benefit is increased flexibility in how models can be
414  * created by permitting callers to create objects bottom-up if desired.  In
415  * situations where objects are not yet attached to parents (e.g.,
416  * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
417  * libSBML determine such things as whether it is valid to assign a
418  * particular value to an attribute.
419    */ public
Compartment(long level, long version)420  Compartment(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
421     this(libsbmlJNI.new_Compartment__SWIG_0(level, version), true);
422   }
423 
424 
425 /**
426    * Creates a new {@link Compartment} object using the given {@link SBMLNamespaces} object
427    * <code>sbmlns</code>.
428    <p>
429    * <p>
430  * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces
431  * information.  It is used to communicate the SBML Level, Version, and (in
432  * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
433  * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an
434  * {@link SBMLNamespaces} object somewhere in a program once, then hand that object
435  * as needed to object constructors that accept {@link SBMLNamespaces} as arguments.
436    <p>
437    * It is worth emphasizing that although this constructor does not take an
438    * identifier argument, in SBML Level&nbsp;2 and beyond, the 'id'
439    * (identifier) attribute of a {@link Compartment} object is required to have a
440    * value.  Thus, callers are cautioned to assign a value after calling this
441    * constructor.  Setting the identifier can be accomplished using the
442    * method {@link Compartment#setId(String id)}.
443    <p>
444    * @param sbmlns an {@link SBMLNamespaces} object.
445    <p>
446    * <p>
447  * @throws SBMLConstructorException
448  * Thrown if the given <code>sbmlns</code> is inconsistent or incompatible
449  * with this object.
450    <p>
451    * <p>
452  * @note Attempting to add an object to an {@link SBMLDocument} having a different
453  * combination of SBML Level, Version and XML namespaces than the object
454  * itself will result in an error at the time a caller attempts to make the
455  * addition.  A parent object must have compatible Level, Version and XML
456  * namespaces.  (Strictly speaking, a parent may also have more XML
457  * namespaces than a child, but the reverse is not permitted.)  The
458  * restriction is necessary to ensure that an SBML model has a consistent
459  * overall structure.  This requires callers to manage their objects
460  * carefully, but the benefit is increased flexibility in how models can be
461  * created by permitting callers to create objects bottom-up if desired.  In
462  * situations where objects are not yet attached to parents (e.g.,
463  * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
464  * libSBML determine such things as whether it is valid to assign a
465  * particular value to an attribute.
466    */ public
Compartment(SBMLNamespaces sbmlns)467  Compartment(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException {
468     this(libsbmlJNI.new_Compartment__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true);
469   }
470 
471 
472 /**
473    * Copy constructor.
474    <p>
475    * This creates a copy of a {@link Compartment} object.
476    <p>
477    * @param orig the {@link Compartment} instance to copy.
478    */ public
Compartment(Compartment orig)479  Compartment(Compartment orig) throws org.sbml.libsbml.SBMLConstructorException {
480     this(libsbmlJNI.new_Compartment__SWIG_2(Compartment.getCPtr(orig), orig), true);
481   }
482 
483 
484 /**
485    * Creates and returns a deep copy of this {@link Compartment} object.
486    <p>
487    * @return the (deep) copy of this {@link Compartment} object.
488    */ public
cloneObject()489  Compartment cloneObject() {
490     long cPtr = libsbmlJNI.Compartment_cloneObject(swigCPtr, this);
491     return (cPtr == 0) ? null : new Compartment(cPtr, true);
492   }
493 
494 
495 /**
496    * Initializes the fields of this {@link Compartment} object to 'typical' default
497    * values.
498    <p>
499    * The SBML {@link Compartment} component has slightly different aspects and
500    * default attribute values in different SBML Levels and Versions.
501    * This method sets the values to certain common defaults, based
502    * mostly on what they are in SBML Level&nbsp;2.  Specifically:
503    <p>
504    * <ul>
505    * <li> Sets attribute 'spatialDimensions' to <code>3</code>
506    * <li> Sets attribute 'constant' to <code>true</code>
507    * <li> (Applies to Level&nbsp;1 models only) Sets attribute 'volume' to <code>1.0</code>
508    * <li> (Applies to Level&nbsp;3 models only) Sets attribute 'units' to <code>litre</code>
509    * </ul>
510    */ public
initDefaults()511  void initDefaults() {
512     libsbmlJNI.Compartment_initDefaults(swigCPtr, this);
513   }
514 
515 
516 /**
517    * Returns the value of the 'id' attribute of this {@link Compartment}.
518    <p>
519    * @note Because of the inconsistent behavior of this function with
520    * respect to assignments and rules, it is now recommended to
521    * use the getIdAttribute() function instead.
522    <p>
523    * <p>
524  * The identifier given by an object's 'id' attribute value
525  * is used to identify the object within the SBML model definition.
526  * Other objects can refer to the component using this identifier.  The
527  * data type of 'id' is always <code>SId</code> or a type derived
528  * from that, such as <code>UnitSId</code>, depending on the object in
529  * question.  All data types are defined as follows:
530  * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
531  *   letter .= 'a'..'z','A'..'Z'
532  *   digit  .= '0'..'9'
533  *   idChar .= letter | digit | '_'
534  *   SId    .= ( letter | '_' ) idChar*
535  * </pre>
536  * The characters <code>(</code> and <code>)</code> are used for grouping,
537  * the character <code>*</code> 'zero or more times', and the character
538  * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers
539  * is determined by an exact character sequence match; i.e., comparisons must
540  * be performed in a case-sensitive manner.  This applies to all uses of
541  * <code>SId</code>, <code>SIdRef</code>, and derived types.
542  <p>
543  * Users need to be aware of some important API issues that are the result of
544  * the history of SBML and libSBML.  Prior to SBML Level&nbsp;3
545  * Version&nbsp;2, SBML defined 'id' and 'name' attributes on only a subset
546  * of SBML objects.  To simplify the work of programmers, libSBML's API
547  * provided get, set, check, and unset on the {@link SBase} object class itself
548  * instead of on individual subobject classes. This made the
549  * get/set/etc. methods uniformly available on all objects in the libSBML
550  * API.  LibSBML simply returned empty strings or otherwise did not act when
551  * the methods were applied to SBML objects that were not defined by the SBML
552  * specification to have 'id' or 'name' attributes.  Additional complications
553  * arose with the rule and assignment objects: {@link InitialAssignment},
554  * {@link EventAssignment}, {@link AssignmentRule}, and {@link RateRule}.  In early versions of SBML,
555  * the rule object hierarchy was different, and in addition, then as now,
556  * they possess different attributes: 'variable' (for the rules and event
557  * assignments), 'symbol' (for initial assignments), or neither (for
558  * algebraic rules).  Prior to SBML Level&nbsp;3 Version&nbsp;2, getId()
559  * would always return an empty string, and isSetId() would always return
560  * <code>false</code> for objects of these classes.
561  <p>
562  * With the addition of 'id' and 'name' attributes on {@link SBase} in Level&nbsp;3
563  * Version&nbsp;2, it became necessary to introduce a new way to interact
564  * with the attributes more consistently in libSBML to avoid breaking
565  * backward compatibility in the behavior of the original 'id' methods.  For
566  * this reason, libSBML provides four functions (getIdAttribute(),
567  * setIdAttribute(String), isSetIdAttribute(), and
568  * unsetIdAttribute()) that always act on the actual 'id' attribute inherited
569  * from {@link SBase}, regardless of the object's type.  <strong>These new methods
570  * should be used instead of the older getId()/setId()/etc. methods</strong>
571  * unless the old behavior is somehow necessary.  Regardless of the Level and
572  * Version of the SBML, these functions allow client applications to use more
573  * generalized code in some situations (for instance, when manipulating
574  * objects that are all known to have identifiers).  If the object in
575  * question does not posess an 'id' attribute according to the SBML
576  * specification for the Level and Version in use, libSBML will not allow the
577  * identifier to be set, nor will it read or write 'id' attributes for those
578  * objects.
579    <p>
580    * @return the id of this {@link Compartment}.
581    <p>
582    * @see #getIdAttribute()
583    * @see #setIdAttribute(String sid)
584    * @see #isSetIdAttribute()
585    * @see #unsetIdAttribute()
586    */ public
getId()587  String getId() {
588     return libsbmlJNI.Compartment_getId(swigCPtr, this);
589   }
590 
591 
592 /**
593    * Returns the value of the 'name' attribute of this {@link Compartment} object.
594    <p>
595    * <p>
596  * <p>
597  * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
598  * moved to {@link SBase} directly, instead of being defined individually for many
599  * (but not all) objects.  LibSBML has for a long time provided functions
600  * defined on {@link SBase} itself to get, set, and unset those attributes, which
601  * would fail or otherwise return empty strings if executed on any object
602  * for which those attributes were not defined.  Now that all {@link SBase} objects
603  * define those attributes, those functions now succeed for any object with
604  * the appropriate level and version.
605  <p>
606  * The 'name' attribute is
607  * optional and is not intended to be used for cross-referencing purposes
608  * within a model.  Its purpose instead is to provide a human-readable
609  * label for the component.  The data type of 'name' is the type
610  * <code>string</code> defined in XML Schema.  SBML imposes no
611  * restrictions as to the content of 'name' attributes beyond those
612  * restrictions defined by the <code>string</code> type in XML Schema.
613  <p>
614  * The recommended practice for handling 'name' is as follows.  If a
615  * software tool has the capability for displaying the content of 'name'
616  * attributes, it should display this content to the user as a
617  * component's label instead of the component's 'id'.  If the user
618  * interface does not have this capability (e.g., because it cannot
619  * display or use special characters in symbol names), or if the 'name'
620  * attribute is missing on a given component, then the user interface
621  * should display the value of the 'id' attribute instead.  (Script
622  * language interpreters are especially likely to display 'id' instead of
623  * 'name'.)
624  <p>
625  * As a consequence of the above, authors of systems that automatically
626  * generate the values of 'id' attributes should be aware some systems
627  * may display the 'id''s to the user.  Authors therefore may wish to
628  * take some care to have their software create 'id' values that are: (a)
629  * reasonably easy for humans to type and read; and (b) likely to be
630  * meaningful, for example by making the 'id' attribute be an abbreviated
631  * form of the name attribute value.
632  <p>
633  * An additional point worth mentioning is although there are
634  * restrictions on the uniqueness of 'id' values, there are no
635  * restrictions on the uniqueness of 'name' values in a model.  This
636  * allows software applications leeway in assigning component identifiers.
637  <p>
638  * Regardless of the level and version of the SBML, these functions allow
639  * client applications to use more generalized code in some situations
640  * (for instance, when manipulating objects that are all known to have
641  * names).  If the object in question does not posess a 'name' attribute
642  * according to the SBML specification for the Level and Version in use,
643  * libSBML will not allow the name to be set, nor will it read or
644  * write 'name' attributes for those objects.
645  <p>
646  * @return the name of this SBML object, or the empty string if not set or unsettable.
647  <p>
648  * @see #getIdAttribute()
649  * @see #isSetName()
650  * @see #setName(String sid)
651  * @see #unsetName()
652    */ public
getName()653  String getName() {
654     return libsbmlJNI.Compartment_getName(swigCPtr, this);
655   }
656 
657 
658 /**
659    * Get the value of the 'compartmentType' attribute of this {@link Compartment}
660    * object.
661    <p>
662    * @return the value of the 'compartmentType' attribute of this
663    * {@link Compartment} object as a string.
664    <p>
665    * @note The 'compartmentType' attribute is only available in SBML
666    * Level&nbsp;2 Versions&nbsp;2&ndash;4.
667    <p>
668    * @see #isSetCompartmentType()
669    * @see #setCompartmentType(String)
670    * @see #unsetCompartmentType()
671    */ public
getCompartmentType()672  String getCompartmentType() {
673     return libsbmlJNI.Compartment_getCompartmentType(swigCPtr, this);
674   }
675 
676 
677 /**
678    * Get the number of spatial dimensions of this {@link Compartment} object.
679    <p>
680    * @return the value of the 'spatialDimensions' attribute of this
681    * {@link Compartment} object as a long integereger.
682    <p>
683    * <p>
684  * @note In SBML Level&nbsp;3, the data type of the 'spatialDimensions'
685  * attribute is <code>double</code>, whereas in Level&nbsp;2, it is <code>integer.</code>  To
686  * avoid backward compatibility issues, libSBML provides two separate methods
687  * for obtaining the value as either an integer or a type <code>double</code>, for
688  * models where it is relevant.
689    <p>
690    * @see #getSpatialDimensionsAsDouble()
691    * @see #setSpatialDimensions(long)
692    * @see #isSetSpatialDimensions()
693    * @see #unsetSpatialDimensions()
694    */ public
getSpatialDimensions()695  long getSpatialDimensions() {
696     return libsbmlJNI.Compartment_getSpatialDimensions(swigCPtr, this);
697   }
698 
699 
700 /**
701    * Get the number of spatial dimensions of this {@link Compartment} object,
702    * as a double.
703    <p>
704    * @return the value of the 'spatialDimensions' attribute of this
705    * {@link Compartment} object as a double, or <code>NaN</code> if this model is not in SBML
706    * Level&nbsp;3 format.
707    <p>
708    * <p>
709  * @note In SBML Level&nbsp;3, the data type of the 'spatialDimensions'
710  * attribute is <code>double</code>, whereas in Level&nbsp;2, it is <code>integer.</code>  To
711  * avoid backward compatibility issues, libSBML provides two separate methods
712  * for obtaining the value as either an integer or a type <code>double</code>, for
713  * models where it is relevant.
714    <p>
715    * @see #getSpatialDimensions()
716    * @see #setSpatialDimensions(long)
717    * @see #isSetSpatialDimensions()
718    * @see #unsetSpatialDimensions()
719    */ public
getSpatialDimensionsAsDouble()720  double getSpatialDimensionsAsDouble() {
721     return libsbmlJNI.Compartment_getSpatialDimensionsAsDouble(swigCPtr, this);
722   }
723 
724 
725 /**
726    * Get the size of this {@link Compartment} object.
727    <p>
728    * <p>
729  * In SBML Level&nbsp;1, compartments are always three-dimensional
730  * constructs and only have volumes, whereas in SBML Level&nbsp;2 and higher,
731  * compartments may be other than three-dimensional, and therefore the
732  * 'volume' attribute is named 'size' in Level&nbsp;2 and above.  LibSBML
733  * provides both getSize() and getVolume()
734  * for easier support of different SBML Levels.
735    <p>
736    * @return the value of the 'size' attribute ('volume' in Level&nbsp;1) of
737    * this {@link Compartment} object as a floating-point number.
738    <p>
739    * @note This method is identical to
740    * {@link Compartment#getVolume()}.
741    <p>
742    * @see #getVolume()
743    * @see #isSetSize()
744    * @see #setSize(double)
745    * @see #unsetSize()
746    */ public
getSize()747  double getSize() {
748     return libsbmlJNI.Compartment_getSize(swigCPtr, this);
749   }
750 
751 
752 /**
753    * Get the volume of this {@link Compartment} object.
754    <p>
755    * <p>
756  * In SBML Level&nbsp;1, compartments are always three-dimensional
757  * constructs and only have volumes, whereas in SBML Level&nbsp;2 and higher,
758  * compartments may be other than three-dimensional, and therefore the
759  * 'volume' attribute is named 'size' in Level&nbsp;2 and above.  LibSBML
760  * provides both getSize() and getVolume()
761  * for easier support of different SBML Levels.
762    <p>
763    * @return the value of the 'volume' attribute ('size' in Level&nbsp;2) of
764    * this {@link Compartment} object, as a floating-point number.
765    <p>
766    * <p>
767  * @note The attribute 'volume' only exists by that name in SBML
768  * Level&nbsp;1.  In Level&nbsp;2 and above, the equivalent attribute is
769  * named 'size'.  In SBML Level&nbsp;1, a compartment's volume has a default
770  * value (<code>1.0</code>) and therefore methods such as
771  * isSetVolume()
772  * will always return <code>true</code> for a Level&nbsp;1 model.  In Level&nbsp;2, a
773  * compartment's size (the equivalent of SBML Level&nbsp;1's 'volume') is
774  * optional and has no default value, and therefore may or may not be set.
775    <p>
776    * @note This method is identical to
777    * {@link Compartment#getSize()}.
778    <p>
779    * @see #getSize()
780    * @see #isSetVolume()
781    * @see #setVolume(double)
782    * @see #unsetVolume()
783    */ public
getVolume()784  double getVolume() {
785     return libsbmlJNI.Compartment_getVolume(swigCPtr, this);
786   }
787 
788 
789 /**
790    * Get the units of this {@link Compartment} object's size.
791    <p>
792    * The value of an SBML compartment's 'units' attribute establishes the
793    * unit of measurement associated with the compartment's size.
794    <p>
795    * @return the value of the 'units' attribute of this {@link Compartment} object,
796    * as a string.  An empty string indicates that no units have been assigned
797    * to the value of the size.
798    <p>
799    * <p>
800  * @note There is an important distinction to be made between <em>no units
801  * assigned</em>, and assuming a value without units has any specific unit
802  * such as <code>dimensionless</code>.  In SBML, default units are never
803  * attributed to numbers, and numbers without units are not automatically
804  * assumed to have the unit <code>dimensionless</code>.  Please consult the
805  * relevant SBML specification document for a more in-depth explanation of
806  * this topic and the SBML unit system.
807    <p>
808    * @see #isSetUnits()
809    * @see #setUnits(String)
810    * @see #unsetUnits()
811    */ public
getUnits()812  String getUnits() {
813     return libsbmlJNI.Compartment_getUnits(swigCPtr, this);
814   }
815 
816 
817 /**
818    * Get the identifier, if any, of the {@link Compartment} object that is designated
819    * as being outside of <em>this</em> one.
820    <p>
821    * @return the value of the 'outside' attribute of this {@link Compartment} object.
822    <p>
823    * @note The 'outside' attribute is defined in SBML Level&nbsp;1 and
824    * Level&nbsp;2, but does not exist in SBML Level&nbsp;3.
825    <p>
826    * @see #isSetOutside()
827    * @see #setOutside(String)
828    * @see #unsetOutside()
829    */ public
getOutside()830  String getOutside() {
831     return libsbmlJNI.Compartment_getOutside(swigCPtr, this);
832   }
833 
834 
835 /**
836    * Get the value of the 'constant' attribute of this {@link Compartment} object.
837    <p>
838    * @return <code>true</code> if this {@link Compartment} object's size is flagged as being
839    * constant, <code>false</code> otherwise.
840    <p>
841    * @see #isSetConstant()
842    * @see #setConstant(boolean)
843    */ public
getConstant()844  boolean getConstant() {
845     return libsbmlJNI.Compartment_getConstant(swigCPtr, this);
846   }
847 
848 
849 /**
850    * Predicate returning <code>true</code> if this {@link Compartment} object's 'id' attribute
851    * is set.
852    <p>
853    * <p>
854  * <p>
855  * The identifier given by an object's 'id' attribute value
856  * is used to identify the object within the SBML model definition.
857  * Other objects can refer to the component using this identifier.  The
858  * data type of 'id' is always <code>SId</code> or a type derived
859  * from that, such as <code>UnitSId</code>, depending on the object in
860  * question.  All data types are defined as follows:
861  * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
862  *   letter .= 'a'..'z','A'..'Z'
863  *   digit  .= '0'..'9'
864  *   idChar .= letter | digit | '_'
865  *   SId    .= ( letter | '_' ) idChar*
866  * </pre>
867  * The characters <code>(</code> and <code>)</code> are used for grouping,
868  * the character <code>*</code> 'zero or more times', and the character
869  * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers
870  * is determined by an exact character sequence match; i.e., comparisons must
871  * be performed in a case-sensitive manner.  This applies to all uses of
872  * <code>SId</code>, <code>SIdRef</code>, and derived types.
873  <p>
874  * Users need to be aware of some important API issues that are the result of
875  * the history of SBML and libSBML.  Prior to SBML Level&nbsp;3
876  * Version&nbsp;2, SBML defined 'id' and 'name' attributes on only a subset
877  * of SBML objects.  To simplify the work of programmers, libSBML's API
878  * provided get, set, check, and unset on the {@link SBase} object class itself
879  * instead of on individual subobject classes. This made the
880  * get/set/etc. methods uniformly available on all objects in the libSBML
881  * API.  LibSBML simply returned empty strings or otherwise did not act when
882  * the methods were applied to SBML objects that were not defined by the SBML
883  * specification to have 'id' or 'name' attributes.  Additional complications
884  * arose with the rule and assignment objects: {@link InitialAssignment},
885  * {@link EventAssignment}, {@link AssignmentRule}, and {@link RateRule}.  In early versions of SBML,
886  * the rule object hierarchy was different, and in addition, then as now,
887  * they possess different attributes: 'variable' (for the rules and event
888  * assignments), 'symbol' (for initial assignments), or neither (for
889  * algebraic rules).  Prior to SBML Level&nbsp;3 Version&nbsp;2, getId()
890  * would always return an empty string, and isSetId() would always return
891  * <code>false</code> for objects of these classes.
892  <p>
893  * With the addition of 'id' and 'name' attributes on {@link SBase} in Level&nbsp;3
894  * Version&nbsp;2, it became necessary to introduce a new way to interact
895  * with the attributes more consistently in libSBML to avoid breaking
896  * backward compatibility in the behavior of the original 'id' methods.  For
897  * this reason, libSBML provides four functions (getIdAttribute(),
898  * setIdAttribute(String), isSetIdAttribute(), and
899  * unsetIdAttribute()) that always act on the actual 'id' attribute inherited
900  * from {@link SBase}, regardless of the object's type.  <strong>These new methods
901  * should be used instead of the older getId()/setId()/etc. methods</strong>
902  * unless the old behavior is somehow necessary.  Regardless of the Level and
903  * Version of the SBML, these functions allow client applications to use more
904  * generalized code in some situations (for instance, when manipulating
905  * objects that are all known to have identifiers).  If the object in
906  * question does not posess an 'id' attribute according to the SBML
907  * specification for the Level and Version in use, libSBML will not allow the
908  * identifier to be set, nor will it read or write 'id' attributes for those
909  * objects.
910  <p>
911  * @return <code>true</code> if the 'id' attribute of this SBML object is
912  * set, <code>false</code> otherwise.
913  <p>
914  * @note Because of the inconsistent behavior of this function with
915  * respect to assignments and rules, it is recommended that callers
916  * use isSetIdAttribute() instead.
917  <p>
918  * @see #getIdAttribute()
919  * @see #setIdAttribute(String sid)
920  * @see #unsetIdAttribute()
921  * @see #isSetIdAttribute()
922    */ public
isSetId()923  boolean isSetId() {
924     return libsbmlJNI.Compartment_isSetId(swigCPtr, this);
925   }
926 
927 
928 /**
929    * Predicate returning <code>true</code> if this {@link Compartment} object's 'name'
930    * attribute is set.
931    <p>
932    * <p>
933  * <p>
934  * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
935  * moved to {@link SBase} directly, instead of being defined individually for many
936  * (but not all) objects.  LibSBML has for a long time provided functions
937  * defined on {@link SBase} itself to get, set, and unset those attributes, which
938  * would fail or otherwise return empty strings if executed on any object
939  * for which those attributes were not defined.  Now that all {@link SBase} objects
940  * define those attributes, those functions now succeed for any object with
941  * the appropriate level and version.
942  <p>
943  * The 'name' attribute is
944  * optional and is not intended to be used for cross-referencing purposes
945  * within a model.  Its purpose instead is to provide a human-readable
946  * label for the component.  The data type of 'name' is the type
947  * <code>string</code> defined in XML Schema.  SBML imposes no
948  * restrictions as to the content of 'name' attributes beyond those
949  * restrictions defined by the <code>string</code> type in XML Schema.
950  <p>
951  * The recommended practice for handling 'name' is as follows.  If a
952  * software tool has the capability for displaying the content of 'name'
953  * attributes, it should display this content to the user as a
954  * component's label instead of the component's 'id'.  If the user
955  * interface does not have this capability (e.g., because it cannot
956  * display or use special characters in symbol names), or if the 'name'
957  * attribute is missing on a given component, then the user interface
958  * should display the value of the 'id' attribute instead.  (Script
959  * language interpreters are especially likely to display 'id' instead of
960  * 'name'.)
961  <p>
962  * As a consequence of the above, authors of systems that automatically
963  * generate the values of 'id' attributes should be aware some systems
964  * may display the 'id''s to the user.  Authors therefore may wish to
965  * take some care to have their software create 'id' values that are: (a)
966  * reasonably easy for humans to type and read; and (b) likely to be
967  * meaningful, for example by making the 'id' attribute be an abbreviated
968  * form of the name attribute value.
969  <p>
970  * An additional point worth mentioning is although there are
971  * restrictions on the uniqueness of 'id' values, there are no
972  * restrictions on the uniqueness of 'name' values in a model.  This
973  * allows software applications leeway in assigning component identifiers.
974  <p>
975  * Regardless of the level and version of the SBML, these functions allow
976  * client applications to use more generalized code in some situations
977  * (for instance, when manipulating objects that are all known to have
978  * names).  If the object in question does not posess a 'name' attribute
979  * according to the SBML specification for the Level and Version in use,
980  * libSBML will not allow the name to be set, nor will it read or
981  * write 'name' attributes for those objects.
982  <p>
983  * @return <code>true</code> if the 'name' attribute of this SBML object is
984  * set, <code>false</code> otherwise.
985  <p>
986  * @see #getName()
987  * @see #setName(String sid)
988  * @see #unsetName()
989    */ public
isSetName()990  boolean isSetName() {
991     return libsbmlJNI.Compartment_isSetName(swigCPtr, this);
992   }
993 
994 
995 /**
996    * Predicate returning <code>true</code> if this {@link Compartment} object's
997    * 'compartmentType' attribute is set.
998    <p>
999    * @return <code>true</code> if the 'compartmentType' attribute of this {@link Compartment}
1000    * is set, <code>false</code> otherwise.
1001    <p>
1002    * @note The 'compartmentType' attribute is only available in SBML
1003    * Level&nbsp;2 Versions&nbsp;2&ndash;4.
1004    <p>
1005    * @see #setCompartmentType(String)
1006    * @see #getCompartmentType()
1007    * @see #unsetCompartmentType()
1008    */ public
isSetCompartmentType()1009  boolean isSetCompartmentType() {
1010     return libsbmlJNI.Compartment_isSetCompartmentType(swigCPtr, this);
1011   }
1012 
1013 
1014 /**
1015    * Predicate returning <code>true</code> if this {@link Compartment} object's 'size'
1016    * attribute is set.
1017    <p>
1018    * This method is similar but not identical to
1019    * {@link Compartment#isSetVolume()}.  The latter
1020    * should be used in the context of SBML Level&nbsp;1 models instead of
1021    * {@link Compartment#isSetSize()}
1022    * because {@link Compartment#isSetVolume()}
1023    * performs extra processing to take into account the difference in
1024    * default values between SBML Levels&nbsp;1 and&nbsp;2.
1025    <p>
1026    * @return <code>true</code> if the 'size' attribute ('volume' in Level&nbsp;2) of
1027    * this {@link Compartment} object is set, <code>false</code> otherwise.
1028    <p>
1029    * @see #isSetVolume()
1030    * @see #setSize(double)
1031    * @see #getSize()
1032    * @see #unsetSize()
1033    */ public
isSetSize()1034  boolean isSetSize() {
1035     return libsbmlJNI.Compartment_isSetSize(swigCPtr, this);
1036   }
1037 
1038 
1039 /**
1040    * Predicate returning <code>true</code> if this {@link Compartment} object's 'volume'
1041    * attribute is set.
1042    <p>
1043    * This method is similar but not identical to
1044    * {@link Compartment#isSetSize()}.  The latter
1045    * should not be used in the context of SBML Level&nbsp;1 models because the
1046    * present method performs extra processing to take into account
1047    * the difference in default values between SBML Levels&nbsp;1 and&nbsp;2.
1048    <p>
1049    * @return <code>true</code> if the 'volume' attribute ('size' in Level&nbsp;2 and
1050    * above) of this {@link Compartment} object is set, <code>false</code> otherwise.
1051    <p>
1052    * <p>
1053  * @note The attribute 'volume' only exists by that name in SBML
1054  * Level&nbsp;1.  In Level&nbsp;2 and above, the equivalent attribute is
1055  * named 'size'.  In SBML Level&nbsp;1, a compartment's volume has a default
1056  * value (<code>1.0</code>) and therefore methods such as
1057  * isSetVolume()
1058  * will always return <code>true</code> for a Level&nbsp;1 model.  In Level&nbsp;2, a
1059  * compartment's size (the equivalent of SBML Level&nbsp;1's 'volume') is
1060  * optional and has no default value, and therefore may or may not be set.
1061    <p>
1062    * @see #isSetSize()
1063    * @see #getVolume()
1064    * @see #setVolume(double)
1065    * @see #unsetVolume()
1066    */ public
isSetVolume()1067  boolean isSetVolume() {
1068     return libsbmlJNI.Compartment_isSetVolume(swigCPtr, this);
1069   }
1070 
1071 
1072 /**
1073    * Predicate returning <code>true</code> if this {@link Compartment} object's 'units'
1074    * attribute is set.
1075    <p>
1076    * @return <code>true</code> if the 'units' attribute of this {@link Compartment} object is
1077    * set, <code>false</code> otherwise.
1078    <p>
1079    * <p>
1080  * @note There is an important distinction to be made between <em>no units
1081  * assigned</em>, and assuming a value without units has any specific unit
1082  * such as <code>dimensionless</code>.  In SBML, default units are never
1083  * attributed to numbers, and numbers without units are not automatically
1084  * assumed to have the unit <code>dimensionless</code>.  Please consult the
1085  * relevant SBML specification document for a more in-depth explanation of
1086  * this topic and the SBML unit system.
1087    <p>
1088    * @see #setUnits(String)
1089    * @see #getUnits()
1090    * @see #unsetUnits()
1091    */ public
isSetUnits()1092  boolean isSetUnits() {
1093     return libsbmlJNI.Compartment_isSetUnits(swigCPtr, this);
1094   }
1095 
1096 
1097 /**
1098    * Predicate returning <code>true</code> if this {@link Compartment} object's 'outside'
1099    * attribute is set.
1100    <p>
1101    * @return <code>true</code> if the 'outside' attribute of this {@link Compartment} object is
1102    * set, <code>false</code> otherwise.
1103    <p>
1104    * @note The 'outside' attribute is defined in SBML Level&nbsp;1 and
1105    * Level&nbsp;2, but does not exist in SBML Level&nbsp;3.
1106    <p>
1107    * @see #getOutside()
1108    * @see #setOutside(String)
1109    * @see #unsetOutside()
1110    */ public
isSetOutside()1111  boolean isSetOutside() {
1112     return libsbmlJNI.Compartment_isSetOutside(swigCPtr, this);
1113   }
1114 
1115 
1116 /**
1117    * Predicate returning <code>true</code> if this {@link Compartment} object's
1118    * 'spatialDimensions' attribute is set.
1119    <p>
1120    * @return <code>true</code> if the 'spatialDimensions' attribute of this
1121    * {@link Compartment} object is set, <code>false</code> otherwise.
1122    <p>
1123    * @see #getSpatialDimensions()
1124    * @see #setSpatialDimensions(long)
1125    * @see #unsetSpatialDimensions()
1126    */ public
isSetSpatialDimensions()1127  boolean isSetSpatialDimensions() {
1128     return libsbmlJNI.Compartment_isSetSpatialDimensions(swigCPtr, this);
1129   }
1130 
1131 
1132 /**
1133    * Predicate returning <code>true</code> if this {@link Compartment} object's 'constant'
1134    * attribute is set.
1135    <p>
1136    * @return <code>true</code> if the 'constant' attribute of this {@link Compartment} object is
1137    * set, <code>false</code> otherwise.
1138    <p>
1139    * @see #getConstant()
1140    * @see #setConstant(boolean)
1141    */ public
isSetConstant()1142  boolean isSetConstant() {
1143     return libsbmlJNI.Compartment_isSetConstant(swigCPtr, this);
1144   }
1145 
1146 
1147 /**
1148    * Sets the value of the 'id' attribute of this {@link Compartment} object.
1149    <p>
1150    * The string <code>sid</code> is copied.
1151    <p>
1152    * <p>
1153  * The identifier given by an object's 'id' attribute value
1154  * is used to identify the object within the SBML model definition.
1155  * Other objects can refer to the component using this identifier.  The
1156  * data type of 'id' is always <code>SId</code> or a type derived
1157  * from that, such as <code>UnitSId</code>, depending on the object in
1158  * question.  All data types are defined as follows:
1159  * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
1160  *   letter .= 'a'..'z','A'..'Z'
1161  *   digit  .= '0'..'9'
1162  *   idChar .= letter | digit | '_'
1163  *   SId    .= ( letter | '_' ) idChar*
1164  * </pre>
1165  * The characters <code>(</code> and <code>)</code> are used for grouping,
1166  * the character <code>*</code> 'zero or more times', and the character
1167  * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers
1168  * is determined by an exact character sequence match; i.e., comparisons must
1169  * be performed in a case-sensitive manner.  This applies to all uses of
1170  * <code>SId</code>, <code>SIdRef</code>, and derived types.
1171  <p>
1172  * Users need to be aware of some important API issues that are the result of
1173  * the history of SBML and libSBML.  Prior to SBML Level&nbsp;3
1174  * Version&nbsp;2, SBML defined 'id' and 'name' attributes on only a subset
1175  * of SBML objects.  To simplify the work of programmers, libSBML's API
1176  * provided get, set, check, and unset on the {@link SBase} object class itself
1177  * instead of on individual subobject classes. This made the
1178  * get/set/etc. methods uniformly available on all objects in the libSBML
1179  * API.  LibSBML simply returned empty strings or otherwise did not act when
1180  * the methods were applied to SBML objects that were not defined by the SBML
1181  * specification to have 'id' or 'name' attributes.  Additional complications
1182  * arose with the rule and assignment objects: {@link InitialAssignment},
1183  * {@link EventAssignment}, {@link AssignmentRule}, and {@link RateRule}.  In early versions of SBML,
1184  * the rule object hierarchy was different, and in addition, then as now,
1185  * they possess different attributes: 'variable' (for the rules and event
1186  * assignments), 'symbol' (for initial assignments), or neither (for
1187  * algebraic rules).  Prior to SBML Level&nbsp;3 Version&nbsp;2, getId()
1188  * would always return an empty string, and isSetId() would always return
1189  * <code>false</code> for objects of these classes.
1190  <p>
1191  * With the addition of 'id' and 'name' attributes on {@link SBase} in Level&nbsp;3
1192  * Version&nbsp;2, it became necessary to introduce a new way to interact
1193  * with the attributes more consistently in libSBML to avoid breaking
1194  * backward compatibility in the behavior of the original 'id' methods.  For
1195  * this reason, libSBML provides four functions (getIdAttribute(),
1196  * setIdAttribute(String), isSetIdAttribute(), and
1197  * unsetIdAttribute()) that always act on the actual 'id' attribute inherited
1198  * from {@link SBase}, regardless of the object's type.  <strong>These new methods
1199  * should be used instead of the older getId()/setId()/etc. methods</strong>
1200  * unless the old behavior is somehow necessary.  Regardless of the Level and
1201  * Version of the SBML, these functions allow client applications to use more
1202  * generalized code in some situations (for instance, when manipulating
1203  * objects that are all known to have identifiers).  If the object in
1204  * question does not posess an 'id' attribute according to the SBML
1205  * specification for the Level and Version in use, libSBML will not allow the
1206  * identifier to be set, nor will it read or write 'id' attributes for those
1207  * objects.
1208    <p>
1209    * @param sid the string to use as the identifier of this {@link Compartment} object. If
1210    * the string is <code>null</code>, this method will return
1211    * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}.
1212    <p>
1213    * <p>
1214  * @return integer value indicating success/failure of the
1215  * function.   The possible values
1216  * returned by this function are:
1217    * <ul>
1218    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1219    * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
1220    *
1221    * </ul> <p>
1222    * @see #getId()
1223    * @see #unsetId()
1224    * @see #isSetId()
1225    */ public
setId(String sid)1226  int setId(String sid) {
1227     return libsbmlJNI.Compartment_setId(swigCPtr, this, sid);
1228   }
1229 
1230 
1231 /**
1232    * Sets the value of the 'name' attribute of this {@link Compartment} object.
1233    <p>
1234    * <p>
1235  * The string in <code>name</code> is copied.
1236  <p>
1237  * @param name the new name for the SBML object.
1238  <p>
1239  * <p>
1240  * @return integer value indicating success/failure of the
1241  * function.   The possible values
1242  * returned by this function are:
1243  * <ul>
1244  * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1245  * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
1246  *
1247  * </ul>
1248    */ public
setName(String name)1249  int setName(String name) {
1250     return libsbmlJNI.Compartment_setName(swigCPtr, this, name);
1251   }
1252 
1253 
1254 /**
1255    * Sets the 'compartmentType' attribute of this {@link Compartment} object.
1256    <p>
1257    * @param sid the identifier of a {@link CompartmentType} object defined elsewhere
1258    * in this {@link Model}. If the string is <code>null</code>, this method will return
1259    * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}.
1260    <p>
1261    * <p>
1262  * @return integer value indicating success/failure of the
1263  * function.   The possible values
1264  * returned by this function are:
1265    * <ul>
1266    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1267    * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
1268    * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
1269    *
1270    * </ul> <p>
1271    * @note The 'compartmentType' attribute is only available in SBML
1272    * Level&nbsp;2 Versions&nbsp;2&ndash;4.
1273    <p>
1274    * @see #isSetCompartmentType()
1275    * @see #getCompartmentType()
1276    * @see #unsetCompartmentType()
1277    */ public
setCompartmentType(String sid)1278  int setCompartmentType(String sid) {
1279     return libsbmlJNI.Compartment_setCompartmentType(swigCPtr, this, sid);
1280   }
1281 
1282 
1283 /**
1284    * Sets the 'spatialDimensions' attribute of this {@link Compartment} object.
1285    <p>
1286    * @param value a long integereger indicating the number of dimensions
1287    * of this compartment.
1288    <p>
1289    * <p>
1290  * @return integer value indicating success/failure of the
1291  * function.   The possible values
1292  * returned by this function are:
1293    * <ul>
1294    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1295    * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
1296    * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
1297    *
1298    * </ul> <p>
1299    * @see #getSpatialDimensions()
1300    * @see #isSetSpatialDimensions()
1301    * @see #unsetSpatialDimensions()
1302    */ public
setSpatialDimensions(long value)1303  int setSpatialDimensions(long value) {
1304     return libsbmlJNI.Compartment_setSpatialDimensions__SWIG_0(swigCPtr, this, value);
1305   }
1306 
1307 
1308 /**
1309    * Sets the 'spatialDimensions' attribute of this {@link Compartment} object as a double.
1310    <p>
1311    * @param value a double indicating the number of dimensions
1312    * of this compartment.
1313    <p>
1314    * <p>
1315  * @return integer value indicating success/failure of the
1316  * function.   The possible values
1317  * returned by this function are:
1318    * <ul>
1319    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1320    * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
1321    * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
1322    *
1323    * </ul> <p>
1324    * @see #getSpatialDimensions()
1325    * @see #isSetSpatialDimensions()
1326    * @see #unsetSpatialDimensions()
1327    */ public
setSpatialDimensions(double value)1328  int setSpatialDimensions(double value) {
1329     return libsbmlJNI.Compartment_setSpatialDimensions__SWIG_1(swigCPtr, this, value);
1330   }
1331 
1332 
1333 /**
1334    * Sets the 'size' attribute (or 'volume' in SBML Level&nbsp;1) of this
1335    * {@link Compartment} object.
1336    <p>
1337    * @param value a <code>double</code> representing the size of this compartment
1338    * instance in whatever units are in effect for the compartment.
1339    <p>
1340    * <p>
1341  * @return integer value indicating success/failure of the
1342  * function.   This particular
1343  * function only does one thing irrespective of user input or
1344  * object state, and thus will only return a single value:
1345    * <ul>
1346    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1347    *
1348    * </ul> <p>
1349    * @note This method is identical to
1350    * {@link Compartment#setVolume(double value)}.
1351    <p>
1352    * @see #setVolume(double)
1353    * @see #getSize()
1354    * @see #isSetSize()
1355    * @see #unsetSize()
1356    */ public
setSize(double value)1357  int setSize(double value) {
1358     return libsbmlJNI.Compartment_setSize(swigCPtr, this, value);
1359   }
1360 
1361 
1362 /**
1363    * Sets the 'volume' attribute (or 'size' in SBML Level&nbsp;2) of this
1364    * {@link Compartment} object.
1365    <p>
1366    * This method is identical to
1367    * {@link Compartment#setSize(double value)}
1368    * and is provided for compatibility between SBML Level&nbsp;1 and
1369    * higher Levels of SBML.
1370    <p>
1371    * @param value a <code>double</code> representing the volume of this compartment
1372    * instance in whatever units are in effect for the compartment.
1373    <p>
1374    * <p>
1375  * @return integer value indicating success/failure of the
1376  * function.   This particular
1377  * function only does one thing irrespective of user input or
1378  * object state, and thus will only return a single value:
1379    * <ul>
1380    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1381    *
1382    * </ul> <p>
1383    * <p>
1384  * @note The attribute 'volume' only exists by that name in SBML
1385  * Level&nbsp;1.  In Level&nbsp;2 and above, the equivalent attribute is
1386  * named 'size'.  In SBML Level&nbsp;1, a compartment's volume has a default
1387  * value (<code>1.0</code>) and therefore methods such as
1388  * isSetVolume()
1389  * will always return <code>true</code> for a Level&nbsp;1 model.  In Level&nbsp;2, a
1390  * compartment's size (the equivalent of SBML Level&nbsp;1's 'volume') is
1391  * optional and has no default value, and therefore may or may not be set.
1392    <p>
1393    * @see #setSize(double)
1394    * @see #getVolume()
1395    * @see #isSetVolume()
1396    * @see #unsetVolume()
1397    */ public
setVolume(double value)1398  int setVolume(double value) {
1399     return libsbmlJNI.Compartment_setVolume(swigCPtr, this, value);
1400   }
1401 
1402 
1403 /**
1404    * Sets the 'units' attribute of this {@link Compartment} object.
1405    <p>
1406    * @param sid the identifier of the defined units to use.  If <code>sid</code> is
1407    * <code>null</code>, then this method will return
1408    * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}.
1409    <p>
1410    * <p>
1411  * @return integer value indicating success/failure of the
1412  * function.   The possible values
1413  * returned by this function are:
1414    * <ul>
1415    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1416    * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
1417    *
1418    * </ul> <p>
1419    * @see #isSetUnits()
1420    * @see #getUnits()
1421    * @see #unsetUnits()
1422    */ public
setUnits(String sid)1423  int setUnits(String sid) {
1424     return libsbmlJNI.Compartment_setUnits(swigCPtr, this, sid);
1425   }
1426 
1427 
1428 /**
1429    * Sets the 'outside' attribute of this {@link Compartment} object.
1430    <p>
1431    * @param sid the identifier of a compartment that encloses this one. If
1432    * <code>sid</code> is <code>null</code>, then this method will return
1433    * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}.
1434    <p>
1435    * <p>
1436  * @return integer value indicating success/failure of the
1437  * function.   The possible values
1438  * returned by this function are:
1439    * <ul>
1440    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1441    * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
1442    *
1443    * </ul> <p>
1444    * @note The 'outside' attribute is defined in SBML Level&nbsp;1 and
1445    * Level&nbsp;2, but does not exist in SBML Level&nbsp;3.
1446    <p>
1447    * @see #isSetOutside()
1448    * @see #getOutside()
1449    * @see #unsetOutside()
1450    */ public
setOutside(String sid)1451  int setOutside(String sid) {
1452     return libsbmlJNI.Compartment_setOutside(swigCPtr, this, sid);
1453   }
1454 
1455 
1456 /**
1457    * Sets the value of the 'constant' attribute of this {@link Compartment} object.
1458    <p>
1459    * @param value a boolean indicating whether the size/volume of this
1460    * compartment should be considered constant (<code>true</code>) or variable
1461    * (<code>false</code>).
1462    <p>
1463    * <p>
1464  * @return integer value indicating success/failure of the
1465  * function.   The possible values
1466  * returned by this function are:
1467    * <ul>
1468    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1469    * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
1470    *
1471    * </ul> <p>
1472    * @see #isSetConstant()
1473    * @see #getConstant()
1474    */ public
setConstant(boolean value)1475  int setConstant(boolean value) {
1476     return libsbmlJNI.Compartment_setConstant(swigCPtr, this, value);
1477   }
1478 
1479 
1480 /**
1481    * <p>
1482  * Replaces all uses of a given <code>SIdRef</code> type attribute value with another
1483  * value.
1484  <p>
1485  * <p>
1486  * In SBML, object identifiers are of a data type called <code>SId</code>.
1487  * In SBML Level&nbsp;3, an explicit data type called <code>SIdRef</code> was
1488  * introduced for attribute values that refer to <code>SId</code> values; in
1489  * previous Levels of SBML, this data type did not exist and attributes were
1490  * simply described to as 'referring to an identifier', but the effective
1491  * data type was the same as <code>SIdRef</code> in Level&nbsp;3.  These and
1492  * other methods of libSBML refer to the type <code>SIdRef</code> for all
1493  * Levels of SBML, even if the corresponding SBML specification did not
1494  * explicitly name the data type.
1495  <p>
1496  * This method works by looking at all attributes and (if appropriate)
1497  * mathematical formulas in MathML content, comparing the referenced
1498  * identifiers to the value of <code>oldid</code>.  If any matches are found, the
1499  * matching values are replaced with <code>newid</code>.  The method does <em>not</em>
1500  * descend into child elements.
1501  <p>
1502  * @param oldid the old identifier.
1503  * @param newid the new identifier.
1504    */ public
renameSIdRefs(String oldid, String newid)1505  void renameSIdRefs(String oldid, String newid) {
1506     libsbmlJNI.Compartment_renameSIdRefs(swigCPtr, this, oldid, newid);
1507   }
1508 
1509 
1510 /**
1511    * <p>
1512  * Replaces all uses of a given <code>UnitSIdRef</code> type attribute value with
1513  * another value.
1514  <p>
1515  * <p>
1516  * In SBML, unit definitions have identifiers of type <code>UnitSId</code>.  In
1517  * SBML Level&nbsp;3, an explicit data type called <code>UnitSIdRef</code> was
1518  * introduced for attribute values that refer to <code>UnitSId</code> values; in
1519  * previous Levels of SBML, this data type did not exist and attributes were
1520  * simply described to as 'referring to a unit identifier', but the effective
1521  * data type was the same as <code>UnitSIdRef</code> in Level&nbsp;3.  These and
1522  * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all
1523  * Levels of SBML, even if the corresponding SBML specification did not
1524  * explicitly name the data type.
1525  <p>
1526  * This method works by looking at all unit identifier attribute values
1527  * (including, if appropriate, inside mathematical formulas), comparing the
1528  * referenced unit identifiers to the value of <code>oldid</code>.  If any matches
1529  * are found, the matching values are replaced with <code>newid</code>.  The method
1530  * does <em>not</em> descend into child elements.
1531  <p>
1532  * @param oldid the old identifier.
1533  * @param newid the new identifier.
1534    */ public
renameUnitSIdRefs(String oldid, String newid)1535  void renameUnitSIdRefs(String oldid, String newid) {
1536     libsbmlJNI.Compartment_renameUnitSIdRefs(swigCPtr, this, oldid, newid);
1537   }
1538 
1539 
1540 /**
1541    * Unsets the value of the 'name' attribute of this {@link Compartment} object.
1542    <p>
1543    * <p>
1544  * <p>
1545  * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
1546  * moved to {@link SBase} directly, instead of being defined individually for many
1547  * (but not all) objects.  LibSBML has for a long time provided functions
1548  * defined on {@link SBase} itself to get, set, and unset those attributes, which
1549  * would fail or otherwise return empty strings if executed on any object
1550  * for which those attributes were not defined.  Now that all {@link SBase} objects
1551  * define those attributes, those functions now succeed for any object with
1552  * the appropriate level and version.
1553  <p>
1554  * The 'name' attribute is
1555  * optional and is not intended to be used for cross-referencing purposes
1556  * within a model.  Its purpose instead is to provide a human-readable
1557  * label for the component.  The data type of 'name' is the type
1558  * <code>string</code> defined in XML Schema.  SBML imposes no
1559  * restrictions as to the content of 'name' attributes beyond those
1560  * restrictions defined by the <code>string</code> type in XML Schema.
1561  <p>
1562  * The recommended practice for handling 'name' is as follows.  If a
1563  * software tool has the capability for displaying the content of 'name'
1564  * attributes, it should display this content to the user as a
1565  * component's label instead of the component's 'id'.  If the user
1566  * interface does not have this capability (e.g., because it cannot
1567  * display or use special characters in symbol names), or if the 'name'
1568  * attribute is missing on a given component, then the user interface
1569  * should display the value of the 'id' attribute instead.  (Script
1570  * language interpreters are especially likely to display 'id' instead of
1571  * 'name'.)
1572  <p>
1573  * As a consequence of the above, authors of systems that automatically
1574  * generate the values of 'id' attributes should be aware some systems
1575  * may display the 'id''s to the user.  Authors therefore may wish to
1576  * take some care to have their software create 'id' values that are: (a)
1577  * reasonably easy for humans to type and read; and (b) likely to be
1578  * meaningful, for example by making the 'id' attribute be an abbreviated
1579  * form of the name attribute value.
1580  <p>
1581  * An additional point worth mentioning is although there are
1582  * restrictions on the uniqueness of 'id' values, there are no
1583  * restrictions on the uniqueness of 'name' values in a model.  This
1584  * allows software applications leeway in assigning component identifiers.
1585  <p>
1586  * Regardless of the level and version of the SBML, these functions allow
1587  * client applications to use more generalized code in some situations
1588  * (for instance, when manipulating objects that are all known to have
1589  * names).  If the object in question does not posess a 'name' attribute
1590  * according to the SBML specification for the Level and Version in use,
1591  * libSBML will not allow the name to be set, nor will it read or
1592  * write 'name' attributes for those objects.
1593  <p>
1594  * <p>
1595  * @return integer value indicating success/failure of the
1596  * function.   The possible values
1597  * returned by this function are:
1598  * <ul>
1599  * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1600  * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
1601  *
1602  * </ul> <p>
1603  * @see #getName()
1604  * @see #setName(String sid)
1605  * @see #isSetName()
1606    */ public
unsetName()1607  int unsetName() {
1608     return libsbmlJNI.Compartment_unsetName(swigCPtr, this);
1609   }
1610 
1611 
1612 /**
1613    * Unsets the value of the 'compartmentType' attribute of this {@link Compartment} object.
1614    <p>
1615    * <p>
1616  * @return integer value indicating success/failure of the
1617  * function.   The possible values
1618  * returned by this function are:
1619    * <ul>
1620    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1621    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
1622    * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
1623    *
1624    * </ul> <p>
1625    * @note The 'compartmentType' attribute is only available in SBML
1626    * Level&nbsp;2 Versions&nbsp;2&ndash;4.
1627    <p>
1628    * @see #setCompartmentType(String)
1629    * @see #isSetCompartmentType()
1630    * @see #getCompartmentType()
1631    */ public
unsetCompartmentType()1632  int unsetCompartmentType() {
1633     return libsbmlJNI.Compartment_unsetCompartmentType(swigCPtr, this);
1634   }
1635 
1636 
1637 /**
1638    * Unsets the value of the 'constant' attribute of this {@link Compartment} object.
1639    <p>
1640    * <p>
1641  * @return integer value indicating success/failure of the
1642  * function.   The possible values
1643  * returned by this function are:
1644    * <ul>
1645    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1646    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
1647    *
1648    * </ul> <p>
1649    * @see #isSetConstant()
1650    * @see #setConstant(boolean)
1651    * @see #getConstant()
1652    */ public
unsetConstant()1653  int unsetConstant() {
1654     return libsbmlJNI.Compartment_unsetConstant(swigCPtr, this);
1655   }
1656 
1657 
1658 /**
1659    * Unsets the value of the 'size' attribute of this {@link Compartment} object.
1660    <p>
1661    * In SBML Level&nbsp;1, a compartment's volume has a default value
1662    * (<code>1.0</code>) and therefore <em>should always be set</em>.  Calling this method
1663    * on a Level&nbsp;1 model resets the value to <code>1.0</code> rather than actually
1664    * unsetting it.  In Level&nbsp;2, a compartment's 'size' is optional with
1665    * no default value, and unsetting it will result in the compartment having
1666    * no defined size.
1667    <p>
1668    * <p>
1669  * @return integer value indicating success/failure of the
1670  * function.   The possible values
1671  * returned by this function are:
1672    * <ul>
1673    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1674    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
1675    *
1676    * </ul> <p>
1677    * @note This method is identical to
1678    * {@link Compartment#unsetVolume()}.
1679    <p>
1680    * @see #unsetVolume()
1681    * @see #getSize()
1682    * @see #isSetSize()
1683    * @see #setSize(double)
1684    */ public
unsetSize()1685  int unsetSize() {
1686     return libsbmlJNI.Compartment_unsetSize(swigCPtr, this);
1687   }
1688 
1689 
1690 /**
1691    * Unsets the value of the 'volume' attribute of this {@link Compartment} object.
1692    <p>
1693    * This method is identical to
1694    * {@link Compartment#unsetSize()}.  Please refer
1695    * to that method's documentation for more information about its behavior.
1696    <p>
1697    * <p>
1698  * @return integer value indicating success/failure of the
1699  * function.   The possible values
1700  * returned by this function are:
1701    * <ul>
1702    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1703    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
1704    *
1705    * </ul> <p>
1706    * <p>
1707  * @note The attribute 'volume' only exists by that name in SBML
1708  * Level&nbsp;1.  In Level&nbsp;2 and above, the equivalent attribute is
1709  * named 'size'.  In SBML Level&nbsp;1, a compartment's volume has a default
1710  * value (<code>1.0</code>) and therefore methods such as
1711  * isSetVolume()
1712  * will always return <code>true</code> for a Level&nbsp;1 model.  In Level&nbsp;2, a
1713  * compartment's size (the equivalent of SBML Level&nbsp;1's 'volume') is
1714  * optional and has no default value, and therefore may or may not be set.
1715    <p>
1716    * @see #unsetSize()
1717    * @see #getVolume()
1718    * @see #setVolume(double)
1719    * @see #isSetVolume()
1720    */ public
unsetVolume()1721  int unsetVolume() {
1722     return libsbmlJNI.Compartment_unsetVolume(swigCPtr, this);
1723   }
1724 
1725 
1726 /**
1727    * Unsets the value of the 'units' attribute of this {@link Compartment} object.
1728    <p>
1729    * <p>
1730  * @return integer value indicating success/failure of the
1731  * function.   The possible values
1732  * returned by this function are:
1733    * <ul>
1734    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1735    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
1736    *
1737    * </ul> <p>
1738    * @see #isSetUnits()
1739    * @see #setUnits(String)
1740    * @see #getUnits()
1741    */ public
unsetUnits()1742  int unsetUnits() {
1743     return libsbmlJNI.Compartment_unsetUnits(swigCPtr, this);
1744   }
1745 
1746 
1747 /**
1748    * Unsets the value of the 'outside' attribute of this {@link Compartment} object.
1749    <p>
1750    * <p>
1751  * @return integer value indicating success/failure of the
1752  * function.   The possible values
1753  * returned by this function are:
1754    * <ul>
1755    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1756    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
1757    *
1758    * </ul> <p>
1759    * @note The 'outside' attribute is defined in SBML Level&nbsp;1 and
1760    * Level&nbsp;2, but does not exist in SBML Level&nbsp;3.
1761    <p>
1762    * @see #isSetOutside()
1763    * @see #getOutside()
1764    * @see #setOutside(String)
1765    */ public
unsetOutside()1766  int unsetOutside() {
1767     return libsbmlJNI.Compartment_unsetOutside(swigCPtr, this);
1768   }
1769 
1770 
1771 /**
1772    * Unsets the value of the 'spatialDimensions' attribute of this
1773    * {@link Compartment} object.
1774    <p>
1775    * In SBML Levels prior to Level&nbsp;3, compartments must always have a
1776    * value for the number of dimensions.  Consequently, calling this method
1777    * on a model of SBML Level 1&ndash;2 will result in a return value of
1778    * {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
1779    <p>
1780    * <p>
1781  * @return integer value indicating success/failure of the
1782  * function.   The possible values
1783  * returned by this function are:
1784    * <ul>
1785    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
1786    * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
1787    * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
1788    *
1789    * </ul> <p>
1790    * @note This function is only valid for SBML Level&nbsp;3.
1791    <p>
1792    * @see #getSpatialDimensions()
1793    * @see #isSetSpatialDimensions()
1794    * @see #setSpatialDimensions(long)
1795    */ public
unsetSpatialDimensions()1796  int unsetSpatialDimensions() {
1797     return libsbmlJNI.Compartment_unsetSpatialDimensions(swigCPtr, this);
1798   }
1799 
1800 
1801 /**
1802    * Constructs and returns a {@link UnitDefinition} that corresponds to the units
1803    * of this {@link Compartment} object's designated size.
1804    <p>
1805    * <p>
1806  * Compartments in SBML have an attribute ('units') for declaring the
1807  * units of measurement intended for the value of the compartment's size.  In
1808  * the absence of a value given for this attribute, the units are inherited
1809  * from values either defined on the enclosing {@link Model} (in SBML Level&nbsp;3)
1810  * or in defaults (in SBML Level&nbsp;2).  This method returns a
1811  * {@link UnitDefinition} object
1812  * based on how this compartment's units are interpreted according to the
1813  * relevant SBML guidelines, or it returns <code>null</code> if no units have been
1814  * declared and no defaults are defined by the relevant SBML specification.
1815  <p>
1816  * Note that unit declarations for
1817  * {@link Compartment} objects
1818  * are specified in terms of the <em>identifier</em> of a unit,
1819  * but <em>this</em> method returns an object ,
1820  * not a unit identifier.  It does this by constructing an appropriate
1821  * {@link UnitDefinition} object.  For
1822  * SBML Level&nbsp;2 models, it will do this even when the value of the
1823  * 'units' attribute is one of the special SBML Level&nbsp;2 unit identifiers
1824  * <code>'substance'</code>, <code>'volume'</code>, <code>'area'</code>, <code>'length'</code> or <code>'time'.</code>  Callers
1825  * may find this useful in conjunction with the helper methods provided by
1826  * the {@link UnitDefinition}
1827  * class for comparing different {@link UnitDefinition} objects.
1828    <p>
1829    * @return a {@link UnitDefinition} that expresses the units of this
1830    * {@link Compartment} object, or <code>null</code> if one cannot be constructed.
1831    <p>
1832    * <p>
1833  * @note The libSBML system for unit analysis depends on the model as a
1834  * whole.  In cases where the
1835  * {@link Compartment} object has not
1836  * yet been added to a model, or the model itself is incomplete, unit
1837  * analysis is not possible, and consequently this method will return
1838  * <code>null.</code>
1839    <p>
1840    * @see #isSetUnits()
1841    * @see #getUnits()
1842    */ public
getDerivedUnitDefinition()1843  UnitDefinition getDerivedUnitDefinition() {
1844     long cPtr = libsbmlJNI.Compartment_getDerivedUnitDefinition__SWIG_0(swigCPtr, this);
1845     return (cPtr == 0) ? null : new UnitDefinition(cPtr, false);
1846   }
1847 
1848 
1849 /**
1850    * Returns the libSBML type code for this SBML object.
1851    <p>
1852    * <p>
1853  * LibSBML attaches an identifying code to every kind of SBML object.  These
1854  * are integer constants known as <em>SBML type codes</em>.  The names of all
1855  * the codes begin with the characters <code>SBML_</code>.
1856  * In the Java language interface for libSBML, the
1857  * type codes are defined as static integer constants in the interface class
1858  * {@link libsbmlConstants}.    Note that different Level&nbsp;3
1859  * package plug-ins may use overlapping type codes; to identify the package
1860  * to which a given object belongs, call the
1861  * <code>{@link SBase#getPackageName()}
1862  * </code>
1863  * method on the object.
1864  <p>
1865  * The exception to this is lists:  all SBML-style list elements have the type
1866  * {@link libsbmlConstants#SBML_LIST_OF SBML_LIST_OF}, regardless of what package they
1867  * are from.
1868    <p>
1869    * @return the SBML type code for this object:
1870    * {@link libsbmlConstants#SBML_COMPARTMENT SBML_COMPARTMENT} (default).
1871    <p>
1872    * <p>
1873  * @warning <span class='warning'>The specific integer values of the possible
1874  * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
1875  * packages,  To fully identify the correct code, <strong>it is necessary to
1876  * invoke both getPackageName() and getTypeCode()</strong> (or
1877  * {@link ListOf#getItemTypeCode()}).</span>
1878    <p>
1879    * @see #getElementName()
1880    * @see #getPackageName()
1881    */ public
getTypeCode()1882  int getTypeCode() {
1883     return libsbmlJNI.Compartment_getTypeCode(swigCPtr, this);
1884   }
1885 
1886 
1887 /**
1888    * Returns the XML element name of this object
1889    <p>
1890    * For {@link Compartment}, the XML element name is always <code>'compartment'.</code>
1891    <p>
1892    * @return the name of this element.
1893    */ public
getElementName()1894  String getElementName() {
1895     return libsbmlJNI.Compartment_getElementName(swigCPtr, this);
1896   }
1897 
1898 
1899 /**
1900    * Predicate returning <code>true</code> if all the required attributes for this
1901    * {@link Compartment} object have been set.
1902    <p>
1903    * The required attributes for a {@link Compartment} object are:
1904    * <ul>
1905    * <li> 'id' (or 'name' in SBML Level&nbsp;1)
1906    * <li> 'constant' (in SBML Level&nbsp;3 only)
1907    *
1908    * </ul> <p>
1909    * @return <code>true</code> if the required attributes have been set, <code>false</code>
1910    * otherwise.
1911    */ public
hasRequiredAttributes()1912  boolean hasRequiredAttributes() {
1913     return libsbmlJNI.Compartment_hasRequiredAttributes(swigCPtr, this);
1914   }
1915 
1916 }
1917