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 {@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' is optional, and has a default value of <code>true.</code> In SBML 076 * Level 3, there is no default value for the 'constant' attribute, 077 * and it is required. 078 <p> 079 * <h2>Additional considerations in SBML Level 2</h2> 080 <p> 081 * In SBML Level 2, the default units of compartment size, and the kinds 082 * of units allowed as values of the attribute 'units', interact with the 083 * number of spatial dimensions of the compartment. The value of the 'units' 084 * attribute of a {@link Compartment} object must 085 * be one of the base units (see {@link Unit}), or the predefined unit identifiers 086 * <code>volume</code>, <code>area</code>, <code>length</code> or <code>dimensionless</code>, or a new unit defined by a 087 * {@link UnitDefinition} object in the enclosing 088 * {@link Model}, subject to the restrictions detailed in the following table: 089 <p> 090 * <table border='0' class='centered text-table width80 normal-font alt-row-colors' 091 * style='padding-bottom: 0.5em'> 092 * <caption class='top-caption'>Restrictions on values permitted for 093 * compartment <code>size</code> and <code>units</code> attributes.</caption> 094 * <tr> 095 * <th align='left' valign='bottom'> 096 * Value of<br><code>spatialDimensions</code> 097 * </th> 098 * <th align='left' valign='bottom'> 099 * <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 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 2 Versions 1-3) 153 * or <em>should</em> (in Level 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 2 157 * Versions 1–3) or <em>should</em> (in Level 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 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—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 2 Versions 2–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 3 Core nor in SBML Level 1. 206 <p> 207 * <h2>Additional considerations in SBML Level 3</h2> 208 <p> 209 * One difference between SBML Level 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>"volumeUnits"</td> 265 * <td>units of volume, or <code>dimensionless</code></td> 266 * </tr> 267 * <tr> 268 * <td><code>2</code></td> 269 * <td>"areaUnits"</td> 270 * <td>units of area, or <code>dimensionless</code></td> 271 * </tr> 272 * <tr> 273 * <td><code>1</code></td> 274 * <td>"lengthUnits"</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 1 and Level 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 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 2 do not have any implied spatial relationships between each 343 * other. 344 */ 345 346public class Compartment extends SBase { 347 private long swigCPtr; 348 349 protected Compartment(long cPtr, boolean cMemoryOwn) 350 { 351 super(libsbmlJNI.Compartment_SWIGUpcast(cPtr), cMemoryOwn); 352 swigCPtr = cPtr; 353 } 354 355 protected static long getCPtr(Compartment obj) 356 { 357 return (obj == null) ? 0 : obj.swigCPtr; 358 } 359 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 protected void finalize() { 374 delete(); 375 } 376 377 public synchronized void delete() { 378 if (swigCPtr != 0) { 379 if (swigCMemOwn) { 380 swigCMemOwn = false; 381 libsbmlJNI.delete_Compartment(swigCPtr); 382 } 383 swigCPtr = 0; 384 } 385 super.delete(); 386 } 387 388 389/** 390 * Creates a new {@link Compartment} object using the given SBML <code>level</code> and 391 * <code>version</code> values. 392 <p> 393 * @param level a long integer, the SBML Level to assign to this {@link Compartment}. 394 <p> 395 * @param version a long integer, the SBML Version to assign to this 396 * {@link Compartment}. 397 <p> 398 * <p> 399 * @throws SBMLConstructorException 400 * Thrown if the given <code>level</code> and <code>version</code> combination are invalid 401 * or if this object is incompatible with the given level and version. 402 <p> 403 * <p> 404 * @note Attempting to add an object to an {@link SBMLDocument} having a different 405 * combination of SBML Level, Version and XML namespaces than the object 406 * itself will result in an error at the time a caller attempts to make the 407 * addition. A parent object must have compatible Level, Version and XML 408 * namespaces. (Strictly speaking, a parent may also have more XML 409 * namespaces than a child, but the reverse is not permitted.) The 410 * restriction is necessary to ensure that an SBML model has a consistent 411 * overall structure. This requires callers to manage their objects 412 * carefully, but the benefit is increased flexibility in how models can be 413 * created by permitting callers to create objects bottom-up if desired. In 414 * situations where objects are not yet attached to parents (e.g., 415 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 416 * libSBML determine such things as whether it is valid to assign a 417 * particular value to an attribute. 418 */ public 419 Compartment(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 420 this(libsbmlJNI.new_Compartment__SWIG_0(level, version), true); 421 } 422 423 424/** 425 * Creates a new {@link Compartment} object using the given {@link SBMLNamespaces} object 426 * <code>sbmlns</code>. 427 <p> 428 * <p> 429 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 430 * information. It is used to communicate the SBML Level, Version, and (in 431 * Level 3) packages used in addition to SBML Level 3 Core. A 432 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 433 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object 434 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 435 <p> 436 * It is worth emphasizing that although this constructor does not take an 437 * identifier argument, in SBML Level 2 and beyond, the 'id' 438 * (identifier) attribute of a {@link Compartment} object is required to have a 439 * value. Thus, callers are cautioned to assign a value after calling this 440 * constructor. Setting the identifier can be accomplished using the 441 * method {@link Compartment#setId(String id)}. 442 <p> 443 * @param sbmlns an {@link SBMLNamespaces} object. 444 <p> 445 * <p> 446 * @throws SBMLConstructorException 447 * Thrown if the given <code>sbmlns</code> is inconsistent or incompatible 448 * with this object. 449 <p> 450 * <p> 451 * @note Attempting to add an object to an {@link SBMLDocument} having a different 452 * combination of SBML Level, Version and XML namespaces than the object 453 * itself will result in an error at the time a caller attempts to make the 454 * addition. A parent object must have compatible Level, Version and XML 455 * namespaces. (Strictly speaking, a parent may also have more XML 456 * namespaces than a child, but the reverse is not permitted.) The 457 * restriction is necessary to ensure that an SBML model has a consistent 458 * overall structure. This requires callers to manage their objects 459 * carefully, but the benefit is increased flexibility in how models can be 460 * created by permitting callers to create objects bottom-up if desired. In 461 * situations where objects are not yet attached to parents (e.g., 462 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 463 * libSBML determine such things as whether it is valid to assign a 464 * particular value to an attribute. 465 */ public 466 Compartment(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 467 this(libsbmlJNI.new_Compartment__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 468 } 469 470 471/** 472 * Copy constructor. 473 <p> 474 * This creates a copy of a {@link Compartment} object. 475 <p> 476 * @param orig the {@link Compartment} instance to copy. 477 */ public 478 Compartment(Compartment orig) throws org.sbml.libsbml.SBMLConstructorException { 479 this(libsbmlJNI.new_Compartment__SWIG_2(Compartment.getCPtr(orig), orig), true); 480 } 481 482 483/** 484 * Creates and returns a deep copy of this {@link Compartment} object. 485 <p> 486 * @return the (deep) copy of this {@link Compartment} object. 487 */ public 488 Compartment cloneObject() { 489 long cPtr = libsbmlJNI.Compartment_cloneObject(swigCPtr, this); 490 return (cPtr == 0) ? null : new Compartment(cPtr, true); 491 } 492 493 494/** 495 * Initializes the fields of this {@link Compartment} object to 'typical' default 496 * values. 497 <p> 498 * The SBML {@link Compartment} component has slightly different aspects and 499 * default attribute values in different SBML Levels and Versions. 500 * This method sets the values to certain common defaults, based 501 * mostly on what they are in SBML Level 2. Specifically: 502 <p> 503 * <ul> 504 * <li> Sets attribute 'spatialDimensions' to <code>3</code> 505 * <li> Sets attribute 'constant' to <code>true</code> 506 * <li> (Applies to Level 1 models only) Sets attribute 'volume' to <code>1.0</code> 507 * <li> (Applies to Level 3 models only) Sets attribute 'units' to <code>litre</code> 508 * </ul> 509 */ public 510 void initDefaults() { 511 libsbmlJNI.Compartment_initDefaults(swigCPtr, this); 512 } 513 514 515/** 516 * Returns the value of the 'id' attribute of this {@link Compartment}. 517 <p> 518 * @note Because of the inconsistent behavior of this function with 519 * respect to assignments and rules, it is now recommended to 520 * use the getIdAttribute() function instead. 521 <p> 522 * <p> 523 * The identifier given by an object's 'id' attribute value 524 * is used to identify the object within the SBML model definition. 525 * Other objects can refer to the component using this identifier. The 526 * data type of 'id' is always <code>SId</code> or a type derived 527 * from that, such as <code>UnitSId</code>, depending on the object in 528 * question. All data types are defined as follows: 529 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 530 * letter .= 'a'..'z','A'..'Z' 531 * digit .= '0'..'9' 532 * idChar .= letter | digit | '_' 533 * SId .= ( letter | '_' ) idChar* 534 * </pre> 535 <p> 536 * The characters <code>(</code> and <code>)</code> are used for grouping, the 537 * character <code>*</code> 'zero or more times', and the character 538 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 539 * determined by an exact character sequence match; i.e., comparisons must be 540 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 541 * <code>SIdRef</code>, and derived types. 542 <p> 543 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 544 * moved to {@link SBase} directly, instead of being defined individually for many 545 * (but not all) objects. Libsbml has for a long time provided functions 546 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 547 * would fail or otherwise return empty strings if executed on any object 548 * for which those attributes were not defined. Now that all {@link SBase} objects 549 * define those attributes, those functions now succeed for any object with 550 * the appropriate level and version. 551 <p> 552 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 553 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 554 * functions (though not the setId() or unsetId() functions) would instead 555 * reference the value of the 'variable' attribute (for the rules and event 556 * assignments) or the 'symbol' attribute (for initial assignments). 557 * The {@link AlgebraicRule} fell into this category as well, though because it 558 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 559 * always return an empty string, and isSetId() would always return <code>false.</code> 560 * For this reason, four new functions are now provided 561 * (getIdAttribute(), setIdAttribute(String), 562 * isSetIdAttribute(), and unsetIdAttribute()) that will always 563 * act on the actual 'id' attribute, regardless of the object's type. The 564 * new functions should be used instead of the old ones unless the old behavior 565 * is somehow necessary. 566 <p> 567 * Regardless of the level and version of the SBML, these functions allow 568 * client applications to use more generalized code in some situations 569 * (for instance, when manipulating objects that are all known to have 570 * identifiers). If the object in question does not posess an 'id' attribute 571 * according to the SBML specification for the Level and Version in use, 572 * libSBML will not allow the identifier to be set, nor will it read or 573 * write 'id' attributes for those objects. 574 <p> 575 * @return the id of this {@link Compartment}. 576 <p> 577 * @see #getIdAttribute() 578 * @see #setIdAttribute(String sid) 579 * @see #isSetIdAttribute() 580 * @see #unsetIdAttribute() 581 */ public 582 String getId() { 583 return libsbmlJNI.Compartment_getId(swigCPtr, this); 584 } 585 586 587/** 588 * Returns the value of the 'name' attribute of this {@link Compartment} object. 589 <p> 590 * <p> 591 * <p> 592 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 593 * moved to {@link SBase} directly, instead of being defined individually for many 594 * (but not all) objects. Libsbml has for a long time provided functions 595 * defined on {@link SBase} itself to get, set, and unset those attributes, which 596 * would fail or otherwise return empty strings if executed on any object 597 * for which those attributes were not defined. Now that all {@link SBase} objects 598 * define those attributes, those functions now succeed for any object with 599 * the appropriate level and version. 600 <p> 601 * The 'name' attribute is 602 * optional and is not intended to be used for cross-referencing purposes 603 * within a model. Its purpose instead is to provide a human-readable 604 * label for the component. The data type of 'name' is the type 605 * <code>string</code> defined in XML Schema. SBML imposes no 606 * restrictions as to the content of 'name' attributes beyond those 607 * restrictions defined by the <code>string</code> type in XML Schema. 608 <p> 609 * The recommended practice for handling 'name' is as follows. If a 610 * software tool has the capability for displaying the content of 'name' 611 * attributes, it should display this content to the user as a 612 * component's label instead of the component's 'id'. If the user 613 * interface does not have this capability (e.g., because it cannot 614 * display or use special characters in symbol names), or if the 'name' 615 * attribute is missing on a given component, then the user interface 616 * should display the value of the 'id' attribute instead. (Script 617 * language interpreters are especially likely to display 'id' instead of 618 * 'name'.) 619 <p> 620 * As a consequence of the above, authors of systems that automatically 621 * generate the values of 'id' attributes should be aware some systems 622 * may display the 'id''s to the user. Authors therefore may wish to 623 * take some care to have their software create 'id' values that are: (a) 624 * reasonably easy for humans to type and read; and (b) likely to be 625 * meaningful, for example by making the 'id' attribute be an abbreviated 626 * form of the name attribute value. 627 <p> 628 * An additional point worth mentioning is although there are 629 * restrictions on the uniqueness of 'id' values, there are no 630 * restrictions on the uniqueness of 'name' values in a model. This 631 * allows software applications leeway in assigning component identifiers. 632 <p> 633 * Regardless of the level and version of the SBML, these functions allow 634 * client applications to use more generalized code in some situations 635 * (for instance, when manipulating objects that are all known to have 636 * names). If the object in question does not posess a 'name' attribute 637 * according to the SBML specification for the Level and Version in use, 638 * libSBML will not allow the name to be set, nor will it read or 639 * write 'name' attributes for those objects. 640 <p> 641 * @return the name of this SBML object, or the empty string if not set or unsettable. 642 <p> 643 * @see #getIdAttribute() 644 * @see #isSetName() 645 * @see #setName(String sid) 646 * @see #unsetName() 647 */ public 648 String getName() { 649 return libsbmlJNI.Compartment_getName(swigCPtr, this); 650 } 651 652 653/** 654 * Get the value of the 'compartmentType' attribute of this {@link Compartment} 655 * object. 656 <p> 657 * @return the value of the 'compartmentType' attribute of this 658 * {@link Compartment} object as a string. 659 <p> 660 * @note The 'compartmentType' attribute is only available in SBML 661 * Level 2 Versions 2–4. 662 <p> 663 * @see #isSetCompartmentType() 664 * @see #setCompartmentType(String) 665 * @see #unsetCompartmentType() 666 */ public 667 String getCompartmentType() { 668 return libsbmlJNI.Compartment_getCompartmentType(swigCPtr, this); 669 } 670 671 672/** 673 * Get the number of spatial dimensions of this {@link Compartment} object. 674 <p> 675 * @return the value of the 'spatialDimensions' attribute of this 676 * {@link Compartment} object as a long integereger. 677 <p> 678 * <p> 679 * @note In SBML Level 3, the data type of the 'spatialDimensions' 680 * attribute is <code>double</code>, whereas in Level 2, it is <code>integer.</code> To 681 * avoid backward compatibility issues, libSBML provides two separate methods 682 * for obtaining the value as either an integer or a type <code>double</code>, for 683 * models where it is relevant. 684 <p> 685 * @see #getSpatialDimensionsAsDouble() 686 * @see #setSpatialDimensions(long) 687 * @see #isSetSpatialDimensions() 688 * @see #unsetSpatialDimensions() 689 */ public 690 long getSpatialDimensions() { 691 return libsbmlJNI.Compartment_getSpatialDimensions(swigCPtr, this); 692 } 693 694 695/** 696 * Get the number of spatial dimensions of this {@link Compartment} object, 697 * as a double. 698 <p> 699 * @return the value of the 'spatialDimensions' attribute of this 700 * {@link Compartment} object as a double, or <code>NaN</code> if this model is not in SBML 701 * Level 3 format. 702 <p> 703 * <p> 704 * @note In SBML Level 3, the data type of the 'spatialDimensions' 705 * attribute is <code>double</code>, whereas in Level 2, it is <code>integer.</code> To 706 * avoid backward compatibility issues, libSBML provides two separate methods 707 * for obtaining the value as either an integer or a type <code>double</code>, for 708 * models where it is relevant. 709 <p> 710 * @see #getSpatialDimensions() 711 * @see #setSpatialDimensions(long) 712 * @see #isSetSpatialDimensions() 713 * @see #unsetSpatialDimensions() 714 */ public 715 double getSpatialDimensionsAsDouble() { 716 return libsbmlJNI.Compartment_getSpatialDimensionsAsDouble(swigCPtr, this); 717 } 718 719 720/** 721 * Get the size of this {@link Compartment} object. 722 <p> 723 * <p> 724 * In SBML Level 1, compartments are always three-dimensional 725 * constructs and only have volumes, whereas in SBML Level 2 and higher, 726 * compartments may be other than three-dimensional, and therefore the 727 * 'volume' attribute is named 'size' in Level 2 and above. LibSBML 728 * provides both getSize() and getVolume() 729 * for easier support of different SBML Levels. 730 <p> 731 * @return the value of the 'size' attribute ('volume' in Level 1) of 732 * this {@link Compartment} object as a floating-point number. 733 <p> 734 * @note This method is identical to 735 * {@link Compartment#getVolume()}. 736 <p> 737 * @see #getVolume() 738 * @see #isSetSize() 739 * @see #setSize(double) 740 * @see #unsetSize() 741 */ public 742 double getSize() { 743 return libsbmlJNI.Compartment_getSize(swigCPtr, this); 744 } 745 746 747/** 748 * Get the volume of this {@link Compartment} object. 749 <p> 750 * <p> 751 * In SBML Level 1, compartments are always three-dimensional 752 * constructs and only have volumes, whereas in SBML Level 2 and higher, 753 * compartments may be other than three-dimensional, and therefore the 754 * 'volume' attribute is named 'size' in Level 2 and above. LibSBML 755 * provides both getSize() and getVolume() 756 * for easier support of different SBML Levels. 757 <p> 758 * @return the value of the 'volume' attribute ('size' in Level 2) of 759 * this {@link Compartment} object, as a floating-point number. 760 <p> 761 * <p> 762 * @note The attribute 'volume' only exists by that name in SBML 763 * Level 1. In Level 2 and above, the equivalent attribute is 764 * named 'size'. In SBML Level 1, a compartment's volume has a default 765 * value (<code>1.0</code>) and therefore methods such as 766 * isSetVolume() 767 * will always return <code>true</code> for a Level 1 model. In Level 2, a 768 * compartment's size (the equivalent of SBML Level 1's 'volume') is 769 * optional and has no default value, and therefore may or may not be set. 770 <p> 771 * @note This method is identical to 772 * {@link Compartment#getSize()}. 773 <p> 774 * @see #getSize() 775 * @see #isSetVolume() 776 * @see #setVolume(double) 777 * @see #unsetVolume() 778 */ public 779 double getVolume() { 780 return libsbmlJNI.Compartment_getVolume(swigCPtr, this); 781 } 782 783 784/** 785 * Get the units of this {@link Compartment} object's size. 786 <p> 787 * The value of an SBML compartment's 'units' attribute establishes the 788 * unit of measurement associated with the compartment's size. 789 <p> 790 * @return the value of the 'units' attribute of this {@link Compartment} object, 791 * as a string. An empty string indicates that no units have been assigned 792 * to the value of the size. 793 <p> 794 * <p> 795 * @note There is an important distinction to be made between <em>no units 796 * assigned</em>, and assuming a value without units has any specific unit 797 * such as <code>dimensionless</code>. In SBML, default units are never 798 * attributed to numbers, and numbers without units are not automatically 799 * assumed to have the unit <code>dimensionless</code>. Please consult the 800 * relevant SBML specification document for a more in-depth explanation of 801 * this topic and the SBML unit system. 802 <p> 803 * @see #isSetUnits() 804 * @see #setUnits(String) 805 * @see #unsetUnits() 806 */ public 807 String getUnits() { 808 return libsbmlJNI.Compartment_getUnits(swigCPtr, this); 809 } 810 811 812/** 813 * Get the identifier, if any, of the {@link Compartment} object that is designated 814 * as being outside of <em>this</em> one. 815 <p> 816 * @return the value of the 'outside' attribute of this {@link Compartment} object. 817 <p> 818 * @note The 'outside' attribute is defined in SBML Level 1 and 819 * Level 2, but does not exist in SBML Level 3. 820 <p> 821 * @see #isSetOutside() 822 * @see #setOutside(String) 823 * @see #unsetOutside() 824 */ public 825 String getOutside() { 826 return libsbmlJNI.Compartment_getOutside(swigCPtr, this); 827 } 828 829 830/** 831 * Get the value of the 'constant' attribute of this {@link Compartment} object. 832 <p> 833 * @return <code>true</code> if this {@link Compartment} object's size is flagged as being 834 * constant, <code>false</code> otherwise. 835 <p> 836 * @see #isSetConstant() 837 * @see #setConstant(boolean) 838 */ public 839 boolean getConstant() { 840 return libsbmlJNI.Compartment_getConstant(swigCPtr, this); 841 } 842 843 844/** 845 * Predicate returning <code>true</code> if this {@link Compartment} object's 'id' attribute 846 * is set. 847 <p> 848 * <p> 849 * @note Because of the inconsistent behavior of this function with 850 * respect to assignments and rules, it is now recommended to 851 * use the isSetIdAttribute() function instead. 852 <p> 853 * <p> 854 * The identifier given by an object's 'id' attribute value 855 * is used to identify the object within the SBML model definition. 856 * Other objects can refer to the component using this identifier. The 857 * data type of 'id' is always <code>SId</code> or a type derived 858 * from that, such as <code>UnitSId</code>, depending on the object in 859 * question. All data types are defined as follows: 860 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 861 * letter .= 'a'..'z','A'..'Z' 862 * digit .= '0'..'9' 863 * idChar .= letter | digit | '_' 864 * SId .= ( letter | '_' ) idChar* 865 * </pre> 866 <p> 867 * The characters <code>(</code> and <code>)</code> are used for grouping, the 868 * character <code>*</code> 'zero or more times', and the character 869 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 870 * determined by an exact character sequence match; i.e., comparisons must be 871 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 872 * <code>SIdRef</code>, and derived types. 873 <p> 874 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 875 * moved to {@link SBase} directly, instead of being defined individually for many 876 * (but not all) objects. Libsbml has for a long time provided functions 877 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 878 * would fail or otherwise return empty strings if executed on any object 879 * for which those attributes were not defined. Now that all {@link SBase} objects 880 * define those attributes, those functions now succeed for any object with 881 * the appropriate level and version. 882 <p> 883 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 884 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 885 * functions (though not the setId() or unsetId() functions) would instead 886 * reference the value of the 'variable' attribute (for the rules and event 887 * assignments) or the 'symbol' attribute (for initial assignments). 888 * The {@link AlgebraicRule} fell into this category as well, though because it 889 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 890 * always return an empty string, and isSetId() would always return <code>false.</code> 891 * For this reason, four new functions are now provided 892 * (getIdAttribute(), setIdAttribute(String), 893 * isSetIdAttribute(), and unsetIdAttribute()) that will always 894 * act on the actual 'id' attribute, regardless of the object's type. The 895 * new functions should be used instead of the old ones unless the old behavior 896 * is somehow necessary. 897 <p> 898 * Regardless of the level and version of the SBML, these functions allow 899 * client applications to use more generalized code in some situations 900 * (for instance, when manipulating objects that are all known to have 901 * identifiers). If the object in question does not posess an 'id' attribute 902 * according to the SBML specification for the Level and Version in use, 903 * libSBML will not allow the identifier to be set, nor will it read or 904 * write 'id' attributes for those objects. 905 <p> 906 * @return <code>true</code> if the 'id' attribute of this SBML object is 907 * set, <code>false</code> otherwise. 908 <p> 909 * @see #getIdAttribute() 910 * @see #setIdAttribute(String sid) 911 * @see #unsetIdAttribute() 912 * @see #isSetIdAttribute() 913 */ public 914 boolean isSetId() { 915 return libsbmlJNI.Compartment_isSetId(swigCPtr, this); 916 } 917 918 919/** 920 * Predicate returning <code>true</code> if this {@link Compartment} object's 'name' 921 * attribute is set. 922 <p> 923 * <p> 924 * <p> 925 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 926 * moved to {@link SBase} directly, instead of being defined individually for many 927 * (but not all) objects. Libsbml has for a long time provided functions 928 * defined on {@link SBase} itself to get, set, and unset those attributes, which 929 * would fail or otherwise return empty strings if executed on any object 930 * for which those attributes were not defined. Now that all {@link SBase} objects 931 * define those attributes, those functions now succeed for any object with 932 * the appropriate level and version. 933 <p> 934 * The 'name' attribute is 935 * optional and is not intended to be used for cross-referencing purposes 936 * within a model. Its purpose instead is to provide a human-readable 937 * label for the component. The data type of 'name' is the type 938 * <code>string</code> defined in XML Schema. SBML imposes no 939 * restrictions as to the content of 'name' attributes beyond those 940 * restrictions defined by the <code>string</code> type in XML Schema. 941 <p> 942 * The recommended practice for handling 'name' is as follows. If a 943 * software tool has the capability for displaying the content of 'name' 944 * attributes, it should display this content to the user as a 945 * component's label instead of the component's 'id'. If the user 946 * interface does not have this capability (e.g., because it cannot 947 * display or use special characters in symbol names), or if the 'name' 948 * attribute is missing on a given component, then the user interface 949 * should display the value of the 'id' attribute instead. (Script 950 * language interpreters are especially likely to display 'id' instead of 951 * 'name'.) 952 <p> 953 * As a consequence of the above, authors of systems that automatically 954 * generate the values of 'id' attributes should be aware some systems 955 * may display the 'id''s to the user. Authors therefore may wish to 956 * take some care to have their software create 'id' values that are: (a) 957 * reasonably easy for humans to type and read; and (b) likely to be 958 * meaningful, for example by making the 'id' attribute be an abbreviated 959 * form of the name attribute value. 960 <p> 961 * An additional point worth mentioning is although there are 962 * restrictions on the uniqueness of 'id' values, there are no 963 * restrictions on the uniqueness of 'name' values in a model. This 964 * allows software applications leeway in assigning component identifiers. 965 <p> 966 * Regardless of the level and version of the SBML, these functions allow 967 * client applications to use more generalized code in some situations 968 * (for instance, when manipulating objects that are all known to have 969 * names). If the object in question does not posess a 'name' attribute 970 * according to the SBML specification for the Level and Version in use, 971 * libSBML will not allow the name to be set, nor will it read or 972 * write 'name' attributes for those objects. 973 <p> 974 * @return <code>true</code> if the 'name' attribute of this SBML object is 975 * set, <code>false</code> otherwise. 976 <p> 977 * @see #getName() 978 * @see #setName(String sid) 979 * @see #unsetName() 980 */ public 981 boolean isSetName() { 982 return libsbmlJNI.Compartment_isSetName(swigCPtr, this); 983 } 984 985 986/** 987 * Predicate returning <code>true</code> if this {@link Compartment} object's 988 * 'compartmentType' attribute is set. 989 <p> 990 * @return <code>true</code> if the 'compartmentType' attribute of this {@link Compartment} 991 * is set, <code>false</code> otherwise. 992 <p> 993 * @note The 'compartmentType' attribute is only available in SBML 994 * Level 2 Versions 2–4. 995 <p> 996 * @see #setCompartmentType(String) 997 * @see #getCompartmentType() 998 * @see #unsetCompartmentType() 999 */ public 1000 boolean isSetCompartmentType() { 1001 return libsbmlJNI.Compartment_isSetCompartmentType(swigCPtr, this); 1002 } 1003 1004 1005/** 1006 * Predicate returning <code>true</code> if this {@link Compartment} object's 'size' 1007 * attribute is set. 1008 <p> 1009 * This method is similar but not identical to 1010 * {@link Compartment#isSetVolume()}. The latter 1011 * should be used in the context of SBML Level 1 models instead of 1012 * {@link Compartment#isSetSize()} 1013 * because {@link Compartment#isSetVolume()} 1014 * performs extra processing to take into account the difference in 1015 * default values between SBML Levels 1 and 2. 1016 <p> 1017 * @return <code>true</code> if the 'size' attribute ('volume' in Level 2) of 1018 * this {@link Compartment} object is set, <code>false</code> otherwise. 1019 <p> 1020 * @see #isSetVolume() 1021 * @see #setSize(double) 1022 * @see #getSize() 1023 * @see #unsetSize() 1024 */ public 1025 boolean isSetSize() { 1026 return libsbmlJNI.Compartment_isSetSize(swigCPtr, this); 1027 } 1028 1029 1030/** 1031 * Predicate returning <code>true</code> if this {@link Compartment} object's 'volume' 1032 * attribute is set. 1033 <p> 1034 * This method is similar but not identical to 1035 * {@link Compartment#isSetSize()}. The latter 1036 * should not be used in the context of SBML Level 1 models because the 1037 * present method performs extra processing to take into account 1038 * the difference in default values between SBML Levels 1 and 2. 1039 <p> 1040 * @return <code>true</code> if the 'volume' attribute ('size' in Level 2 and 1041 * above) of this {@link Compartment} object is set, <code>false</code> otherwise. 1042 <p> 1043 * <p> 1044 * @note The attribute 'volume' only exists by that name in SBML 1045 * Level 1. In Level 2 and above, the equivalent attribute is 1046 * named 'size'. In SBML Level 1, a compartment's volume has a default 1047 * value (<code>1.0</code>) and therefore methods such as 1048 * isSetVolume() 1049 * will always return <code>true</code> for a Level 1 model. In Level 2, a 1050 * compartment's size (the equivalent of SBML Level 1's 'volume') is 1051 * optional and has no default value, and therefore may or may not be set. 1052 <p> 1053 * @see #isSetSize() 1054 * @see #getVolume() 1055 * @see #setVolume(double) 1056 * @see #unsetVolume() 1057 */ public 1058 boolean isSetVolume() { 1059 return libsbmlJNI.Compartment_isSetVolume(swigCPtr, this); 1060 } 1061 1062 1063/** 1064 * Predicate returning <code>true</code> if this {@link Compartment} object's 'units' 1065 * attribute is set. 1066 <p> 1067 * @return <code>true</code> if the 'units' attribute of this {@link Compartment} object is 1068 * set, <code>false</code> otherwise. 1069 <p> 1070 * <p> 1071 * @note There is an important distinction to be made between <em>no units 1072 * assigned</em>, and assuming a value without units has any specific unit 1073 * such as <code>dimensionless</code>. In SBML, default units are never 1074 * attributed to numbers, and numbers without units are not automatically 1075 * assumed to have the unit <code>dimensionless</code>. Please consult the 1076 * relevant SBML specification document for a more in-depth explanation of 1077 * this topic and the SBML unit system. 1078 <p> 1079 * @see #setUnits(String) 1080 * @see #getUnits() 1081 * @see #unsetUnits() 1082 */ public 1083 boolean isSetUnits() { 1084 return libsbmlJNI.Compartment_isSetUnits(swigCPtr, this); 1085 } 1086 1087 1088/** 1089 * Predicate returning <code>true</code> if this {@link Compartment} object's 'outside' 1090 * attribute is set. 1091 <p> 1092 * @return <code>true</code> if the 'outside' attribute of this {@link Compartment} object is 1093 * set, <code>false</code> otherwise. 1094 <p> 1095 * @note The 'outside' attribute is defined in SBML Level 1 and 1096 * Level 2, but does not exist in SBML Level 3. 1097 <p> 1098 * @see #getOutside() 1099 * @see #setOutside(String) 1100 * @see #unsetOutside() 1101 */ public 1102 boolean isSetOutside() { 1103 return libsbmlJNI.Compartment_isSetOutside(swigCPtr, this); 1104 } 1105 1106 1107/** 1108 * Predicate returning <code>true</code> if this {@link Compartment} object's 1109 * 'spatialDimensions' attribute is set. 1110 <p> 1111 * @return <code>true</code> if the 'spatialDimensions' attribute of this 1112 * {@link Compartment} object is set, <code>false</code> otherwise. 1113 <p> 1114 * @see #getSpatialDimensions() 1115 * @see #setSpatialDimensions(long) 1116 * @see #unsetSpatialDimensions() 1117 */ public 1118 boolean isSetSpatialDimensions() { 1119 return libsbmlJNI.Compartment_isSetSpatialDimensions(swigCPtr, this); 1120 } 1121 1122 1123/** 1124 * Predicate returning <code>true</code> if this {@link Compartment} object's 'constant' 1125 * attribute is set. 1126 <p> 1127 * @return <code>true</code> if the 'constant' attribute of this {@link Compartment} object is 1128 * set, <code>false</code> otherwise. 1129 <p> 1130 * @see #getConstant() 1131 * @see #setConstant(boolean) 1132 */ public 1133 boolean isSetConstant() { 1134 return libsbmlJNI.Compartment_isSetConstant(swigCPtr, this); 1135 } 1136 1137 1138/** 1139 * Sets the value of the 'id' attribute of this {@link Compartment} object. 1140 <p> 1141 * The string <code>sid</code> is copied. 1142 <p> 1143 * <p> 1144 * The identifier given by an object's 'id' attribute value 1145 * is used to identify the object within the SBML model definition. 1146 * Other objects can refer to the component using this identifier. The 1147 * data type of 'id' is always <code>SId</code> or a type derived 1148 * from that, such as <code>UnitSId</code>, depending on the object in 1149 * question. All data types are defined as follows: 1150 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 1151 * letter .= 'a'..'z','A'..'Z' 1152 * digit .= '0'..'9' 1153 * idChar .= letter | digit | '_' 1154 * SId .= ( letter | '_' ) idChar* 1155 * </pre> 1156 <p> 1157 * The characters <code>(</code> and <code>)</code> are used for grouping, the 1158 * character <code>*</code> 'zero or more times', and the character 1159 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 1160 * determined by an exact character sequence match; i.e., comparisons must be 1161 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 1162 * <code>SIdRef</code>, and derived types. 1163 <p> 1164 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 1165 * moved to {@link SBase} directly, instead of being defined individually for many 1166 * (but not all) objects. Libsbml has for a long time provided functions 1167 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 1168 * would fail or otherwise return empty strings if executed on any object 1169 * for which those attributes were not defined. Now that all {@link SBase} objects 1170 * define those attributes, those functions now succeed for any object with 1171 * the appropriate level and version. 1172 <p> 1173 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 1174 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 1175 * functions (though not the setId() or unsetId() functions) would instead 1176 * reference the value of the 'variable' attribute (for the rules and event 1177 * assignments) or the 'symbol' attribute (for initial assignments). 1178 * The {@link AlgebraicRule} fell into this category as well, though because it 1179 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 1180 * always return an empty string, and isSetId() would always return <code>false.</code> 1181 * For this reason, four new functions are now provided 1182 * (getIdAttribute(), setIdAttribute(String), 1183 * isSetIdAttribute(), and unsetIdAttribute()) that will always 1184 * act on the actual 'id' attribute, regardless of the object's type. The 1185 * new functions should be used instead of the old ones unless the old behavior 1186 * is somehow necessary. 1187 <p> 1188 * Regardless of the level and version of the SBML, these functions allow 1189 * client applications to use more generalized code in some situations 1190 * (for instance, when manipulating objects that are all known to have 1191 * identifiers). If the object in question does not posess an 'id' attribute 1192 * according to the SBML specification for the Level and Version in use, 1193 * libSBML will not allow the identifier to be set, nor will it read or 1194 * write 'id' attributes for those objects. 1195 <p> 1196 * @param sid the string to use as the identifier of this {@link Compartment} object. If 1197 * the string is <code>null</code>, this method will return 1198 * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}. 1199 <p> 1200 * <p> 1201 * @return integer value indicating success/failure of the 1202 * function. The possible values 1203 * returned by this function are: 1204 * <ul> 1205 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1206 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1207 * 1208 * </ul> <p> 1209 * @see #getId() 1210 * @see #unsetId() 1211 * @see #isSetId() 1212 */ public 1213 int setId(String sid) { 1214 return libsbmlJNI.Compartment_setId(swigCPtr, this, sid); 1215 } 1216 1217 1218/** 1219 * Sets the value of the 'name' attribute of this {@link Compartment} object. 1220 <p> 1221 * <p> 1222 * The string in <code>name</code> is copied. 1223 <p> 1224 * @param name the new name for the SBML object. 1225 <p> 1226 * <p> 1227 * @return integer value indicating success/failure of the 1228 * function. The possible values 1229 * returned by this function are: 1230 * <ul> 1231 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1232 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1233 * 1234 * </ul> 1235 */ public 1236 int setName(String name) { 1237 return libsbmlJNI.Compartment_setName(swigCPtr, this, name); 1238 } 1239 1240 1241/** 1242 * Sets the 'compartmentType' attribute of this {@link Compartment} object. 1243 <p> 1244 * @param sid the identifier of a {@link CompartmentType} object defined elsewhere 1245 * in this {@link Model}. If the string is <code>null</code>, this method will return 1246 * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}. 1247 <p> 1248 * <p> 1249 * @return integer value indicating success/failure of the 1250 * function. The possible values 1251 * returned by this function are: 1252 * <ul> 1253 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1254 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1255 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1256 * 1257 * </ul> <p> 1258 * @note The 'compartmentType' attribute is only available in SBML 1259 * Level 2 Versions 2–4. 1260 <p> 1261 * @see #isSetCompartmentType() 1262 * @see #getCompartmentType() 1263 * @see #unsetCompartmentType() 1264 */ public 1265 int setCompartmentType(String sid) { 1266 return libsbmlJNI.Compartment_setCompartmentType(swigCPtr, this, sid); 1267 } 1268 1269 1270/** 1271 * Sets the 'spatialDimensions' attribute of this {@link Compartment} object. 1272 <p> 1273 * @param value a long integereger indicating the number of dimensions 1274 * of this compartment. 1275 <p> 1276 * <p> 1277 * @return integer value indicating success/failure of the 1278 * function. The possible values 1279 * returned by this function are: 1280 * <ul> 1281 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1282 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1283 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1284 * 1285 * </ul> <p> 1286 * @see #getSpatialDimensions() 1287 * @see #isSetSpatialDimensions() 1288 * @see #unsetSpatialDimensions() 1289 */ public 1290 int setSpatialDimensions(long value) { 1291 return libsbmlJNI.Compartment_setSpatialDimensions__SWIG_0(swigCPtr, this, value); 1292 } 1293 1294 1295/** 1296 * Sets the 'spatialDimensions' attribute of this {@link Compartment} object as a double. 1297 <p> 1298 * @param value a double indicating the number of dimensions 1299 * of this compartment. 1300 <p> 1301 * <p> 1302 * @return integer value indicating success/failure of the 1303 * function. The possible values 1304 * returned by this function are: 1305 * <ul> 1306 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1307 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1308 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1309 * 1310 * </ul> <p> 1311 * @see #getSpatialDimensions() 1312 * @see #isSetSpatialDimensions() 1313 * @see #unsetSpatialDimensions() 1314 */ public 1315 int setSpatialDimensions(double value) { 1316 return libsbmlJNI.Compartment_setSpatialDimensions__SWIG_1(swigCPtr, this, value); 1317 } 1318 1319 1320/** 1321 * Sets the 'size' attribute (or 'volume' in SBML Level 1) of this 1322 * {@link Compartment} object. 1323 <p> 1324 * @param value a <code>double</code> representing the size of this compartment 1325 * instance in whatever units are in effect for the compartment. 1326 <p> 1327 * <p> 1328 * @return integer value indicating success/failure of the 1329 * function. This particular 1330 * function only does one thing irrespective of user input or 1331 * object state, and thus will only return a single value: 1332 * <ul> 1333 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1334 * 1335 * </ul> <p> 1336 * @note This method is identical to 1337 * {@link Compartment#setVolume(double value)}. 1338 <p> 1339 * @see #setVolume(double) 1340 * @see #getSize() 1341 * @see #isSetSize() 1342 * @see #unsetSize() 1343 */ public 1344 int setSize(double value) { 1345 return libsbmlJNI.Compartment_setSize(swigCPtr, this, value); 1346 } 1347 1348 1349/** 1350 * Sets the 'volume' attribute (or 'size' in SBML Level 2) of this 1351 * {@link Compartment} object. 1352 <p> 1353 * This method is identical to 1354 * {@link Compartment#setSize(double value)} 1355 * and is provided for compatibility between SBML Level 1 and 1356 * higher Levels of SBML. 1357 <p> 1358 * @param value a <code>double</code> representing the volume of this compartment 1359 * instance in whatever units are in effect for the compartment. 1360 <p> 1361 * <p> 1362 * @return integer value indicating success/failure of the 1363 * function. This particular 1364 * function only does one thing irrespective of user input or 1365 * object state, and thus will only return a single value: 1366 * <ul> 1367 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1368 * 1369 * </ul> <p> 1370 * <p> 1371 * @note The attribute 'volume' only exists by that name in SBML 1372 * Level 1. In Level 2 and above, the equivalent attribute is 1373 * named 'size'. In SBML Level 1, a compartment's volume has a default 1374 * value (<code>1.0</code>) and therefore methods such as 1375 * isSetVolume() 1376 * will always return <code>true</code> for a Level 1 model. In Level 2, a 1377 * compartment's size (the equivalent of SBML Level 1's 'volume') is 1378 * optional and has no default value, and therefore may or may not be set. 1379 <p> 1380 * @see #setSize(double) 1381 * @see #getVolume() 1382 * @see #isSetVolume() 1383 * @see #unsetVolume() 1384 */ public 1385 int setVolume(double value) { 1386 return libsbmlJNI.Compartment_setVolume(swigCPtr, this, value); 1387 } 1388 1389 1390/** 1391 * Sets the 'units' attribute of this {@link Compartment} object. 1392 <p> 1393 * @param sid the identifier of the defined units to use. If <code>sid</code> is 1394 * <code>null</code>, then this method will return 1395 * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}. 1396 <p> 1397 * <p> 1398 * @return integer value indicating success/failure of the 1399 * function. The possible values 1400 * returned by this function are: 1401 * <ul> 1402 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1403 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1404 * 1405 * </ul> <p> 1406 * @see #isSetUnits() 1407 * @see #getUnits() 1408 * @see #unsetUnits() 1409 */ public 1410 int setUnits(String sid) { 1411 return libsbmlJNI.Compartment_setUnits(swigCPtr, this, sid); 1412 } 1413 1414 1415/** 1416 * Sets the 'outside' attribute of this {@link Compartment} object. 1417 <p> 1418 * @param sid the identifier of a compartment that encloses this one. If 1419 * <code>sid</code> is <code>null</code>, then this method will return 1420 * {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}. 1421 <p> 1422 * <p> 1423 * @return integer value indicating success/failure of the 1424 * function. The possible values 1425 * returned by this function are: 1426 * <ul> 1427 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1428 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1429 * 1430 * </ul> <p> 1431 * @note The 'outside' attribute is defined in SBML Level 1 and 1432 * Level 2, but does not exist in SBML Level 3. 1433 <p> 1434 * @see #isSetOutside() 1435 * @see #getOutside() 1436 * @see #unsetOutside() 1437 */ public 1438 int setOutside(String sid) { 1439 return libsbmlJNI.Compartment_setOutside(swigCPtr, this, sid); 1440 } 1441 1442 1443/** 1444 * Sets the value of the 'constant' attribute of this {@link Compartment} object. 1445 <p> 1446 * @param value a boolean indicating whether the size/volume of this 1447 * compartment should be considered constant (<code>true</code>) or variable 1448 * (<code>false</code>). 1449 <p> 1450 * <p> 1451 * @return integer value indicating success/failure of the 1452 * function. The possible values 1453 * returned by this function are: 1454 * <ul> 1455 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1456 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1457 * 1458 * </ul> <p> 1459 * @see #isSetConstant() 1460 * @see #getConstant() 1461 */ public 1462 int setConstant(boolean value) { 1463 return libsbmlJNI.Compartment_setConstant(swigCPtr, this, value); 1464 } 1465 1466 1467/** 1468 * <p> 1469 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 1470 * value. 1471 <p> 1472 * <p> 1473 * In SBML, object identifiers are of a data type called <code>SId</code>. 1474 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 1475 * introduced for attribute values that refer to <code>SId</code> values; in 1476 * previous Levels of SBML, this data type did not exist and attributes were 1477 * simply described to as 'referring to an identifier', but the effective 1478 * data type was the same as <code>SIdRef</code> in Level 3. These and 1479 * other methods of libSBML refer to the type <code>SIdRef</code> for all 1480 * Levels of SBML, even if the corresponding SBML specification did not 1481 * explicitly name the data type. 1482 <p> 1483 * This method works by looking at all attributes and (if appropriate) 1484 * mathematical formulas in MathML content, comparing the referenced 1485 * identifiers to the value of <code>oldid</code>. If any matches are found, the 1486 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 1487 * descend into child elements. 1488 <p> 1489 * @param oldid the old identifier. 1490 * @param newid the new identifier. 1491 */ public 1492 void renameSIdRefs(String oldid, String newid) { 1493 libsbmlJNI.Compartment_renameSIdRefs(swigCPtr, this, oldid, newid); 1494 } 1495 1496 1497/** 1498 * <p> 1499 * Replaces all uses of a given <code>UnitSIdRef</code> type attribute value with 1500 * another value. 1501 <p> 1502 * <p> 1503 * In SBML, unit definitions have identifiers of type <code>UnitSId</code>. In 1504 * SBML Level 3, an explicit data type called <code>UnitSIdRef</code> was 1505 * introduced for attribute values that refer to <code>UnitSId</code> values; in 1506 * previous Levels of SBML, this data type did not exist and attributes were 1507 * simply described to as 'referring to a unit identifier', but the effective 1508 * data type was the same as <code>UnitSIdRef</code> in Level 3. These and 1509 * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all 1510 * Levels of SBML, even if the corresponding SBML specification did not 1511 * explicitly name the data type. 1512 <p> 1513 * This method works by looking at all unit identifier attribute values 1514 * (including, if appropriate, inside mathematical formulas), comparing the 1515 * referenced unit identifiers to the value of <code>oldid</code>. If any matches 1516 * are found, the matching values are replaced with <code>newid</code>. The method 1517 * does <em>not</em> descend into child elements. 1518 <p> 1519 * @param oldid the old identifier. 1520 * @param newid the new identifier. 1521 */ public 1522 void renameUnitSIdRefs(String oldid, String newid) { 1523 libsbmlJNI.Compartment_renameUnitSIdRefs(swigCPtr, this, oldid, newid); 1524 } 1525 1526 1527/** 1528 * Unsets the value of the 'name' attribute of this {@link Compartment} object. 1529 <p> 1530 * <p> 1531 * <p> 1532 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 1533 * moved to {@link SBase} directly, instead of being defined individually for many 1534 * (but not all) objects. Libsbml has for a long time provided functions 1535 * defined on {@link SBase} itself to get, set, and unset those attributes, which 1536 * would fail or otherwise return empty strings if executed on any object 1537 * for which those attributes were not defined. Now that all {@link SBase} objects 1538 * define those attributes, those functions now succeed for any object with 1539 * the appropriate level and version. 1540 <p> 1541 * The 'name' attribute is 1542 * optional and is not intended to be used for cross-referencing purposes 1543 * within a model. Its purpose instead is to provide a human-readable 1544 * label for the component. The data type of 'name' is the type 1545 * <code>string</code> defined in XML Schema. SBML imposes no 1546 * restrictions as to the content of 'name' attributes beyond those 1547 * restrictions defined by the <code>string</code> type in XML Schema. 1548 <p> 1549 * The recommended practice for handling 'name' is as follows. If a 1550 * software tool has the capability for displaying the content of 'name' 1551 * attributes, it should display this content to the user as a 1552 * component's label instead of the component's 'id'. If the user 1553 * interface does not have this capability (e.g., because it cannot 1554 * display or use special characters in symbol names), or if the 'name' 1555 * attribute is missing on a given component, then the user interface 1556 * should display the value of the 'id' attribute instead. (Script 1557 * language interpreters are especially likely to display 'id' instead of 1558 * 'name'.) 1559 <p> 1560 * As a consequence of the above, authors of systems that automatically 1561 * generate the values of 'id' attributes should be aware some systems 1562 * may display the 'id''s to the user. Authors therefore may wish to 1563 * take some care to have their software create 'id' values that are: (a) 1564 * reasonably easy for humans to type and read; and (b) likely to be 1565 * meaningful, for example by making the 'id' attribute be an abbreviated 1566 * form of the name attribute value. 1567 <p> 1568 * An additional point worth mentioning is although there are 1569 * restrictions on the uniqueness of 'id' values, there are no 1570 * restrictions on the uniqueness of 'name' values in a model. This 1571 * allows software applications leeway in assigning component identifiers. 1572 <p> 1573 * Regardless of the level and version of the SBML, these functions allow 1574 * client applications to use more generalized code in some situations 1575 * (for instance, when manipulating objects that are all known to have 1576 * names). If the object in question does not posess a 'name' attribute 1577 * according to the SBML specification for the Level and Version in use, 1578 * libSBML will not allow the name to be set, nor will it read or 1579 * write 'name' attributes for those objects. 1580 <p> 1581 * <p> 1582 * @return integer value indicating success/failure of the 1583 * function. The possible values 1584 * returned by this function are: 1585 * <ul> 1586 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1587 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1588 * 1589 * </ul> <p> 1590 * @see #getName() 1591 * @see #setName(String sid) 1592 * @see #isSetName() 1593 */ public 1594 int unsetName() { 1595 return libsbmlJNI.Compartment_unsetName(swigCPtr, this); 1596 } 1597 1598 1599/** 1600 * Unsets the value of the 'compartmentType' attribute of this {@link Compartment} object. 1601 <p> 1602 * <p> 1603 * @return integer value indicating success/failure of the 1604 * function. The possible values 1605 * returned by this function are: 1606 * <ul> 1607 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1608 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1609 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1610 * 1611 * </ul> <p> 1612 * @note The 'compartmentType' attribute is only available in SBML 1613 * Level 2 Versions 2–4. 1614 <p> 1615 * @see #setCompartmentType(String) 1616 * @see #isSetCompartmentType() 1617 * @see #getCompartmentType() 1618 */ public 1619 int unsetCompartmentType() { 1620 return libsbmlJNI.Compartment_unsetCompartmentType(swigCPtr, this); 1621 } 1622 1623 1624/** 1625 * Unsets the value of the 'constant' attribute of this {@link Compartment} object. 1626 <p> 1627 * <p> 1628 * @return integer value indicating success/failure of the 1629 * function. The possible values 1630 * returned by this function are: 1631 * <ul> 1632 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1633 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1634 * 1635 * </ul> <p> 1636 * @see #isSetConstant() 1637 * @see #setConstant(boolean) 1638 * @see #getConstant() 1639 */ public 1640 int unsetConstant() { 1641 return libsbmlJNI.Compartment_unsetConstant(swigCPtr, this); 1642 } 1643 1644 1645/** 1646 * Unsets the value of the 'size' attribute of this {@link Compartment} object. 1647 <p> 1648 * In SBML Level 1, a compartment's volume has a default value ( 1649 * <code>1.0</code>) and therefore <em>should always be set</em>. Calling this method 1650 * on a Level 1 model resets the value to <code>1.0</code> rather than actually 1651 * unsetting it. In Level 2, a compartment's 'size' is optional with 1652 * no default value, and unsetting it will result in the compartment having 1653 * no defined size. 1654 <p> 1655 * <p> 1656 * @return integer value indicating success/failure of the 1657 * function. The possible values 1658 * returned by this function are: 1659 * <ul> 1660 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1661 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1662 * 1663 * </ul> <p> 1664 * @note This method is identical to 1665 * {@link Compartment#unsetVolume()}. 1666 <p> 1667 * @see #unsetVolume() 1668 * @see #getSize() 1669 * @see #isSetSize() 1670 * @see #setSize(double) 1671 */ public 1672 int unsetSize() { 1673 return libsbmlJNI.Compartment_unsetSize(swigCPtr, this); 1674 } 1675 1676 1677/** 1678 * Unsets the value of the 'volume' attribute of this {@link Compartment} object. 1679 <p> 1680 * This method is identical to 1681 * {@link Compartment#unsetSize()}. Please refer 1682 * to that method's documentation for more information about its behavior. 1683 <p> 1684 * <p> 1685 * @return integer value indicating success/failure of the 1686 * function. The possible values 1687 * returned by this function are: 1688 * <ul> 1689 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1690 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1691 * 1692 * </ul> <p> 1693 * <p> 1694 * @note The attribute 'volume' only exists by that name in SBML 1695 * Level 1. In Level 2 and above, the equivalent attribute is 1696 * named 'size'. In SBML Level 1, a compartment's volume has a default 1697 * value (<code>1.0</code>) and therefore methods such as 1698 * isSetVolume() 1699 * will always return <code>true</code> for a Level 1 model. In Level 2, a 1700 * compartment's size (the equivalent of SBML Level 1's 'volume') is 1701 * optional and has no default value, and therefore may or may not be set. 1702 <p> 1703 * @see #unsetSize() 1704 * @see #getVolume() 1705 * @see #setVolume(double) 1706 * @see #isSetVolume() 1707 */ public 1708 int unsetVolume() { 1709 return libsbmlJNI.Compartment_unsetVolume(swigCPtr, this); 1710 } 1711 1712 1713/** 1714 * Unsets the value of the 'units' attribute of this {@link Compartment} object. 1715 <p> 1716 * <p> 1717 * @return integer value indicating success/failure of the 1718 * function. The possible values 1719 * returned by this function are: 1720 * <ul> 1721 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1722 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1723 * 1724 * </ul> <p> 1725 * @see #isSetUnits() 1726 * @see #setUnits(String) 1727 * @see #getUnits() 1728 */ public 1729 int unsetUnits() { 1730 return libsbmlJNI.Compartment_unsetUnits(swigCPtr, this); 1731 } 1732 1733 1734/** 1735 * Unsets the value of the 'outside' attribute of this {@link Compartment} object. 1736 <p> 1737 * <p> 1738 * @return integer value indicating success/failure of the 1739 * function. The possible values 1740 * returned by this function are: 1741 * <ul> 1742 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1743 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1744 * 1745 * </ul> <p> 1746 * @note The 'outside' attribute is defined in SBML Level 1 and 1747 * Level 2, but does not exist in SBML Level 3. 1748 <p> 1749 * @see #isSetOutside() 1750 * @see #getOutside() 1751 * @see #setOutside(String) 1752 */ public 1753 int unsetOutside() { 1754 return libsbmlJNI.Compartment_unsetOutside(swigCPtr, this); 1755 } 1756 1757 1758/** 1759 * Unsets the value of the 'spatialDimensions' attribute of this 1760 * {@link Compartment} object. 1761 <p> 1762 * In SBML Levels prior to Level 3, compartments must always have a 1763 * value for the number of dimensions. Consequently, calling this method 1764 * on a model of SBML Level 1–2 will result in a return value of 1765 * {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1766 <p> 1767 * <p> 1768 * @return integer value indicating success/failure of the 1769 * function. The possible values 1770 * returned by this function are: 1771 * <ul> 1772 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1773 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1774 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 1775 * 1776 * </ul> <p> 1777 * @note This function is only valid for SBML Level 3. 1778 <p> 1779 * @see #getSpatialDimensions() 1780 * @see #isSetSpatialDimensions() 1781 * @see #setSpatialDimensions(long) 1782 */ public 1783 int unsetSpatialDimensions() { 1784 return libsbmlJNI.Compartment_unsetSpatialDimensions(swigCPtr, this); 1785 } 1786 1787 1788/** 1789 * Constructs and returns a {@link UnitDefinition} that corresponds to the units 1790 * of this {@link Compartment} object's designated size. 1791 <p> 1792 * <p> 1793 * Compartments in SBML have an attribute ('units') for declaring the 1794 * units of measurement intended for the value of the compartment's size. In 1795 * the absence of a value given for this attribute, the units are inherited 1796 * from values either defined on the enclosing {@link Model} (in SBML Level 3) 1797 * or in defaults (in SBML Level 2). This method returns a 1798 * {@link UnitDefinition} object 1799 * based on how this compartment's units are interpreted according to the 1800 * relevant SBML guidelines, or it returns <code>null</code> if no units have been 1801 * declared and no defaults are defined by the relevant SBML specification. 1802 <p> 1803 * Note that unit declarations for 1804 * {@link Compartment} objects 1805 * are specified in terms of the <em>identifier</em> of a unit, 1806 * but <em>this</em> method returns an object , 1807 * not a unit identifier. It does this by constructing an appropriate 1808 * {@link UnitDefinition} object. For 1809 * SBML Level 2 models, it will do this even when the value of the 1810 * 'units' attribute is one of the special SBML Level 2 unit identifiers 1811 * <code>'substance'</code>, <code>'volume'</code>, <code>'area'</code>, <code>'length'</code> or <code>'time'.</code> Callers 1812 * may find this useful in conjunction with the helper methods provided by 1813 * the {@link UnitDefinition} 1814 * class for comparing different {@link UnitDefinition} objects. 1815 <p> 1816 * @return a {@link UnitDefinition} that expresses the units of this 1817 * {@link Compartment} object, or <code>null</code> if one cannot be constructed. 1818 <p> 1819 * <p> 1820 * @note The libSBML system for unit analysis depends on the model as a 1821 * whole. In cases where the 1822 * {@link Compartment} object has not 1823 * yet been added to a model, or the model itself is incomplete, unit 1824 * analysis is not possible, and consequently this method will return 1825 * <code>null.</code> 1826 <p> 1827 * @see #isSetUnits() 1828 * @see #getUnits() 1829 */ public 1830 UnitDefinition getDerivedUnitDefinition() { 1831 long cPtr = libsbmlJNI.Compartment_getDerivedUnitDefinition__SWIG_0(swigCPtr, this); 1832 return (cPtr == 0) ? null : new UnitDefinition(cPtr, false); 1833 } 1834 1835 1836/** 1837 * Returns the libSBML type code for this SBML object. 1838 <p> 1839 * <p> 1840 * LibSBML attaches an identifying code to every kind of SBML object. These 1841 * are integer constants known as <em>SBML type codes</em>. The names of all 1842 * the codes begin with the characters <code>SBML_</code>. 1843 * In the Java language interface for libSBML, the 1844 * type codes are defined as static integer constants in the interface class 1845 * {@link libsbmlConstants}. Note that different Level 3 1846 * package plug-ins may use overlapping type codes; to identify the package 1847 * to which a given object belongs, call the <code>getPackageName()</code> 1848 * method on the object. 1849 <p> 1850 * @return the SBML type code for this object: 1851 * {@link libsbmlConstants#SBML_COMPARTMENT SBML_COMPARTMENT} (default). 1852 <p> 1853 * <p> 1854 * @warning <span class='warning'>The specific integer values of the possible 1855 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 1856 * packages, To fully identify the correct code, <strong>it is necessary to 1857 * invoke both getTypeCode() and getPackageName()</strong>.</span> 1858 <p> 1859 * @see #getElementName() 1860 * @see #getPackageName() 1861 */ public 1862 int getTypeCode() { 1863 return libsbmlJNI.Compartment_getTypeCode(swigCPtr, this); 1864 } 1865 1866 1867/** 1868 * Returns the XML element name of this object 1869 <p> 1870 * For {@link Compartment}, the XML element name is always <code>'compartment'.</code> 1871 <p> 1872 * @return the name of this element. 1873 */ public 1874 String getElementName() { 1875 return libsbmlJNI.Compartment_getElementName(swigCPtr, this); 1876 } 1877 1878 1879/** 1880 * Predicate returning <code>true</code> if all the required attributes for this 1881 * {@link Compartment} object have been set. 1882 <p> 1883 * The required attributes for a {@link Compartment} object are: 1884 * <ul> 1885 * <li> 'id' (or 'name' in SBML Level 1) 1886 * <li> 'constant' (in SBML Level 3 only) 1887 * 1888 * </ul> <p> 1889 * @return <code>true</code> if the required attributes have been set, <code>false</code> 1890 * otherwise. 1891 */ public 1892 boolean hasRequiredAttributes() { 1893 return libsbmlJNI.Compartment_hasRequiredAttributes(swigCPtr, this); 1894 } 1895 1896}