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