001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.10 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * An SBML compartment, where species are located. 013 <p> 014 * A compartment in SBML represents a bounded space in which species are 015 * located. Compartments do not necessarily have to correspond to actual 016 * structures inside or outside of a biological cell. 017 <p> 018 * It is important to note that although compartments are optional in the 019 * overall definition of {@link Model}, every species in an SBML model must be 020 * located in a compartment. This in turn means that if a model defines 021 * any species, the model must also define at least one compartment. The 022 * reason is simply that species represent physical things, and therefore 023 * must exist <em>somewhere</em>. Compartments represent the <em>somewhere</em>. 024 <p> 025 * {@link Compartment} has one required attribute, 'id', to give the compartment a 026 * unique identifier by which other parts of an SBML model definition can 027 * refer to it. A compartment can also have an optional 'name' attribute 028 * of type <code>string.</code> Identifiers and names must be used according to the 029 * guidelines described in the SBML specifications. 030 <p> 031 * {@link Compartment} also has an optional attribute 'spatialDimensions' that is 032 * used to indicate the number of spatial dimensions possessed by the 033 * compartment. Most modeling scenarios involve compartments with integer 034 * values of 'spatialDimensions' of <code>3</code> (i.e., a three-dimensional 035 * compartment, which is to say, a volume), or 2 (a two-dimensional 036 * compartment, a surface), or <code>1</code> (a one-dimensional compartment, a 037 * line). In SBML Level 3, the type of this attribute is <code>double</code>, 038 * there are no restrictions on the permitted values of the 039 * 'spatialDimensions' attribute, and there are no default values. In SBML 040 * Level 2, the value must be a positive <code>integer</code>, and the default 041 * value is <code>3</code>; the permissible values in SBML Level 2 are <code>3</code>, 042 * <code>2</code>, <code>1</code>, and <code>0</code> (for a point). 043 <p> 044 * Another optional attribute on {@link Compartment} is 'size', representing the 045 * <em>initial</em> total size of that compartment in the model. The 'size' attribute 046 * must be a floating-point value and may represent a volume (if the 047 * compartment is a three-dimensional one), or an area (if the compartment is 048 * two-dimensional), or a length (if the compartment is one-dimensional). 049 * There is no default value of compartment size in SBML Level 2 or 050 * Level 3. In particular, a missing 'size' value <em>does not imply 051 * that the compartment size is 1</em>. (This is unlike the definition of 052 * compartment 'volume' in SBML Level 1.) When the compartment's 053 * 'spatialDimensions' attribute does not have a value of <code>0</code>, a missing 054 * value of 'size' for a given compartment signifies that the value either is 055 * unknown, or to be obtained from an external source, or determined by an 056 * {@link InitialAssignment}, {@link AssignmentRule}, {@link AlgebraicRule} or {@link RateRule} 057 * object elsewhere in the model. In SBML 058 * Level 2, there are additional special requirements on the values of 059 * 'size'; we discuss them in a <a href='#comp-l2'>separate section 060 * below</a>. 061 <p> 062 * The units associated with a compartment's 'size' attribute value may be 063 * set using the optional attribute 'units'. The rules for setting and 064 * using compartment size units differ between SBML Level 2 and 065 * Level 3, and are discussed separately below. 066 <p> 067 * Finally, the optional {@link Compartment} attribute named 'constant' is used to 068 * indicate whether the compartment's size stays constant after simulation 069 * begins. A value of <code>true</code> indicates the compartment's 'size' cannot be 070 * changed by any other construct except {@link InitialAssignment}; a value of 071 * <code>false</code> indicates the compartment's 'size' can be changed by other 072 * constructs in SBML. In SBML Level 2, there is an additional 073 * explicit restriction that if 'spatialDimensions'=<code>'0'</code>, the value 074 * cannot be changed by {@link InitialAssignment} either. Further, in 075 * Level 2, 'constant' has a default value of <code>true.</code> In SBML 076 * Level 3, there is no default value for the 'constant' attribute. 077 <p> 078 * <h2>Additional considerations in SBML Level 2</h2> 079 <p> 080 * In SBML Level 2, the default units of compartment size, and the kinds 081 * of units allowed as values of the attribute 'units', interact with the 082 * number of spatial dimensions of the compartment. The value of the 'units' 083 * attribute of a {@link Compartment} object must 084 * be one of the base units (see {@link Unit}), or the predefined unit identifiers 085 * <code>volume</code>, <code>area</code>, <code>length</code> or <code>dimensionless</code>, or a new unit defined by a 086 * {@link UnitDefinition} object in the enclosing 087 * {@link Model}, subject to the restrictions detailed in the following table: 088 <p> 089 * <table border='0' class='centered text-table width80 normal-font alt-row-colors' 090 * style='padding-bottom: 0.5em'> 091 * <caption class='top-caption'>Restrictions on values permitted for 092 * compartment <code>size</code> and <code>units</code> attributes.</caption> 093 * <tr> 094 * <th align='left' valign='bottom'> 095 * Value of<br><code>spatialDimensions</code> 096 * </th> 097 * <th align='left' valign='bottom'> 098 * <code>size</code><br>allowed? 099 * </th> 100 * <th align='left' valign='bottom'> 101 * <code>units</code><br>allowed? 102 * </th> 103 * <th align='left' valign='bottom'> 104 * Allowable kinds of units 105 * </th> 106 * <th align='left' valign='bottom'> 107 * Default value of attribute <code>units</code> 108 * </th> 109 * </tr> 110 * <tr> 111 * <td><code>3</code></td> 112 * <td>yes</td> 113 * <td>yes</td> 114 * <td>units of volume, or <code>dimensionless</code></td> 115 * <td><code>volume</code></td> 116 * </tr> 117 * <tr> 118 * <td><code>2</code></td> 119 * <td>yes</td> 120 * <td>yes</td> 121 * <td>units of area, or <code>dimensionless</code></td> 122 * <td><code>area</code></td> 123 * </tr> 124 * <tr> 125 * <td><code>1</code></td> 126 * <td>yes</td> 127 * <td>yes</td> 128 * <td>units of length, or <code>dimensionless</code></td> 129 * <td><code>length</code></td> 130 * </tr> 131 * <tr> 132 * <td><code>0</code></td> 133 * <td>no</td> 134 * <td>no</td> 135 * <td>(no units allowed)</td> 136 * <td></td> 137 * </tr> 138 * </tr> 139 * </table> 140 <p> 141 * In SBML Level 2, the units of the compartment size, as defined by the 142 * 'units' attribute or (if 'units' is not set) the default value listed in 143 * the table above, are used in the following ways when the compartment has 144 * a 'spatialDimensions' value greater than <code>0:</code> 145 * <ul> 146 * <li> The value of the 'units' attribute is used as the units of the 147 * compartment identifier when the identifier appears as a numerical 148 * quantity in a mathematical formula expressed in MathML. 149 <p> 150 * <li> The <code>math</code> element of an {@link AssignmentRule} or {@link InitialAssignment} 151 * referring to this compartment must have identical units. 152 <p> 153 * <li> In {@link RateRule} objects that set the rate of change of the compartment's 154 * size, the units of the rule's <code>math</code> element must be identical to the 155 * compartment's 'units' attribute divided by the default <em>time</em> units. 156 * (In other words, the units for the rate of change of compartment size 157 * are <em>compartment size</em>/<em>time</em> units. 158 <p> 159 * <li> When a {@link Species} is to be treated in terms of concentrations or 160 * density, the units of the spatial size portion of the concentration 161 * value (i.e., the denominator in the units formula <em>substance</em>/ 162 * <em>size</em>) are those indicated by the value of the 'units' attribute on the 163 * compartment in which the species is located. 164 * </ul> 165 <p> 166 * Compartments with 'spatialDimensions'=<code>0</code> require special treatment in 167 * this framework. As implied above, the 'size' attribute must not have a 168 * value on an SBML Level 2 {@link Compartment} 169 * object if the 'spatialDimensions' 170 * attribute has a value of <code>0.</code> An additional related restriction is that 171 * the 'constant' attribute must default to or be set to <code>true</code> if the value 172 * of the 'spatialDimensions' attribute is <code>0</code>, because a zero-dimensional 173 * compartment cannot ever have a size. 174 <p> 175 * If a compartment has no size or dimensional units, how should such a 176 * compartment's identifier be interpreted when it appears in mathematical 177 * formulas? The answer is that such a compartment's identifier should not 178 * appear in mathematical formulas in the first place—it has no 179 * value, and its value cannot change. Note also that a zero-dimensional 180 * compartment is a point, and species located at points can only be 181 * described in terms of amounts, not spatially-dependent measures such as 182 * concentration. Since SBML {@link KineticLaw} formulas are already in terms of 183 * <em>substance</em>/<em>time</em> and not (say) <em>concentration</em>/<em>time</em>, volume 184 * or other factors in principle are not needed for species located in 185 * zero-dimensional compartments. 186 <p> 187 * Finally, in SBML Level 2 Versions 2–4, each compartment in a 188 * model may optionally be designated as belonging to a particular 189 * compartment <em>type</em>. The optional attribute 'compartmentType' is used 190 * identify the compartment type represented by the {@link Compartment} structure. 191 * The 'compartmentType' attribute's value must be the identifier of a 192 * {@link CompartmentType} instance defined in the model. If the 'compartmentType' 193 * attribute is not present on a particular compartment definition, a 194 * unique virtual compartment type is assumed for that compartment, and no 195 * other compartment can belong to that compartment type. The values of 196 * 'compartmentType' attributes on compartments have no effect on the 197 * numerical interpretation of a model. Simulators and other numerical 198 * analysis software may ignore 'compartmentType' attributes. The 199 * 'compartmentType' attribute and the {@link CompartmentType} 200 * class of objects are 201 * not present in SBML Level 3 Core nor in SBML Level 1. 202 <p> 203 * <h2>Additional considerations in SBML Level 3</h2> 204 <p> 205 * One difference between SBML Level 3 and lower Levels of SBML is 206 * that there are no restrictions on the permissible values of the 207 * 'spatialDimensions' attribute, and there is no default value defined for 208 * the attribute. The value of 'spatialDimensions' does not have to be an 209 * integer, either; this is to allow for the possibility of representing 210 * structures with fractal dimensions. 211 <p> 212 * The number of spatial dimensions possessed by a compartment cannot enter 213 * into mathematical formulas, and therefore cannot directly alter the 214 * numerical interpretation of a model. However, the value of 215 * 'spatialDimensions' <em>does</em> affect the interpretation of the units 216 * associated with a compartment's size. Specifically, the value of 217 * 'spatialDimensions' is used to select among the {@link Model} attributes 218 * 'volumeUnits', 'areaUnits' and 'lengthUnits' when a {@link Compartment} 219 * structure does not define a value for its 220 * 'units' attribute. 221 <p> 222 * The 'units' attribute may be left unspecified for a given compartment in a 223 * model; in that case, the compartment inherits the unit of measurement 224 * specified by one of the attributes on the enclosing {@link Model} 225 * object instance. The applicable 226 * attribute on {@link Model} depends on the value of the compartment's 227 * 'spatialDimensions' attribute; the relationship is shown in the table 228 * below. If the {@link Model} object does not 229 * define the relevant attribute ('volumeUnits', 'areaUnits' or 230 * 'lengthUnits') for a given 'spatialDimensions' value, the unit associated 231 * with that {@link Compartment} object's size is 232 * undefined. If <em>both</em> 'spatialDimensions' and 'units' are left unset on 233 * a given {@link Compartment} object instance, 234 * then no unit can be chosen from among the {@link Model}'s 'volumeUnits', 235 * 'areaUnits' or 'lengthUnits' attributes (even if the {@link Model} instance 236 * provides values for those attributes), because there is no basis to select 237 * between them and there is no default value of 'spatialDimensions'. 238 * Leaving the units of compartments' sizes undefined in an SBML model does 239 * not render the model invalid; however, as a matter of best practice, we 240 * strongly recommend that all models specify the units of measurement for 241 * all compartment sizes. 242 <p> 243 * <table border='0' class='centered text-table width80 normal-font alt-row-colors' 244 * style='padding-bottom: 0.5em'> 245 * <caption class='top-caption'>Interpretation of the {@link Compartment} 'units' attribute.</caption> 246 * <tr> 247 * <th align='left' valign='bottom'> 248 * Value of attribute<br>'spatialDimensions' 249 * </th> 250 * <th align='left' valign='bottom'> 251 * Attribute of {@link Model} used<br>for inheriting the unit 252 * </th> 253 * <th align='left' valign='bottom'> 254 * Recommended candidate units 255 * </th> 256 * </tr> 257 * <tr> 258 * <td><code>3</code></td> 259 * <td>"volumeUnits"</td> 260 * <td>units of volume, or <code>dimensionless</code></td> 261 * </tr> 262 * <tr> 263 * <td><code>2</code></td> 264 * <td>"areaUnits"</td> 265 * <td>units of area, or <code>dimensionless</code></td> 266 * </tr> 267 * <tr> 268 * <td><code>1</code></td> 269 * <td>"lengthUnits"</td> 270 * <td>units of length, or <code>dimensionless</code></td> 271 * </tr> 272 * <tr> 273 * <td><em>other</em></td> 274 * <td><em>no units inherited</em></td> 275 * <td><em>no specific recommendations</em></td> 276 * </tr> 277 * </tr> 278 * </table> 279 <p> 280 * The unit of measurement associated with a compartment's size, as defined 281 * by the 'units' attribute or (if 'units' is not set) the inherited value 282 * from {@link Model} according to the table above, is used in the following ways: 283 <p> 284 * <ul> 285 <p> 286 * <li> When the identifier of the compartment appears as a numerical 287 * quantity in a mathematical formula expressed in MathML, it represents 288 * the size of the compartment, and the unit associated with the size is 289 * the value of the 'units' attribute. 290 <p> 291 * <li> When a {@link Species} is to be treated in terms of concentrations or 292 * density, the unit associated with the spatial size portion of the 293 * concentration value (i.e., the denominator in the formula 294 * <em>amount</em>/<em>size</em>) is specified by the value of the 'units' 295 * attribute on the compartment in which the species is located. 296 <p> 297 * <li> The 'math' elements of {@link AssignmentRule}, {@link InitialAssignment} and 298 * {@link EventAssignment} objects setting the 299 * value of the compartment size should all have the same units as the unit 300 * associated with the compartment's size. 301 <p> 302 * <li> In a {@link RateRule} object that defines a 303 * rate of change for a compartment's size, the unit of the rule's 'math' 304 * element should be identical to the compartment's 'units' attribute divided 305 * by the model-wide unit of <em>time</em>. (In other words, {<em>unit of 306 * compartment size</em>}/{<em>unit of time</em>}.) 307 <p> 308 * </ul> 309 <p> 310 * <h2>Other aspects of {@link Compartment}</h2> 311 <p> 312 * In SBML Level 1 and Level 2, {@link Compartment} has an optional 313 * attribute named 'outside', whose value can be the identifier of another 314 * {@link Compartment} object defined in the 315 * enclosing {@link Model} object. Doing so means 316 * that the other compartment contains it or is outside of it. This enables 317 * the representation of simple topological relationships between 318 * compartments, for those simulation systems that can make use of the 319 * information (e.g., for drawing simple diagrams of compartments). It is 320 * worth noting that in SBML, there is no relationship between compartment 321 * sizes when compartment positioning is expressed using the 'outside' 322 * attribute. The size of a given compartment does not in any sense include 323 * the sizes of other compartments having it as the value of their 'outside' 324 * attributes. In other words, if a compartment <em>B</em> has the identifier of 325 * compartment <em>A</em> as its 'outside' attribute value, the size of <em>A</em> does 326 * not include the size of <em>B</em>. The compartment sizes are separate. 327 <p> 328 * In Level 2, there are two restrictions on the 'outside' attribute. 329 * First, because a compartment with 'spatialDimensions' of <code>0</code> has no 330 * size, such a compartment cannot act as the container of any other 331 * compartment <em>except</em> compartments that <em>also</em> have 332 * 'spatialDimensions' values of <code>0.</code> Second, the directed graph formed 333 * by representing {@link Compartment} structures as vertexes and the 'outside' 334 * attribute values as edges must be acyclic. The latter condition is 335 * imposed to prevent a compartment from being contained inside itself. In 336 * the absence of a value for 'outside', compartment definitions in SBML 337 * Level 2 do not have any implied spatial relationships between each 338 * other. 339 */ 340 341public class Compartment extends SBase { 342 private long swigCPtr; 343 344 protected Compartment(long cPtr, boolean cMemoryOwn) 345 { 346 super(libsbmlJNI.Compartment_SWIGUpcast(cPtr), cMemoryOwn); 347 swigCPtr = cPtr; 348 } 349 350 protected static long getCPtr(Compartment obj) 351 { 352 return (obj == null) ? 0 : obj.swigCPtr; 353 } 354 355 protected static long getCPtrAndDisown (Compartment obj) 356 { 357 long ptr = 0; 358 359 if (obj != null) 360 { 361 ptr = obj.swigCPtr; 362 obj.swigCMemOwn = false; 363 } 364 365 return ptr; 366 } 367 368 protected void finalize() { 369 delete(); 370 } 371 372 public synchronized void delete() { 373 if (swigCPtr != 0) { 374 if (swigCMemOwn) { 375 swigCMemOwn = false; 376 libsbmlJNI.delete_Compartment(swigCPtr); 377 } 378 swigCPtr = 0; 379 } 380 super.delete(); 381 } 382 383 384/** 385 * Creates a new {@link Compartment} object using the given SBML <code>level</code> and 386 * <code>version</code> values. 387 <p> 388 * @param level a long integer, the SBML Level to assign to this {@link Compartment} 389 <p> 390 * @param version a long integer, the SBML Version to assign to this 391 * {@link Compartment} 392 <p> 393 * <p> 394 * @throws SBMLConstructorException 395 * Thrown if the given <code>level</code> and <code>version</code> combination are invalid 396 * or if this object is incompatible with the given level and version. 397 <p> 398 * <p> 399 * @note Attempting to add an object to an {@link SBMLDocument} having a different 400 * combination of SBML Level, Version and XML namespaces than the object 401 * itself will result in an error at the time a caller attempts to make the 402 * addition. A parent object must have compatible Level, Version and XML 403 * namespaces. (Strictly speaking, a parent may also have more XML 404 * namespaces than a child, but the reverse is not permitted.) The 405 * restriction is necessary to ensure that an SBML model has a consistent 406 * overall structure. This requires callers to manage their objects 407 * carefully, but the benefit is increased flexibility in how models can be 408 * created by permitting callers to create objects bottom-up if desired. In 409 * situations where objects are not yet attached to parents (e.g., 410 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 411 * libSBML determine such things as whether it is valid to assign a 412 * particular value to an attribute. 413 */ public 414 Compartment(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 415 this(libsbmlJNI.new_Compartment__SWIG_0(level, version), true); 416 } 417 418 419/** 420 * Creates a new {@link Compartment} object using the given {@link SBMLNamespaces} object 421 * <code>sbmlns</code>. 422 <p> 423 * <p> 424 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 425 * information. It is used to communicate the SBML Level, Version, and (in 426 * Level 3) packages used in addition to SBML Level 3 Core. A 427 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 428 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object 429 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 430 <p> 431 * It is worth emphasizing that although this constructor does not take an 432 * identifier argument, in SBML Level 2 and beyond, the 'id' 433 * (identifier) attribute of a {@link Compartment} object is required to have a 434 * value. Thus, callers are cautioned to assign a value after calling this 435 * constructor. Setting the identifier can be accomplished using the 436 * method {@link Compartment#setId(String id)}. 437 <p> 438 * @param sbmlns an {@link SBMLNamespaces} object. 439 <p> 440 * <p> 441 * @throws SBMLConstructorException 442 * Thrown if the given <code>sbmlns</code> is inconsistent or incompatible 443 * with this object. 444 <p> 445 * <p> 446 * @note Attempting to add an object to an {@link SBMLDocument} having a different 447 * combination of SBML Level, Version and XML namespaces than the object 448 * itself will result in an error at the time a caller attempts to make the 449 * addition. A parent object must have compatible Level, Version and XML 450 * namespaces. (Strictly speaking, a parent may also have more XML 451 * namespaces than a child, but the reverse is not permitted.) The 452 * restriction is necessary to ensure that an SBML model has a consistent 453 * overall structure. This requires callers to manage their objects 454 * carefully, but the benefit is increased flexibility in how models can be 455 * created by permitting callers to create objects bottom-up if desired. In 456 * situations where objects are not yet attached to parents (e.g., 457 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 458 * libSBML determine such things as whether it is valid to assign a 459 * particular value to an attribute. 460 */ public 461 Compartment(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 462 this(libsbmlJNI.new_Compartment__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 463 } 464 465 466/** 467 * Copy constructor. 468 <p> 469 * This creates a copy of a {@link Compartment} object. 470 <p> 471 * @param orig the {@link Compartment} instance to copy. 472 */ public 473 Compartment(Compartment orig) throws org.sbml.libsbml.SBMLConstructorException { 474 this(libsbmlJNI.new_Compartment__SWIG_2(Compartment.getCPtr(orig), orig), true); 475 } 476 477 478/** 479 * Creates and returns a deep copy of this {@link Compartment} object. 480 <p> 481 * @return the (deep) copy of this {@link Compartment} object. 482 */ public 483 Compartment cloneObject() { 484 long cPtr = libsbmlJNI.Compartment_cloneObject(swigCPtr, this); 485 return (cPtr == 0) ? null : new Compartment(cPtr, true); 486 } 487 488 489/** 490 * Initializes the fields of this {@link Compartment} object to 'typical' default 491 * values. 492 <p> 493 * The SBML {@link Compartment} component has slightly different aspects and 494 * default attribute values in different SBML Levels and Versions. 495 * This method sets the values to certain common defaults, based 496 * mostly on what they are in SBML Level 2. Specifically: 497 <p> 498 * <ul> 499 * <li> Sets attribute 'spatialDimensions' to <code>3</code> 500 * <li> Sets attribute 'constant' to <code>true</code> 501 * <li> (Applies to Level 1 models only) Sets attribute 'volume' to <code>1.0</code> 502 * <li> (Applies to Level 3 models only) Sets attribute 'units' to <code>litre</code> 503 * </ul> 504 */ public 505 void initDefaults() { 506 libsbmlJNI.Compartment_initDefaults(swigCPtr, this); 507 } 508 509 510/** 511 * Returns the value of the 'id' attribute of this {@link Compartment} object. 512 <p> 513 * @return the identifier of this {@link Compartment} object. 514 <p> 515 * @see #getName() 516 * @see #setId(String) 517 * @see #unsetId() 518 * @see #isSetId() 519 */ public 520 String getId() { 521 return libsbmlJNI.Compartment_getId(swigCPtr, this); 522 } 523 524 525/** 526 * Returns the value of the 'name' attribute of this {@link Compartment} object. 527 <p> 528 * @return the name of this {@link Compartment} object. 529 <p> 530 * @see #getId() 531 * @see #isSetName() 532 * @see #setName(String) 533 * @see #unsetName() 534 */ public 535 String getName() { 536 return libsbmlJNI.Compartment_getName(swigCPtr, this); 537 } 538 539 540/** 541 * Get the value of the 'compartmentType' attribute of this {@link Compartment} 542 * object. 543 <p> 544 * @return the value of the 'compartmentType' attribute of this 545 * {@link Compartment} object as a string. 546 <p> 547 * @note The 'compartmentType' attribute is only available in SBML 548 * Level 2 Versions 2–4. 549 <p> 550 * @see #isSetCompartmentType() 551 * @see #setCompartmentType(String) 552 * @see #unsetCompartmentType() 553 */ public 554 String getCompartmentType() { 555 return libsbmlJNI.Compartment_getCompartmentType(swigCPtr, this); 556 } 557 558 559/** 560 * Get the number of spatial dimensions of this {@link Compartment} object. 561 <p> 562 * @return the value of the 'spatialDimensions' attribute of this 563 * {@link Compartment} object as a long integereger 564 <p> 565 * <p> 566 * @note In SBML Level 3, the data type of the 'spatialDimensions' 567 * attribute is <code>double</code>, whereas in Level 2, it is <code>integer.</code> To 568 * avoid backward compatibility issues, libSBML provides two separate methods 569 * for obtaining the value as either an integer or a type <code>double</code>, for 570 * models where it is relevant. 571 <p> 572 * @see #getSpatialDimensionsAsDouble() 573 * @see #setSpatialDimensions(long) 574 * @see #isSetSpatialDimensions() 575 * @see #unsetSpatialDimensions() 576 */ public 577 long getSpatialDimensions() { 578 return libsbmlJNI.Compartment_getSpatialDimensions(swigCPtr, this); 579 } 580 581 582/** 583 * Get the number of spatial dimensions of this {@link Compartment} object, 584 * as a double. 585 <p> 586 * @return the value of the 'spatialDimensions' attribute of this 587 * {@link Compartment} object as a double, or <code>NaN</code> if this model is not in SBML 588 * Level 3 format. 589 <p> 590 * <p> 591 * @note In SBML Level 3, the data type of the 'spatialDimensions' 592 * attribute is <code>double</code>, whereas in Level 2, it is <code>integer.</code> To 593 * avoid backward compatibility issues, libSBML provides two separate methods 594 * for obtaining the value as either an integer or a type <code>double</code>, for 595 * models where it is relevant. 596 <p> 597 * @see #getSpatialDimensions() 598 * @see #setSpatialDimensions(long) 599 * @see #isSetSpatialDimensions() 600 * @see #unsetSpatialDimensions() 601 */ public 602 double getSpatialDimensionsAsDouble() { 603 return libsbmlJNI.Compartment_getSpatialDimensionsAsDouble(swigCPtr, this); 604 } 605 606 607/** 608 * Get the size of this {@link Compartment} object. 609 <p> 610 * <p> 611 * In SBML Level 1, compartments are always three-dimensional 612 * constructs and only have volumes, whereas in SBML Level 2 and higher, 613 * compartments may be other than three-dimensional, and therefore the 614 * 'volume' attribute is named 'size' in Level 2 and above. LibSBML 615 * provides both {@link Compartment#getSize()} and {@link Compartment#getVolume()} 616 * for easier support of different SBML Levels. 617 <p> 618 * @return the value of the 'size' attribute ('volume' in Level 1) of 619 * this {@link Compartment} object as a floating-point number. 620 <p> 621 * @note This method is identical to 622 * {@link Compartment#getVolume()}. 623 <p> 624 * @see #getVolume() 625 * @see #isSetSize() 626 * @see #setSize(double) 627 * @see #unsetSize() 628 */ public 629 double getSize() { 630 return libsbmlJNI.Compartment_getSize(swigCPtr, this); 631 } 632 633 634/** 635 * Get the volume of this {@link Compartment} object. 636 <p> 637 * <p> 638 * In SBML Level 1, compartments are always three-dimensional 639 * constructs and only have volumes, whereas in SBML Level 2 and higher, 640 * compartments may be other than three-dimensional, and therefore the 641 * 'volume' attribute is named 'size' in Level 2 and above. LibSBML 642 * provides both {@link Compartment#getSize()} and {@link Compartment#getVolume()} 643 * for easier support of different SBML Levels. 644 <p> 645 * @return the value of the 'volume' attribute ('size' in Level 2) of 646 * this {@link Compartment} object, as a floating-point number. 647 <p> 648 * <p> 649 * @note The attribute 'volume' only exists by that name in SBML 650 * Level 1. In Level 2 and above, the equivalent attribute is 651 * named 'size'. In SBML Level 1, a compartment's volume has a default 652 * value (<code>1.0</code>) and therefore methods such as 653 * {@link Compartment#isSetVolume()} 654 * will always return <code>true</code> for a Level 1 model. In Level 2, a 655 * compartment's size (the equivalent of SBML Level 1's 'volume') is 656 * optional and has no default value, and therefore may or may not be set. 657 <p> 658 * @note This method is identical to 659 * {@link Compartment#getSize()}. 660 <p> 661 * @see #getSize() 662 * @see #isSetVolume() 663 * @see #setVolume(double) 664 * @see #unsetVolume() 665 */ public 666 double getVolume() { 667 return libsbmlJNI.Compartment_getVolume(swigCPtr, this); 668 } 669 670 671/** 672 * Get the units of this {@link Compartment} object's size. 673 <p> 674 * The value of an SBML compartment's 'units' attribute establishes the 675 * unit of measurement associated with the compartment's size. 676 <p> 677 * @return the value of the 'units' attribute of this {@link Compartment} object, 678 * as a string. An empty string indicates that no units have been assigned 679 * to the value of the size. 680 <p> 681 * <p> 682 * @note There is an important distinction to be made between <em>no units 683 * assigned</em>, and assuming a value without units has any specific unit 684 * such as <code>dimensionless</code>. In SBML, default units are never 685 * attributed to numbers, and numbers without units are not automatically 686 * assumed to have the unit <code>dimensionless</code>. Please consult the 687 * relevant SBML specification document for a more in-depth explanation of 688 * this topic and the SBML unit system. 689 <p> 690 * @see #isSetUnits() 691 * @see #setUnits(String) 692 * @see #unsetUnits() 693 */ public 694 String getUnits() { 695 return libsbmlJNI.Compartment_getUnits(swigCPtr, this); 696 } 697 698 699/** 700 * Get the identifier, if any, of the {@link Compartment} object that is designated 701 * as being outside of <em>this</em> one. 702 <p> 703 * @return the value of the 'outside' attribute of this {@link Compartment} object. 704 <p> 705 * @note The 'outside' attribute is defined in SBML Level 1 and 706 * Level 2, but does not exist in SBML Level 3 Version 1 707 * Core. 708 <p> 709 * @see #isSetOutside() 710 * @see #setOutside(String) 711 * @see #unsetOutside() 712 */ public 713 String getOutside() { 714 return libsbmlJNI.Compartment_getOutside(swigCPtr, this); 715 } 716 717 718/** 719 * Get the value of the 'constant' attribute of this {@link Compartment} object. 720 <p> 721 * @return <code>true</code> if this {@link Compartment} object's size is flagged as being 722 * constant, <code>false</code> otherwise. 723 <p> 724 * @see #isSetConstant() 725 * @see #setConstant(boolean) 726 */ public 727 boolean getConstant() { 728 return libsbmlJNI.Compartment_getConstant(swigCPtr, this); 729 } 730 731 732/** 733 * Predicate returning <code>true</code> if this {@link Compartment} object's 'id' attribute 734 * is set. 735 <p> 736 * @return <code>true</code> if the 'id' attribute of this {@link Compartment} object is 737 * set, <code>false</code> otherwise. 738 <p> 739 * @see #getId() 740 * @see #unsetId() 741 * @see #setId(String) 742 */ public 743 boolean isSetId() { 744 return libsbmlJNI.Compartment_isSetId(swigCPtr, this); 745 } 746 747 748/** 749 * Predicate returning <code>true</code> if this {@link Compartment} object's 'name' 750 * attribute is set. 751 <p> 752 * @return <code>true</code> if the 'name' attribute of this {@link Compartment} object is 753 * set, <code>false</code> otherwise. 754 <p> 755 * @see #getName() 756 * @see #setName(String) 757 * @see #unsetName() 758 */ public 759 boolean isSetName() { 760 return libsbmlJNI.Compartment_isSetName(swigCPtr, this); 761 } 762 763 764/** 765 * Predicate returning <code>true</code> if this {@link Compartment} object's 766 * 'compartmentType' attribute is set. 767 <p> 768 * @return <code>true</code> if the 'compartmentType' attribute of this {@link Compartment} 769 * is set, <code>false</code> otherwise. 770 <p> 771 * @note The 'compartmentType' attribute is only available in SBML 772 * Level 2 Versions 2–4. 773 <p> 774 * @see #setCompartmentType(String) 775 * @see #getCompartmentType() 776 * @see #unsetCompartmentType() 777 */ public 778 boolean isSetCompartmentType() { 779 return libsbmlJNI.Compartment_isSetCompartmentType(swigCPtr, this); 780 } 781 782 783/** 784 * Predicate returning <code>true</code> if this {@link Compartment} object's 'size' 785 * attribute is set. 786 <p> 787 * This method is similar but not identical to 788 * {@link Compartment#isSetVolume()}. The latter 789 * should be used in the context of SBML Level 1 models instead of 790 * {@link Compartment#isSetSize()} 791 * because {@link Compartment#isSetVolume()} 792 * performs extra processing to take into account the difference in 793 * default values between SBML Levels 1 and 2. 794 <p> 795 * @return <code>true</code> if the 'size' attribute ('volume' in Level 2) of 796 * this {@link Compartment} object is set, <code>false</code> otherwise. 797 <p> 798 * @see #isSetVolume() 799 * @see #setSize(double) 800 * @see #getSize() 801 * @see #unsetSize() 802 */ public 803 boolean isSetSize() { 804 return libsbmlJNI.Compartment_isSetSize(swigCPtr, this); 805 } 806 807 808/** 809 * Predicate returning <code>true</code> if this {@link Compartment} object's 'volume' 810 * attribute is set. 811 <p> 812 * This method is similar but not identical to 813 * {@link Compartment#isSetSize()}. The latter 814 * should not be used in the context of SBML Level 1 models because the 815 * present method performs extra processing to take into account 816 * the difference in default values between SBML Levels 1 and 2. 817 <p> 818 * @return <code>true</code> if the 'volume' attribute ('size' in Level 2 and 819 * above) of this {@link Compartment} object is set, <code>false</code> otherwise. 820 <p> 821 * <p> 822 * @note The attribute 'volume' only exists by that name in SBML 823 * Level 1. In Level 2 and above, the equivalent attribute is 824 * named 'size'. In SBML Level 1, a compartment's volume has a default 825 * value (<code>1.0</code>) and therefore methods such as 826 * {@link Compartment#isSetVolume()} 827 * will always return <code>true</code> for a Level 1 model. In Level 2, a 828 * compartment's size (the equivalent of SBML Level 1's 'volume') is 829 * optional and has no default value, and therefore may or may not be set. 830 <p> 831 * @see #isSetSize() 832 * @see #getVolume() 833 * @see #setVolume(double) 834 * @see #unsetVolume() 835 */ public 836 boolean isSetVolume() { 837 return libsbmlJNI.Compartment_isSetVolume(swigCPtr, this); 838 } 839 840 841/** 842 * Predicate returning <code>true</code> if this {@link Compartment} object's 'units' 843 * attribute is set. 844 <p> 845 * @return <code>true</code> if the 'units' attribute of this {@link Compartment} object is 846 * set, <code>false</code> otherwise. 847 <p> 848 * <p> 849 * @note There is an important distinction to be made between <em>no units 850 * assigned</em>, and assuming a value without units has any specific unit 851 * such as <code>dimensionless</code>. In SBML, default units are never 852 * attributed to numbers, and numbers without units are not automatically 853 * assumed to have the unit <code>dimensionless</code>. Please consult the 854 * relevant SBML specification document for a more in-depth explanation of 855 * this topic and the SBML unit system. 856 <p> 857 * @see #setUnits(String) 858 * @see #getUnits() 859 * @see #unsetUnits() 860 */ public 861 boolean isSetUnits() { 862 return libsbmlJNI.Compartment_isSetUnits(swigCPtr, this); 863 } 864 865 866/** 867 * Predicate returning <code>true</code> if this {@link Compartment} object's 'outside' 868 * attribute is set. 869 <p> 870 * @return <code>true</code> if the 'outside' attribute of this {@link Compartment} object is 871 * set, <code>false</code> otherwise. 872 <p> 873 * @note The 'outside' attribute is defined in SBML Level 1 and 874 * Level 2, but does not exist in SBML Level 3 Version 1 875 * Core. 876 <p> 877 * @see #getOutside() 878 * @see #setOutside(String) 879 * @see #unsetOutside() 880 */ public 881 boolean isSetOutside() { 882 return libsbmlJNI.Compartment_isSetOutside(swigCPtr, this); 883 } 884 885 886/** 887 * Predicate returning <code>true</code> if this {@link Compartment} object's 888 * 'spatialDimensions' attribute is set. 889 <p> 890 * @return <code>true</code> if the 'spatialDimensions' attribute of this 891 * {@link Compartment} object is set, <code>false</code> otherwise. 892 <p> 893 * @see #getSpatialDimensions() 894 * @see #setSpatialDimensions(long) 895 * @see #unsetSpatialDimensions() 896 */ public 897 boolean isSetSpatialDimensions() { 898 return libsbmlJNI.Compartment_isSetSpatialDimensions(swigCPtr, this); 899 } 900 901 902/** 903 * Predicate returning <code>true</code> if this {@link Compartment} object's 'constant' 904 * attribute is set. 905 <p> 906 * @return <code>true</code> if the 'constant' attribute of this {@link Compartment} object is 907 * set, <code>false</code> otherwise. 908 <p> 909 * @see #getConstant() 910 * @see #setConstant(boolean) 911 */ public 912 boolean isSetConstant() { 913 return libsbmlJNI.Compartment_isSetConstant(swigCPtr, this); 914 } 915 916 917/** 918 * Sets the value of the 'id' attribute of this {@link Compartment} object. 919 <p> 920 * The string <code>sid</code> is copied. 921 <p> 922 * <p> 923 * SBML has strict requirements for the syntax of identifiers, that is, the 924 * values of the 'id' attribute present on most types of SBML objects. 925 * The following is a summary of the definition of the SBML identifier type 926 * <code>SId</code>, which defines the permitted syntax of identifiers. We 927 * express the syntax using an extended form of BNF notation: 928 * <pre style='margin-left: 2em; border: none; font-weight: bold; font-size: 13px; color: black'> 929 * letter .= 'a'..'z','A'..'Z' 930 * digit .= '0'..'9' 931 * idChar .= letter | digit | '_' 932 * SId .= ( letter | '_' ) idChar*</pre> 933 * The characters <code>(</code> and <code>)</code> are used for grouping, the 934 * character <code>*</code> 'zero or more times', and the character 935 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 936 * determined by an exact character sequence match; i.e., comparisons must be 937 * performed in a case-sensitive manner. In addition, there are a few 938 * conditions for the uniqueness of identifiers in an SBML model. Please 939 * consult the SBML specifications for the exact details of the uniqueness 940 * requirements. 941 <p> 942 * @param sid the string to use as the identifier of this {@link Compartment} object. If 943 * the string is <code>null</code>, this method will return 944 * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}. 945 <p> 946 * <p> 947 * @return integer value indicating success/failure of the 948 * function. The possible values 949 * returned by this function are: 950 * <ul> 951 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 952 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 953 * 954 * </ul> <p> 955 * @see #getId() 956 * @see #unsetId() 957 * @see #isSetId() 958 */ public 959 int setId(String sid) { 960 return libsbmlJNI.Compartment_setId(swigCPtr, this, sid); 961 } 962 963 964/** 965 * Sets the value of the 'name' attribute of this {@link Compartment} object. 966 <p> 967 * The string in <code>name</code> is copied. 968 <p> 969 * @param name the new name for the {@link Compartment} object. If the string is 970 * <code>null</code>, this method will return 971 * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}. 972 <p> 973 * <p> 974 * @return integer value indicating success/failure of the 975 * function. The possible values 976 * returned by this function are: 977 * <ul> 978 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 979 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 980 * 981 * </ul> <p> 982 * @see #getName() 983 * @see #isSetName() 984 * @see #unsetName() 985 */ public 986 int setName(String name) { 987 return libsbmlJNI.Compartment_setName(swigCPtr, this, name); 988 } 989 990 991/** 992 * Sets the 'compartmentType' attribute of this {@link Compartment} object. 993 <p> 994 * @param sid the identifier of a {@link CompartmentType} object defined elsewhere 995 * in this {@link Model}. If the string is <code>null</code>, this method will return 996 * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}. 997 <p> 998 * <p> 999 * @return integer value indicating success/failure of the 1000 * function. The possible values 1001 * returned by this function are: 1002 * <ul> 1003 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1004 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1005 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1006 * 1007 * </ul> <p> 1008 * @note The 'compartmentType' attribute is only available in SBML 1009 * Level 2 Versions 2–4. 1010 <p> 1011 * @see #isSetCompartmentType() 1012 * @see #getCompartmentType() 1013 * @see #unsetCompartmentType() 1014 */ public 1015 int setCompartmentType(String sid) { 1016 return libsbmlJNI.Compartment_setCompartmentType(swigCPtr, this, sid); 1017 } 1018 1019 1020/** 1021 * Sets the 'spatialDimensions' attribute of this {@link Compartment} object. 1022 <p> 1023 * @param value a long integereger indicating the number of dimensions 1024 * of this compartment. 1025 <p> 1026 * <p> 1027 * @return integer value indicating success/failure of the 1028 * function. The possible values 1029 * returned by this function are: 1030 * <ul> 1031 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1032 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1033 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1034 * 1035 * </ul> <p> 1036 * @see #getSpatialDimensions() 1037 * @see #isSetSpatialDimensions() 1038 * @see #unsetSpatialDimensions() 1039 */ public 1040 int setSpatialDimensions(long value) { 1041 return libsbmlJNI.Compartment_setSpatialDimensions__SWIG_0(swigCPtr, this, value); 1042 } 1043 1044 1045/** 1046 * Sets the 'spatialDimensions' attribute of this {@link Compartment} object as a double. 1047 <p> 1048 * @param value a double indicating the number of dimensions 1049 * of this compartment. 1050 <p> 1051 * <p> 1052 * @return integer value indicating success/failure of the 1053 * function. The possible values 1054 * returned by this function are: 1055 * <ul> 1056 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1057 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1058 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1059 * 1060 * </ul> <p> 1061 * @see #getSpatialDimensions() 1062 * @see #isSetSpatialDimensions() 1063 * @see #unsetSpatialDimensions() 1064 */ public 1065 int setSpatialDimensions(double value) { 1066 return libsbmlJNI.Compartment_setSpatialDimensions__SWIG_1(swigCPtr, this, value); 1067 } 1068 1069 1070/** 1071 * Sets the 'size' attribute (or 'volume' in SBML Level 1) of this 1072 * {@link Compartment} object. 1073 <p> 1074 * @param value a <code>double</code> representing the size of this compartment 1075 * instance in whatever units are in effect for the compartment. 1076 <p> 1077 * <p> 1078 * @return integer value indicating success/failure of the 1079 * function. The possible values 1080 * returned by this function are: 1081 * <ul> 1082 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1083 * 1084 * </ul> <p> 1085 * @note This method is identical to 1086 * {@link Compartment#setVolume(double value)}. 1087 <p> 1088 * @see #setVolume(double) 1089 * @see #getSize() 1090 * @see #isSetSize() 1091 * @see #unsetSize() 1092 */ public 1093 int setSize(double value) { 1094 return libsbmlJNI.Compartment_setSize(swigCPtr, this, value); 1095 } 1096 1097 1098/** 1099 * Sets the 'volume' attribute (or 'size' in SBML Level 2) of this 1100 * {@link Compartment} object. 1101 <p> 1102 * This method is identical to 1103 * {@link Compartment#setSize(double value)} 1104 * and is provided for compatibility between SBML Level 1 and 1105 * higher Levels of SBML. 1106 <p> 1107 * @param value a <code>double</code> representing the volume of this compartment 1108 * instance in whatever units are in effect for the compartment. 1109 <p> 1110 * <p> 1111 * @return integer value indicating success/failure of the 1112 * function. The possible values 1113 * returned by this function are: 1114 * <ul> 1115 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1116 * 1117 * </ul> <p> 1118 * <p> 1119 * @note The attribute 'volume' only exists by that name in SBML 1120 * Level 1. In Level 2 and above, the equivalent attribute is 1121 * named 'size'. In SBML Level 1, a compartment's volume has a default 1122 * value (<code>1.0</code>) and therefore methods such as 1123 * {@link Compartment#isSetVolume()} 1124 * will always return <code>true</code> for a Level 1 model. In Level 2, a 1125 * compartment's size (the equivalent of SBML Level 1's 'volume') is 1126 * optional and has no default value, and therefore may or may not be set. 1127 <p> 1128 * @see #setSize(double) 1129 * @see #getVolume() 1130 * @see #isSetVolume() 1131 * @see #unsetVolume() 1132 */ public 1133 int setVolume(double value) { 1134 return libsbmlJNI.Compartment_setVolume(swigCPtr, this, value); 1135 } 1136 1137 1138/** 1139 * Sets the 'units' attribute of this {@link Compartment} object. 1140 <p> 1141 * @param sid the identifier of the defined units to use. If <code>sid</code> is 1142 * <code>null</code>, then this method will return 1143 * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}. 1144 <p> 1145 * <p> 1146 * @return integer value indicating success/failure of the 1147 * function. The possible values 1148 * returned by this function are: 1149 * <ul> 1150 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1151 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1152 * 1153 * </ul> <p> 1154 * @see #isSetUnits() 1155 * @see #getUnits() 1156 * @see #unsetUnits() 1157 */ public 1158 int setUnits(String sid) { 1159 return libsbmlJNI.Compartment_setUnits(swigCPtr, this, sid); 1160 } 1161 1162 1163/** 1164 * Sets the 'outside' attribute of this {@link Compartment} object. 1165 <p> 1166 * @param sid the identifier of a compartment that encloses this one. If 1167 * <code>sid</code> is <code>null</code>, then this method will return 1168 * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}. 1169 <p> 1170 * <p> 1171 * @return integer value indicating success/failure of the 1172 * function. The possible values 1173 * returned by this function are: 1174 * <ul> 1175 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1176 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1177 * 1178 * </ul> <p> 1179 * @note The 'outside' attribute is defined in SBML Level 1 and 1180 * Level 2, but does not exist in SBML Level 3 Version 1 1181 * Core. 1182 <p> 1183 * @see #isSetOutside() 1184 * @see #getOutside() 1185 * @see #unsetOutside() 1186 */ public 1187 int setOutside(String sid) { 1188 return libsbmlJNI.Compartment_setOutside(swigCPtr, this, sid); 1189 } 1190 1191 1192/** 1193 * Sets the value of the 'constant' attribute of this {@link Compartment} object. 1194 <p> 1195 * @param value a boolean indicating whether the size/volume of this 1196 * compartment should be considered constant (<code>true</code>) or variable 1197 * (<code>false</code>). 1198 <p> 1199 * <p> 1200 * @return integer value indicating success/failure of the 1201 * function. The possible values 1202 * returned by this function are: 1203 * <ul> 1204 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1205 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1206 * 1207 * </ul> <p> 1208 * @see #isSetConstant() 1209 * @see #getConstant() 1210 */ public 1211 int setConstant(boolean value) { 1212 return libsbmlJNI.Compartment_setConstant(swigCPtr, this, value); 1213 } 1214 1215 1216/** 1217 * <p> 1218 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 1219 * value. 1220 <p> 1221 * <p> 1222 * In SBML, object identifiers are of a data type called <code>SId</code>. 1223 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 1224 * introduced for attribute values that refer to <code>SId</code> values; in 1225 * previous Levels of SBML, this data type did not exist and attributes were 1226 * simply described to as 'referring to an identifier', but the effective 1227 * data type was the same as <code>SIdRef</code>in Level 3. These and 1228 * other methods of libSBML refer to the type <code>SIdRef</code> for all 1229 * Levels of SBML, even if the corresponding SBML specification did not 1230 * explicitly name the data type. 1231 <p> 1232 * This method works by looking at all attributes and (if appropriate) 1233 * mathematical formulas in MathML content, comparing the referenced 1234 * identifiers to the value of <code>oldid</code>. If any matches are found, the 1235 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 1236 * descend into child elements. 1237 <p> 1238 * @param oldid the old identifier 1239 * @param newid the new identifier 1240 */ public 1241 void renameSIdRefs(String oldid, String newid) { 1242 libsbmlJNI.Compartment_renameSIdRefs(swigCPtr, this, oldid, newid); 1243 } 1244 1245 1246/** 1247 * <p> 1248 * Replaces all uses of a given <code>UnitSIdRef</code> type attribute value with 1249 * another value. 1250 <p> 1251 * <p> 1252 * In SBML, unit definitions have identifiers of type <code>UnitSId</code>. In 1253 * SBML Level 3, an explicit data type called <code>UnitSIdRef</code> was 1254 * introduced for attribute values that refer to <code>UnitSId</code> values; in 1255 * previous Levels of SBML, this data type did not exist and attributes were 1256 * simply described to as 'referring to a unit identifier', but the effective 1257 * data type was the same as <code>UnitSIdRef</code> in Level 3. These and 1258 * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all 1259 * Levels of SBML, even if the corresponding SBML specification did not 1260 * explicitly name the data type. 1261 <p> 1262 * This method works by looking at all unit identifier attribute values 1263 * (including, if appropriate, inside mathematical formulas), comparing the 1264 * referenced unit identifiers to the value of <code>oldid</code>. If any matches 1265 * are found, the matching values are replaced with <code>newid</code>. The method 1266 * does <em>not</em> descend into child elements. 1267 <p> 1268 * @param oldid the old identifier 1269 * @param newid the new identifier 1270 */ public 1271 void renameUnitSIdRefs(String oldid, String newid) { 1272 libsbmlJNI.Compartment_renameUnitSIdRefs(swigCPtr, this, oldid, newid); 1273 } 1274 1275 1276/** 1277 * Unsets the value of the 'name' attribute of this {@link Compartment} object. 1278 <p> 1279 * <p> 1280 * @return integer value indicating success/failure of the 1281 * function. The possible values 1282 * returned by this function are: 1283 * <ul> 1284 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1285 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1286 * 1287 * </ul> <p> 1288 * @see #getName() 1289 * @see #setName(String) 1290 * @see #isSetName() 1291 */ public 1292 int unsetName() { 1293 return libsbmlJNI.Compartment_unsetName(swigCPtr, this); 1294 } 1295 1296 1297/** 1298 * Unsets the value of the 'compartmentType' attribute of this {@link Compartment} object. 1299 <p> 1300 * <p> 1301 * @return integer value indicating success/failure of the 1302 * function. The possible values 1303 * returned by this function are: 1304 * <ul> 1305 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1306 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1307 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1308 * 1309 * </ul> <p> 1310 * @note The 'compartmentType' attribute is only available in SBML 1311 * Level 2 Versions 2–4. 1312 <p> 1313 * @see #setCompartmentType(String sid) 1314 * @see #isSetCompartmentType() 1315 * @see #getCompartmentType() 1316 */ public 1317 int unsetCompartmentType() { 1318 return libsbmlJNI.Compartment_unsetCompartmentType(swigCPtr, this); 1319 } 1320 1321 1322/** 1323 * Unsets the value of the 'constant' attribute of this {@link Compartment} object. 1324 <p> 1325 * <p> 1326 * @return integer value indicating success/failure of the 1327 * function. The possible values 1328 * returned by this function are: 1329 * <ul> 1330 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1331 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1332 * 1333 * </ul> <p> 1334 * @see #isSetConstant() 1335 * @see #setConstant(boolean) 1336 * @see #getConstant() 1337 */ public 1338 int unsetConstant() { 1339 return libsbmlJNI.Compartment_unsetConstant(swigCPtr, this); 1340 } 1341 1342 1343/** 1344 * Unsets the value of the 'size' attribute of this {@link Compartment} object. 1345 <p> 1346 * In SBML Level 1, a compartment's volume has a default value ( 1347 * <code>1.0</code>) and therefore <em>should always be set</em>. Calling this method 1348 * on a Level 1 model resets the value to <code>1.0</code> rather than actually 1349 * unsetting it. In Level 2, a compartment's 'size' is optional with 1350 * no default value, and unsetting it will result in the compartment having 1351 * no defined size. 1352 <p> 1353 * <p> 1354 * @return integer value indicating success/failure of the 1355 * function. The possible values 1356 * returned by this function are: 1357 * <ul> 1358 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1359 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1360 * 1361 * </ul> <p> 1362 * @note This method is identical to 1363 * {@link Compartment#unsetVolume()}. 1364 <p> 1365 * @see #unsetVolume() 1366 * @see #getSize() 1367 * @see #isSetSize() 1368 * @see #setSize(double) 1369 */ public 1370 int unsetSize() { 1371 return libsbmlJNI.Compartment_unsetSize(swigCPtr, this); 1372 } 1373 1374 1375/** 1376 * Unsets the value of the 'volume' attribute of this {@link Compartment} object. 1377 <p> 1378 * This method is identical to 1379 * {@link Compartment#unsetSize()}. Please refer 1380 * to that method's documentation for more information about its behavior. 1381 <p> 1382 * <p> 1383 * @return integer value indicating success/failure of the 1384 * function. The possible values 1385 * returned by this function are: 1386 * <ul> 1387 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1388 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1389 * 1390 * </ul> <p> 1391 * <p> 1392 * @note The attribute 'volume' only exists by that name in SBML 1393 * Level 1. In Level 2 and above, the equivalent attribute is 1394 * named 'size'. In SBML Level 1, a compartment's volume has a default 1395 * value (<code>1.0</code>) and therefore methods such as 1396 * {@link Compartment#isSetVolume()} 1397 * will always return <code>true</code> for a Level 1 model. In Level 2, a 1398 * compartment's size (the equivalent of SBML Level 1's 'volume') is 1399 * optional and has no default value, and therefore may or may not be set. 1400 <p> 1401 * @see #unsetSize() 1402 * @see #getVolume() 1403 * @see #setVolume(double) 1404 * @see #isSetVolume() 1405 */ public 1406 int unsetVolume() { 1407 return libsbmlJNI.Compartment_unsetVolume(swigCPtr, this); 1408 } 1409 1410 1411/** 1412 * Unsets the value of the 'units' attribute of this {@link Compartment} object. 1413 <p> 1414 * <p> 1415 * @return integer value indicating success/failure of the 1416 * function. The possible values 1417 * returned by this function are: 1418 * <ul> 1419 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1420 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1421 * 1422 * </ul> <p> 1423 * @see #isSetUnits() 1424 * @see #setUnits(String) 1425 * @see #getUnits() 1426 */ public 1427 int unsetUnits() { 1428 return libsbmlJNI.Compartment_unsetUnits(swigCPtr, this); 1429 } 1430 1431 1432/** 1433 * Unsets the value of the 'outside' attribute of this {@link Compartment} object. 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_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1442 * 1443 * </ul> <p> 1444 * @note The 'outside' attribute is defined in SBML Level 1 and 1445 * Level 2, but does not exist in SBML Level 3 Version 1 1446 * Core. 1447 <p> 1448 * @see #isSetOutside() 1449 * @see #getOutside() 1450 * @see #setOutside(String) 1451 */ public 1452 int unsetOutside() { 1453 return libsbmlJNI.Compartment_unsetOutside(swigCPtr, this); 1454 } 1455 1456 1457/** 1458 * Unsets the value of the 'spatialDimensions' attribute of this 1459 * {@link Compartment} object. 1460 <p> 1461 * In SBML Levels prior to Level 3, compartments must always have a 1462 * value for the number of dimensions. Consequently, calling this method 1463 * on a model of SBML Level 1–2 will result in a return value of 1464 * {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1465 <p> 1466 * <p> 1467 * @return integer value indicating success/failure of the 1468 * function. The possible values 1469 * returned by this function are: 1470 * <ul> 1471 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1472 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1473 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1474 * 1475 * </ul> <p> 1476 * @note This function is only valid for SBML Level 3. 1477 <p> 1478 * @see #getSpatialDimensions() 1479 * @see #isSetSpatialDimensions() 1480 * @see #setSpatialDimensions(long) 1481 */ public 1482 int unsetSpatialDimensions() { 1483 return libsbmlJNI.Compartment_unsetSpatialDimensions(swigCPtr, this); 1484 } 1485 1486 1487/** 1488 * Constructs and returns a {@link UnitDefinition} that corresponds to the units 1489 * of this {@link Compartment} object's designated size. 1490 <p> 1491 * <p> 1492 * Compartments in SBML have an attribute ('units') for declaring the 1493 * units of measurement intended for the value of the compartment's size. In 1494 * the absence of a value given for this attribute, the units are inherited 1495 * from values either defined on the enclosing {@link Model} (in SBML Level 3) 1496 * or in defaults (in SBML Level 2). This method returns a 1497 * {@link UnitDefinition} object 1498 * based on how this compartment's units are interpreted according to the 1499 * relevant SBML guidelines, or it returns <code>null</code> if no units have been 1500 * declared and no defaults are defined by the relevant SBML specification. 1501 <p> 1502 * Note that unit declarations for 1503 * {@link Compartment} objects 1504 * are specified in terms of the <em>identifier</em> of a unit, 1505 * but <em>this</em> method returns an object , 1506 * not a unit identifier. It does this by constructing an appropriate 1507 * {@link UnitDefinition} object. For 1508 * SBML Level 2 models, it will do this even when the value of the 1509 * 'units' attribute is one of the special SBML Level 2 unit identifiers 1510 * <code>'substance'</code>, <code>'volume'</code>, <code>'area'</code>, <code>'length'</code> or <code>'time'.</code> Callers 1511 * may find this useful in conjunction with the helper methods provided by 1512 * the {@link UnitDefinition} 1513 * class for comparing different {@link UnitDefinition} objects. 1514 <p> 1515 * @return a {@link UnitDefinition} that expresses the units of this 1516 * {@link Compartment} object, or <code>null</code> if one cannot be constructed. 1517 <p> 1518 * <p> 1519 * @note The libSBML system for unit analysis depends on the model as a 1520 * whole. In cases where the 1521 * {@link Compartment} object has not 1522 * yet been added to a model, or the model itself is incomplete, unit 1523 * analysis is not possible, and consequently this method will return 1524 * <code>null.</code> 1525 <p> 1526 * @see #isSetUnits() 1527 * @see #getUnits() 1528 */ public 1529 UnitDefinition getDerivedUnitDefinition() { 1530 long cPtr = libsbmlJNI.Compartment_getDerivedUnitDefinition__SWIG_0(swigCPtr, this); 1531 return (cPtr == 0) ? null : new UnitDefinition(cPtr, false); 1532 } 1533 1534 1535/** 1536 * Returns the libSBML type code for this SBML object. 1537 <p> 1538 * <p> 1539 * LibSBML attaches an identifying code to every kind of SBML object. These 1540 * are integer constants known as <em>SBML type codes</em>. The names of all 1541 * the codes begin with the characters <code>SBML_</code>. 1542 * In the Java language interface for libSBML, the 1543 * type codes are defined as static integer constants in the interface class 1544 * {@link libsbmlConstants}. Note that different Level 3 1545 * package plug-ins may use overlapping type codes; to identify the package 1546 * to which a given object belongs, call the <code>getPackageName()</code> 1547 * method on the object. 1548 <p> 1549 * @return the SBML type code for this object: 1550 * {@link libsbmlConstants#SBML_COMPARTMENT SBML_COMPARTMENT} (default). 1551 <p> 1552 * <p> 1553 * @warning <span class='warning'>The specific integer values of the possible 1554 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 1555 * packages, To fully identify the correct code, <strong>it is necessary to 1556 * invoke both getTypeCode() and getPackageName()</strong>.</span> 1557 <p> 1558 * @see #getElementName() 1559 * @see #getPackageName() 1560 */ public 1561 int getTypeCode() { 1562 return libsbmlJNI.Compartment_getTypeCode(swigCPtr, this); 1563 } 1564 1565 1566/** 1567 * Returns the XML element name of this object 1568 <p> 1569 * For {@link Compartment}, the XML element name is always <code>'compartment'.</code> 1570 <p> 1571 * @return the name of this element. 1572 */ public 1573 String getElementName() { 1574 return libsbmlJNI.Compartment_getElementName(swigCPtr, this); 1575 } 1576 1577 1578/** 1579 * Predicate returning <code>true</code> if all the required attributes for this 1580 * {@link Compartment} object have been set. 1581 <p> 1582 * The required attributes for a {@link Compartment} object are: 1583 * <ul> 1584 * <li> 'id' (or 'name' in SBML Level 1) 1585 * <li> 'constant' (in SBML Level 3 only) 1586 * 1587 * </ul> <p> 1588 * @return <code>true</code> if the required attributes have been set, <code>false</code> 1589 * otherwise. 1590 */ public 1591 boolean hasRequiredAttributes() { 1592 return libsbmlJNI.Compartment_hasRequiredAttributes(swigCPtr, this); 1593 } 1594 1595}