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 parameter: a named symbol with a value. 20 * 21 * A Parameter is used in SBML to define a symbol associated with a value; 22 * this symbol can then be used in mathematical formulas in a model. By 23 * default, parameters have constant value for the duration of a 24 * simulation, and for this reason are called @em parameters instead of @em 25 * variables in SBML, although it is crucial to understand that <em>SBML 26 * parameters represent both concepts</em>. Whether a given SBML 27 * parameter is intended to be constant or variable is indicated by the 28 * value of its 'constant' attribute. 29 * 30 * SBML's Parameter has a required attribute, 'id', that gives the 31 * parameter a unique identifier by which other parts of an SBML model 32 * definition can refer to it. A parameter can also have an optional 33 * 'name' attribute of type @c string. Identifiers and names must be used 34 * according to the guidelines described in the SBML specifications. 35 * 36 * The optional attribute 'value' determines the value (of type @c double) 37 * assigned to the parameter. A missing value for 'value' implies that 38 * the value either is unknown, or to be obtained from an external source, 39 * or determined by an initial assignment. The unit of measurement 40 * associated with the value of the parameter can be specified using the 41 * optional attribute 'units'. Here we only mention briefly some notable 42 * points about the possible unit choices, but readers are urged to consult 43 * the SBML specification documents for more information: 44 * <ul> 45 * 46 * <li> In SBML Level 3, there are no constraints on the units that 47 * can be assigned to parameters in a model; there are also no units to 48 * inherit from the enclosing Model object (unlike the case for, e.g., 49 * Species and Compartment). 50 * 51 * <li> In SBML Level 2, the value assigned to the parameter's 'units' 52 * attribute must be chosen from one of the following possibilities: one of 53 * the base unit identifiers defined in SBML; one of the built-in unit 54 * identifiers @c 'substance', @c 'time', @c 'volume', @c 'area' or 55 * @c 'length'; or the identifier of a new unit defined in the list of unit 56 * definitions in the enclosing Model structure. There are no constraints 57 * on the units that can be chosen from these sets. There are no default 58 * units for parameters. 59 * </ul> 60 * 61 * The Parameter structure has another boolean attribute named 'constant' 62 * that is used to indicate whether the parameter's value can vary during a 63 * simulation. (In SBML Level 3, the attribute is mandatory and must 64 * be given a value; in SBML Levels below Level 3, the attribute is 65 * optional.) A value of @c true indicates the parameter's value cannot be 66 * changed by any construct except InitialAssignment. Conversely, if the 67 * value of 'constant' is @c false, other constructs in SBML, such as rules 68 * and events, can change the value of the parameter. 69 * 70 * SBML Level 3 uses a separate object class, LocalParameter, for 71 * parameters that are local to a Reaction's KineticLaw. In Levels prior 72 * to SBML Level 3, the Parameter class is used both for definitions 73 * of global parameters, as well as reaction-local parameters stored in a 74 * list within KineticLaw objects. Parameter objects that are local to a 75 * reaction (that is, those defined within the KineticLaw structure of a 76 * Reaction) cannot be changed by rules and therefore are <em>implicitly 77 * always constant</em>; consequently, in SBML Level 2, parameter 78 * definitions within Reaction structures should @em not have their 79 * 'constant' attribute set to @c false. 80 * 81 * What if a global parameter has its 'constant' attribute set to @c false, 82 * but the model does not contain any rules, events or other constructs 83 * that ever change its value over time? Although the model may be 84 * suspect, this situation is not strictly an error. A value of @c false 85 * for 'constant' only indicates that a parameter @em can change value, not 86 * that it @em must. 87 * 88 * As with all other major SBML components, Parameter is derived from 89 * SBase, and the methods defined on SBase are available on Parameter. 90 * 91 * @note The use of the term @em parameter in SBML sometimes leads to 92 * confusion among readers who have a particular notion of what something 93 * called 'parameter' should be. It has been the source of heated debate, 94 * but despite this, no one has yet found an adequate replacement term that 95 * does not have different connotations to different people and hence leads 96 * to confusion among @em some subset of users. Perhaps it would have been 97 * better to have two constructs, one called @em constants and the other 98 * called @em variables. The current approach in SBML is simply more 99 * parsimonious, using a single Parameter construct with the boolean flag 100 * 'constant' indicating which flavor it is. In any case, readers are 101 * implored to look past their particular definition of a @em parameter and 102 * simply view SBML's Parameter as a single mechanism for defining both 103 * constants and (additional) variables in a model. (We write @em 104 * additional because the species in a model are usually considered to be 105 * the central variables.) After all, software tools are not required to 106 * expose to users the actual names of particular SBML constructs, and 107 * thus tools can present to their users whatever terms their designers 108 * feel best matches their target audience. 109 * 110 * In SBML Level 3 Version 2, many restrictions were lifted 111 * requiring only Boolean values in Boolean contexts, and numeric 112 * values in numeric contexts. This means that a Parameter may now 113 * be used as a Boolean, despite canonically having a numeric value. 114 * To be consistent, one should always assign it a value of @c true 115 * or @c false, and use it in Boolean contexts exclusively. It would 116 * be appropriate to give it an SBO value of 602 ('Logical parameter') 117 * if one chooses to do this. 118 * 119 * @see ListOfParameters 120 * 121 * 122 * 123 */ 124 125 public class Parameter : SBase { 126 private HandleRef swigCPtr; 127 Parameter(IntPtr cPtr, bool cMemoryOwn)128 internal Parameter(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.Parameter_SWIGUpcast(cPtr), cMemoryOwn) 129 { 130 //super(libsbmlPINVOKE.ParameterUpcast(cPtr), cMemoryOwn); 131 swigCPtr = new HandleRef(this, cPtr); 132 } 133 getCPtr(Parameter obj)134 internal static HandleRef getCPtr(Parameter obj) 135 { 136 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 137 } 138 getCPtrAndDisown(Parameter obj)139 internal static HandleRef getCPtrAndDisown (Parameter obj) 140 { 141 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 142 143 if (obj != null) 144 { 145 ptr = obj.swigCPtr; 146 obj.swigCMemOwn = false; 147 } 148 149 return ptr; 150 } 151 Dispose(bool disposing)152 protected override void Dispose(bool disposing) { 153 lock(this) { 154 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 155 if (swigCMemOwn) { 156 swigCMemOwn = false; 157 libsbmlPINVOKE.delete_Parameter(swigCPtr); 158 } 159 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 160 } 161 base.Dispose(disposing); 162 } 163 } 164 165 166 /** 167 * Creates a new Parameter using the given SBML @p level and @p version 168 * values. 169 * 170 * @param level a long integer, the SBML Level to assign to this Parameter. 171 * 172 * @param version a long integer, the SBML Version to assign to this 173 * Parameter. 174 * 175 * 176 * @throws SBMLConstructorException 177 * Thrown if the given @p level and @p version combination are invalid 178 * or if this object is incompatible with the given level and version. 179 * 180 * 181 * 182 * 183 * @note Attempting to add an object to an SBMLDocument having a different 184 * combination of SBML Level, Version and XML namespaces than the object 185 * itself will result in an error at the time a caller attempts to make the 186 * addition. A parent object must have compatible Level, Version and XML 187 * namespaces. (Strictly speaking, a parent may also have more XML 188 * namespaces than a child, but the reverse is not permitted.) The 189 * restriction is necessary to ensure that an SBML model has a consistent 190 * overall structure. This requires callers to manage their objects 191 * carefully, but the benefit is increased flexibility in how models can be 192 * created by permitting callers to create objects bottom-up if desired. In 193 * situations where objects are not yet attached to parents (e.g., 194 * SBMLDocument), knowledge of the intented SBML Level and Version help 195 * libSBML determine such things as whether it is valid to assign a 196 * particular value to an attribute. 197 * 198 * 199 */ public Parameter(long level, long version)200 Parameter(long level, long version) : this(libsbmlPINVOKE.new_Parameter__SWIG_0(level, version), true) { 201 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 202 } 203 204 205 /** 206 * Creates a new Parameter using the given SBMLNamespaces object 207 * @p sbmlns. 208 * 209 * 210 * 211 * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces 212 * information. It is used to communicate the SBML Level, Version, and (in 213 * Level 3) packages used in addition to SBML Level 3 Core. A 214 * common approach to using libSBML's SBMLNamespaces facilities is to create an 215 * SBMLNamespaces object somewhere in a program once, then hand that object 216 * as needed to object constructors that accept SBMLNamespaces as arguments. 217 * 218 * 219 * 220 * It is worth emphasizing that although this constructor does not take 221 * an identifier argument, in SBML Level 2 and beyond, the 'id' 222 * (identifier) attribute of a Parameter is required to have a value. 223 * Thus, callers are cautioned to assign a value after calling this 224 * constructor if no identifier is provided as an argument. Setting the 225 * identifier can be accomplished using the method 226 * @if java setId(String id)@else setId()@endif. 227 * 228 * @param sbmlns an SBMLNamespaces object. 229 * 230 * 231 * @throws SBMLConstructorException 232 * Thrown if the given @p sbmlns is inconsistent or incompatible 233 * with this object. 234 * 235 * 236 * 237 * 238 * @note Attempting to add an object to an SBMLDocument having a different 239 * combination of SBML Level, Version and XML namespaces than the object 240 * itself will result in an error at the time a caller attempts to make the 241 * addition. A parent object must have compatible Level, Version and XML 242 * namespaces. (Strictly speaking, a parent may also have more XML 243 * namespaces than a child, but the reverse is not permitted.) The 244 * restriction is necessary to ensure that an SBML model has a consistent 245 * overall structure. This requires callers to manage their objects 246 * carefully, but the benefit is increased flexibility in how models can be 247 * created by permitting callers to create objects bottom-up if desired. In 248 * situations where objects are not yet attached to parents (e.g., 249 * SBMLDocument), knowledge of the intented SBML Level and Version help 250 * libSBML determine such things as whether it is valid to assign a 251 * particular value to an attribute. 252 * 253 * 254 */ public Parameter(SBMLNamespaces sbmlns)255 Parameter(SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_Parameter__SWIG_1(SBMLNamespaces.getCPtr(sbmlns)), true) { 256 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 257 } 258 259 260 /** 261 * Copy constructor; creates a copy of a Parameter. 262 * 263 * @param orig the Parameter instance to copy. 264 */ public Parameter(Parameter orig)265 Parameter(Parameter orig) : this(libsbmlPINVOKE.new_Parameter__SWIG_2(Parameter.getCPtr(orig)), true) { 266 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 267 } 268 269 270 /** 271 * Creates and returns a deep copy of this Parameter object. 272 * 273 * @return the (deep) copy of this Parameter object. 274 */ public new clone()275 Parameter clone() { 276 global::System.IntPtr cPtr = libsbmlPINVOKE.Parameter_clone(swigCPtr); 277 Parameter ret = (cPtr == global::System.IntPtr.Zero) ? null : new Parameter(cPtr, true); 278 return ret; 279 } 280 281 282 /** 283 * Initializes the fields of this Parameter object to 'typical' defaults 284 * values. 285 * 286 * The SBML Parameter component has slightly different aspects and 287 * default attribute values in different SBML Levels and Versions. Many 288 * SBML object classes defined by libSBML have an initDefaults() method 289 * to set the values to certain common defaults, based mostly on what 290 * they are in SBML Level 2. In the case of Parameter, this method 291 * only sets the value of the 'constant' attribute to @c true. 292 * 293 * @see getConstant() 294 * @see isSetConstant() 295 * @see setConstant(@if java boolean@endif) 296 */ public initDefaults()297 void initDefaults() { 298 libsbmlPINVOKE.Parameter_initDefaults(swigCPtr); 299 } 300 301 302 /** 303 * Returns the value of the 'id' attribute of this Parameter. 304 * 305 * @note Because of the inconsistent behavior of this function with 306 * respect to assignments and rules, it is now recommended to 307 * use the getIdAttribute() function instead. 308 * 309 * 310 * 311 * The identifier given by an object's 'id' attribute value 312 * is used to identify the object within the SBML model definition. 313 * Other objects can refer to the component using this identifier. The 314 * data type of 'id' is always <code>SId</code> or a type derived 315 * from that, such as <code>UnitSId</code>, depending on the object in 316 * question. All data types are defined as follows: 317 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 318 * letter ::= 'a'..'z','A'..'Z' 319 * digit ::= '0'..'9' 320 * idChar ::= letter | digit | '_' 321 * SId ::= ( letter | '_' ) idChar* 322 * </pre> 323 * The characters <code>(</code> and <code>)</code> are used for grouping, 324 * the character <code>*</code> 'zero or more times', and the character 325 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 326 * is determined by an exact character sequence match; i.e., comparisons must 327 * be performed in a case-sensitive manner. This applies to all uses of 328 * <code>SId</code>, <code>SIdRef</code>, and derived types. 329 * 330 * Users need to be aware of some important API issues that are the result of 331 * the history of SBML and libSBML. Prior to SBML Level 3 332 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 333 * of SBML objects. To simplify the work of programmers, libSBML's API 334 * provided get, set, check, and unset on the SBase object class itself 335 * instead of on individual subobject classes. This made the 336 * get/set/etc. methods uniformly available on all objects in the libSBML 337 * API. LibSBML simply returned empty strings or otherwise did not act when 338 * the methods were applied to SBML objects that were not defined by the SBML 339 * specification to have 'id' or 'name' attributes. Additional complications 340 * arose with the rule and assignment objects: InitialAssignment, 341 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 342 * the rule object hierarchy was different, and in addition, then as now, 343 * they possess different attributes: 'variable' (for the rules and event 344 * assignments), 'symbol' (for initial assignments), or neither (for 345 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 346 * would always return an empty string, and isSetId() would always return @c 347 * false for objects of these classes. 348 * 349 * With the addition of 'id' and 'name' attributes on SBase in Level 3 350 * Version 2, it became necessary to introduce a new way to interact 351 * with the attributes more consistently in libSBML to avoid breaking 352 * backward compatibility in the behavior of the original 'id' methods. For 353 * this reason, libSBML provides four functions (getIdAttribute(), 354 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 355 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 356 * from SBase, regardless of the object's type. <strong>These new methods 357 * should be used instead of the older getId()/setId()/etc. methods</strong> 358 * unless the old behavior is somehow necessary. Regardless of the Level and 359 * Version of the SBML, these functions allow client applications to use more 360 * generalized code in some situations (for instance, when manipulating 361 * objects that are all known to have identifiers). If the object in 362 * question does not posess an 'id' attribute according to the SBML 363 * specification for the Level and Version in use, libSBML will not allow the 364 * identifier to be set, nor will it read or write 'id' attributes for those 365 * objects. 366 * 367 * 368 * 369 * @return the id of this Parameter. 370 * 371 * @see getIdAttribute() 372 * @see setIdAttribute(string sid) 373 * @see isSetIdAttribute() 374 * @see unsetIdAttribute() 375 */ public new getId()376 string getId() { 377 string ret = libsbmlPINVOKE.Parameter_getId(swigCPtr); 378 return ret; 379 } 380 381 382 /** 383 * Returns the value of the 'name' attribute of this Parameter object. 384 * 385 * 386 * 387 * 388 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 389 * moved to SBase directly, instead of being defined individually for many 390 * (but not all) objects. LibSBML has for a long time provided functions 391 * defined on SBase itself to get, set, and unset those attributes, which 392 * would fail or otherwise return empty strings if executed on any object 393 * for which those attributes were not defined. Now that all SBase objects 394 * define those attributes, those functions now succeed for any object with 395 * the appropriate level and version. 396 * 397 * The 'name' attribute is 398 * optional and is not intended to be used for cross-referencing purposes 399 * within a model. Its purpose instead is to provide a human-readable 400 * label for the component. The data type of 'name' is the type 401 * <code>string</code> defined in XML Schema. SBML imposes no 402 * restrictions as to the content of 'name' attributes beyond those 403 * restrictions defined by the <code>string</code> type in XML Schema. 404 * 405 * The recommended practice for handling 'name' is as follows. If a 406 * software tool has the capability for displaying the content of 'name' 407 * attributes, it should display this content to the user as a 408 * component's label instead of the component's 'id'. If the user 409 * interface does not have this capability (e.g., because it cannot 410 * display or use special characters in symbol names), or if the 'name' 411 * attribute is missing on a given component, then the user interface 412 * should display the value of the 'id' attribute instead. (Script 413 * language interpreters are especially likely to display 'id' instead of 414 * 'name'.) 415 * 416 * As a consequence of the above, authors of systems that automatically 417 * generate the values of 'id' attributes should be aware some systems 418 * may display the 'id''s to the user. Authors therefore may wish to 419 * take some care to have their software create 'id' values that are: (a) 420 * reasonably easy for humans to type and read; and (b) likely to be 421 * meaningful, for example by making the 'id' attribute be an abbreviated 422 * form of the name attribute value. 423 * 424 * An additional point worth mentioning is although there are 425 * restrictions on the uniqueness of 'id' values, there are no 426 * restrictions on the uniqueness of 'name' values in a model. This 427 * allows software applications leeway in assigning component identifiers. 428 * 429 * Regardless of the level and version of the SBML, these functions allow 430 * client applications to use more generalized code in some situations 431 * (for instance, when manipulating objects that are all known to have 432 * names). If the object in question does not posess a 'name' attribute 433 * according to the SBML specification for the Level and Version in use, 434 * libSBML will not allow the name to be set, nor will it read or 435 * write 'name' attributes for those objects. 436 * 437 * 438 * 439 * @return the name of this SBML object, or the empty string if not set or unsettable. 440 * 441 * @see getIdAttribute() 442 * @see isSetName() 443 * @see setName(string sid) 444 * @see unsetName() 445 * 446 * 447 */ public new getName()448 string getName() { 449 string ret = libsbmlPINVOKE.Parameter_getName(swigCPtr); 450 return ret; 451 } 452 453 454 /** 455 * Returns the numerical value of this Parameter. 456 * 457 * @return the value of the 'value' attribute of this Parameter, as a 458 * number of type @c double. 459 * 460 * @note <b>It is crucial</b> that callers not blindly call 461 * Parameter::getValue() without first using Parameter::isSetValue() to 462 * determine whether a value has ever been set. Otherwise, the value 463 * return by Parameter::getValue() may not actually represent a value 464 * assigned to the parameter. The reason is simply that the data type 465 * @c double in a program always has @em some value. A separate test is 466 * needed to determine whether the value is a true model value, or 467 * uninitialized data in a computer's memory location. 468 * 469 * @see isSetValue() 470 * @see setValue(double value) 471 * @see getUnits() 472 */ public getValue()473 double getValue() { 474 double ret = libsbmlPINVOKE.Parameter_getValue(swigCPtr); 475 return ret; 476 } 477 478 479 /** 480 * Returns the units defined for this Parameter. 481 * 482 * The value of an SBML parameter's 'units' attribute establishes the 483 * unit of measurement associated with the parameter's value. 484 * 485 * @return the value of the 'units' attribute of this Parameter, as a 486 * string. An empty string indicates that no units have been assigned. 487 * 488 * 489 * @note There is an important distinction to be made between <em>no units 490 * assigned</em>, and assuming a value without units has any specific unit 491 * such as <code>dimensionless</code>. In SBML, default units are never 492 * attributed to numbers, and numbers without units are not automatically 493 * assumed to have the unit <code>dimensionless</code>. Please consult the 494 * relevant SBML specification document for a more in-depth explanation of 495 * this topic and the SBML unit system. 496 * 497 * 498 * 499 * @see isSetUnits() 500 * @see setUnits(@if java String@endif) 501 * @see getValue() 502 */ public getUnits()503 string getUnits() { 504 string ret = libsbmlPINVOKE.Parameter_getUnits(swigCPtr); 505 return ret; 506 } 507 508 509 /** 510 * Returns the value of the 'constant' attribute of this Parameter instance. 511 * 512 * @return @c true if this Parameter is declared as being constant, 513 * @c false otherwise. 514 * 515 * 516 * @note Readers who view the documentation for LocalParameter may be 517 * confused about the presence of this method. LibSBML derives 518 * LocalParameter from Parameter; however, this does not precisely match 519 * the object hierarchy defined by SBML Level 3, where 520 * LocalParameter is derived directly from SBase and not Parameter. We 521 * believe this arrangement makes it easier for libSBML users to program 522 * applications that work with both SBML Level 2 and SBML 523 * Level 3, but programmers should also keep in mind this difference 524 * exists. A side-effect of libSBML's scheme is that certain methods on 525 * LocalParameter that are inherited from Parameter do not actually have 526 * relevance to LocalParameter objects. An example of this is the 527 * methods pertaining to Parameter's attribute 'constant' (i.e., 528 * isSetConstant(), setConstant(), and getConstant()). 529 * 530 * 531 * @see isSetConstant() 532 * @see setConstant(@if java boolean@endif) 533 */ public new getConstant()534 bool getConstant() { 535 bool ret = libsbmlPINVOKE.Parameter_getConstant(swigCPtr); 536 return ret; 537 } 538 539 540 /** 541 * Predicate returning @c true if this 542 * Parameter's 'id' attribute is set. 543 * 544 * 545 * 546 * 547 * The identifier given by an object's 'id' attribute value 548 * is used to identify the object within the SBML model definition. 549 * Other objects can refer to the component using this identifier. The 550 * data type of 'id' is always <code>SId</code> or a type derived 551 * from that, such as <code>UnitSId</code>, depending on the object in 552 * question. All data types are defined as follows: 553 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 554 * letter ::= 'a'..'z','A'..'Z' 555 * digit ::= '0'..'9' 556 * idChar ::= letter | digit | '_' 557 * SId ::= ( letter | '_' ) idChar* 558 * </pre> 559 * The characters <code>(</code> and <code>)</code> are used for grouping, 560 * the character <code>*</code> 'zero or more times', and the character 561 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 562 * is determined by an exact character sequence match; i.e., comparisons must 563 * be performed in a case-sensitive manner. This applies to all uses of 564 * <code>SId</code>, <code>SIdRef</code>, and derived types. 565 * 566 * Users need to be aware of some important API issues that are the result of 567 * the history of SBML and libSBML. Prior to SBML Level 3 568 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 569 * of SBML objects. To simplify the work of programmers, libSBML's API 570 * provided get, set, check, and unset on the SBase object class itself 571 * instead of on individual subobject classes. This made the 572 * get/set/etc. methods uniformly available on all objects in the libSBML 573 * API. LibSBML simply returned empty strings or otherwise did not act when 574 * the methods were applied to SBML objects that were not defined by the SBML 575 * specification to have 'id' or 'name' attributes. Additional complications 576 * arose with the rule and assignment objects: InitialAssignment, 577 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 578 * the rule object hierarchy was different, and in addition, then as now, 579 * they possess different attributes: 'variable' (for the rules and event 580 * assignments), 'symbol' (for initial assignments), or neither (for 581 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 582 * would always return an empty string, and isSetId() would always return @c 583 * false for objects of these classes. 584 * 585 * With the addition of 'id' and 'name' attributes on SBase in Level 3 586 * Version 2, it became necessary to introduce a new way to interact 587 * with the attributes more consistently in libSBML to avoid breaking 588 * backward compatibility in the behavior of the original 'id' methods. For 589 * this reason, libSBML provides four functions (getIdAttribute(), 590 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 591 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 592 * from SBase, regardless of the object's type. <strong>These new methods 593 * should be used instead of the older getId()/setId()/etc. methods</strong> 594 * unless the old behavior is somehow necessary. Regardless of the Level and 595 * Version of the SBML, these functions allow client applications to use more 596 * generalized code in some situations (for instance, when manipulating 597 * objects that are all known to have identifiers). If the object in 598 * question does not posess an 'id' attribute according to the SBML 599 * specification for the Level and Version in use, libSBML will not allow the 600 * identifier to be set, nor will it read or write 'id' attributes for those 601 * objects. 602 * 603 * 604 * 605 * @return @c true if the 'id' attribute of this SBML object is 606 * set, @c false otherwise. 607 * 608 * @note Because of the inconsistent behavior of this function with 609 * respect to assignments and rules, it is recommended that callers 610 * use isSetIdAttribute() instead. 611 * 612 * @see getIdAttribute() 613 * @see setIdAttribute(string sid) 614 * @see unsetIdAttribute() 615 * @see isSetIdAttribute() 616 * 617 * 618 */ public new isSetId()619 bool isSetId() { 620 bool ret = libsbmlPINVOKE.Parameter_isSetId(swigCPtr); 621 return ret; 622 } 623 624 625 /** 626 * Predicate returning @c true if this 627 * Parameter's 'name' attribute is set. 628 * 629 * 630 * 631 * 632 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 633 * moved to SBase directly, instead of being defined individually for many 634 * (but not all) objects. LibSBML has for a long time provided functions 635 * defined on SBase itself to get, set, and unset those attributes, which 636 * would fail or otherwise return empty strings if executed on any object 637 * for which those attributes were not defined. Now that all SBase objects 638 * define those attributes, those functions now succeed for any object with 639 * the appropriate level and version. 640 * 641 * The 'name' attribute is 642 * optional and is not intended to be used for cross-referencing purposes 643 * within a model. Its purpose instead is to provide a human-readable 644 * label for the component. The data type of 'name' is the type 645 * <code>string</code> defined in XML Schema. SBML imposes no 646 * restrictions as to the content of 'name' attributes beyond those 647 * restrictions defined by the <code>string</code> type in XML Schema. 648 * 649 * The recommended practice for handling 'name' is as follows. If a 650 * software tool has the capability for displaying the content of 'name' 651 * attributes, it should display this content to the user as a 652 * component's label instead of the component's 'id'. If the user 653 * interface does not have this capability (e.g., because it cannot 654 * display or use special characters in symbol names), or if the 'name' 655 * attribute is missing on a given component, then the user interface 656 * should display the value of the 'id' attribute instead. (Script 657 * language interpreters are especially likely to display 'id' instead of 658 * 'name'.) 659 * 660 * As a consequence of the above, authors of systems that automatically 661 * generate the values of 'id' attributes should be aware some systems 662 * may display the 'id''s to the user. Authors therefore may wish to 663 * take some care to have their software create 'id' values that are: (a) 664 * reasonably easy for humans to type and read; and (b) likely to be 665 * meaningful, for example by making the 'id' attribute be an abbreviated 666 * form of the name attribute value. 667 * 668 * An additional point worth mentioning is although there are 669 * restrictions on the uniqueness of 'id' values, there are no 670 * restrictions on the uniqueness of 'name' values in a model. This 671 * allows software applications leeway in assigning component identifiers. 672 * 673 * Regardless of the level and version of the SBML, these functions allow 674 * client applications to use more generalized code in some situations 675 * (for instance, when manipulating objects that are all known to have 676 * names). If the object in question does not posess a 'name' attribute 677 * according to the SBML specification for the Level and Version in use, 678 * libSBML will not allow the name to be set, nor will it read or 679 * write 'name' attributes for those objects. 680 * 681 * 682 * 683 * @return @c true if the 'name' attribute of this SBML object is 684 * set, @c false otherwise. 685 * 686 * @see getName() 687 * @see setName(string sid) 688 * @see unsetName() 689 * 690 * 691 */ public new isSetName()692 bool isSetName() { 693 bool ret = libsbmlPINVOKE.Parameter_isSetName(swigCPtr); 694 return ret; 695 } 696 697 698 /** 699 * Predicate returning @c true if the 700 * 'value' attribute of this Parameter is set. 701 * 702 * In SBML definitions after SBML Level 1 Version 1, 703 * parameter values are optional and have no defaults. If a model read 704 * from a file does not contain a setting for the 'value' attribute of a 705 * parameter, its value is considered unset; it does not default to any 706 * particular value. Similarly, when a Parameter object is created in 707 * libSBML, it has no value until given a value. The 708 * Parameter::isSetValue() method allows calling applications to 709 * determine whether a given parameter's value has ever been set. 710 * 711 * In SBML Level 1 Version 1, parameters are required to have 712 * values and therefore, the value of a Parameter <b>should always be 713 * set</b>. In Level 1 Version 2 and beyond, the value is 714 * optional and as such, the 'value' attribute may or may not be set. 715 * 716 * @return @c true if the value of this Parameter is set, 717 * @c false otherwise. 718 * 719 * @see getValue() 720 * @see setValue(double value) 721 */ public isSetValue()722 bool isSetValue() { 723 bool ret = libsbmlPINVOKE.Parameter_isSetValue(swigCPtr); 724 return ret; 725 } 726 727 728 /** 729 * Predicate returning @c true if the 730 * 'units' attribute of this Parameter is set. 731 * 732 * @return @c true if the 'units' attribute of this Parameter is 733 * set, @c false otherwise. 734 * 735 * 736 * @note There is an important distinction to be made between <em>no units 737 * assigned</em>, and assuming a value without units has any specific unit 738 * such as <code>dimensionless</code>. In SBML, default units are never 739 * attributed to numbers, and numbers without units are not automatically 740 * assumed to have the unit <code>dimensionless</code>. Please consult the 741 * relevant SBML specification document for a more in-depth explanation of 742 * this topic and the SBML unit system. 743 * 744 * 745 */ public isSetUnits()746 bool isSetUnits() { 747 bool ret = libsbmlPINVOKE.Parameter_isSetUnits(swigCPtr); 748 return ret; 749 } 750 751 752 /** 753 * Predicate returning @c true if the 754 * 'constant' attribute of this Parameter is set. 755 * 756 * @return @c true if the 'constant' attribute of this Parameter is 757 * set, @c false otherwise. 758 * 759 * 760 * @note Readers who view the documentation for LocalParameter may be 761 * confused about the presence of this method. LibSBML derives 762 * LocalParameter from Parameter; however, this does not precisely match 763 * the object hierarchy defined by SBML Level 3, where 764 * LocalParameter is derived directly from SBase and not Parameter. We 765 * believe this arrangement makes it easier for libSBML users to program 766 * applications that work with both SBML Level 2 and SBML 767 * Level 3, but programmers should also keep in mind this difference 768 * exists. A side-effect of libSBML's scheme is that certain methods on 769 * LocalParameter that are inherited from Parameter do not actually have 770 * relevance to LocalParameter objects. An example of this is the 771 * methods pertaining to Parameter's attribute 'constant' (i.e., 772 * isSetConstant(), setConstant(), and getConstant()). 773 * 774 * 775 * @see getConstant() 776 * @see setConstant(@if java boolean@endif) 777 */ public new isSetConstant()778 bool isSetConstant() { 779 bool ret = libsbmlPINVOKE.Parameter_isSetConstant(swigCPtr); 780 return ret; 781 } 782 783 784 /** 785 * Sets the value of the 'id' attribute of this Parameter. 786 * 787 * 788 * 789 * The string @p sid is copied. 790 * 791 * 792 * 793 * The identifier given by an object's 'id' attribute value 794 * is used to identify the object within the SBML model definition. 795 * Other objects can refer to the component using this identifier. The 796 * data type of 'id' is always <code>SId</code> or a type derived 797 * from that, such as <code>UnitSId</code>, depending on the object in 798 * question. All data types are defined as follows: 799 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 800 * letter ::= 'a'..'z','A'..'Z' 801 * digit ::= '0'..'9' 802 * idChar ::= letter | digit | '_' 803 * SId ::= ( letter | '_' ) idChar* 804 * </pre> 805 * The characters <code>(</code> and <code>)</code> are used for grouping, 806 * the character <code>*</code> 'zero or more times', and the character 807 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 808 * is determined by an exact character sequence match; i.e., comparisons must 809 * be performed in a case-sensitive manner. This applies to all uses of 810 * <code>SId</code>, <code>SIdRef</code>, and derived types. 811 * 812 * Users need to be aware of some important API issues that are the result of 813 * the history of SBML and libSBML. Prior to SBML Level 3 814 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 815 * of SBML objects. To simplify the work of programmers, libSBML's API 816 * provided get, set, check, and unset on the SBase object class itself 817 * instead of on individual subobject classes. This made the 818 * get/set/etc. methods uniformly available on all objects in the libSBML 819 * API. LibSBML simply returned empty strings or otherwise did not act when 820 * the methods were applied to SBML objects that were not defined by the SBML 821 * specification to have 'id' or 'name' attributes. Additional complications 822 * arose with the rule and assignment objects: InitialAssignment, 823 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 824 * the rule object hierarchy was different, and in addition, then as now, 825 * they possess different attributes: 'variable' (for the rules and event 826 * assignments), 'symbol' (for initial assignments), or neither (for 827 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 828 * would always return an empty string, and isSetId() would always return @c 829 * false for objects of these classes. 830 * 831 * With the addition of 'id' and 'name' attributes on SBase in Level 3 832 * Version 2, it became necessary to introduce a new way to interact 833 * with the attributes more consistently in libSBML to avoid breaking 834 * backward compatibility in the behavior of the original 'id' methods. For 835 * this reason, libSBML provides four functions (getIdAttribute(), 836 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 837 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 838 * from SBase, regardless of the object's type. <strong>These new methods 839 * should be used instead of the older getId()/setId()/etc. methods</strong> 840 * unless the old behavior is somehow necessary. Regardless of the Level and 841 * Version of the SBML, these functions allow client applications to use more 842 * generalized code in some situations (for instance, when manipulating 843 * objects that are all known to have identifiers). If the object in 844 * question does not posess an 'id' attribute according to the SBML 845 * specification for the Level and Version in use, libSBML will not allow the 846 * identifier to be set, nor will it read or write 'id' attributes for those 847 * objects. 848 * 849 * 850 * 851 * @param sid the string to use as the identifier of this object. 852 * 853 * 854 * @return integer value indicating success/failure of the 855 * function. @if clike The value is drawn from the 856 * enumeration #OperationReturnValues_t. @endif The possible values 857 * returned by this function are: 858 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 859 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 860 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 861 * 862 * @see getIdAttribute() 863 * @see setIdAttribute(string sid) 864 * @see isSetIdAttribute() 865 * @see unsetIdAttribute() 866 * 867 * 868 */ public new setId(string sid)869 int setId(string sid) { 870 int ret = libsbmlPINVOKE.Parameter_setId(swigCPtr, sid); 871 return ret; 872 } 873 874 875 /** 876 * Sets the value of the 'name' attribute of this Parameter. 877 * 878 * The string in @p name is copied. 879 * 880 * @param name the new name for the Parameter. 881 * 882 * 883 * @return integer value indicating success/failure of the 884 * function. @if clike The value is drawn from the 885 * enumeration #OperationReturnValues_t. @endif The possible values 886 * returned by this function are: 887 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 888 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 889 */ public new setName(string name)890 int setName(string name) { 891 int ret = libsbmlPINVOKE.Parameter_setName(swigCPtr, name); 892 return ret; 893 } 894 895 896 /** 897 * Sets the 'value' attribute of this Parameter to the given @c double 898 * value and marks the attribute as set. 899 * 900 * @param value a @c double, the value to assign. 901 * 902 * 903 * @return integer value indicating success/failure of the 904 * function. @if clike The value is drawn from the 905 * enumeration #OperationReturnValues_t. @endif The possible values 906 * returned by this function are: 907 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 908 */ public setValue(double value)909 int setValue(double value) { 910 int ret = libsbmlPINVOKE.Parameter_setValue(swigCPtr, value); 911 return ret; 912 } 913 914 915 /** 916 * Sets the 'units' attribute of this Parameter to a copy of the given 917 * units identifier @p units. 918 * 919 * @param units a string, the identifier of the units to assign to this 920 * Parameter instance. 921 * 922 * 923 * @return integer value indicating success/failure of the 924 * function. @if clike The value is drawn from the 925 * enumeration #OperationReturnValues_t. @endif The possible values 926 * returned by this function are: 927 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 928 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 929 */ public setUnits(string units)930 int setUnits(string units) { 931 int ret = libsbmlPINVOKE.Parameter_setUnits(swigCPtr, units); 932 return ret; 933 } 934 935 936 /** 937 * Sets the 'constant' attribute of this Parameter to the given boolean 938 * @p flag. 939 * 940 * @param flag a boolean, the value for the 'constant' attribute of this 941 * Parameter instance. 942 * 943 * 944 * @return integer value indicating success/failure of the 945 * function. @if clike The value is drawn from the 946 * enumeration #OperationReturnValues_t. @endif The possible values 947 * returned by this function are: 948 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 949 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 950 * 951 * 952 * @note Readers who view the documentation for LocalParameter may be 953 * confused about the presence of this method. LibSBML derives 954 * LocalParameter from Parameter; however, this does not precisely match 955 * the object hierarchy defined by SBML Level 3, where 956 * LocalParameter is derived directly from SBase and not Parameter. We 957 * believe this arrangement makes it easier for libSBML users to program 958 * applications that work with both SBML Level 2 and SBML 959 * Level 3, but programmers should also keep in mind this difference 960 * exists. A side-effect of libSBML's scheme is that certain methods on 961 * LocalParameter that are inherited from Parameter do not actually have 962 * relevance to LocalParameter objects. An example of this is the 963 * methods pertaining to Parameter's attribute 'constant' (i.e., 964 * isSetConstant(), setConstant(), and getConstant()). 965 * 966 * 967 * @see getConstant() 968 * @see isSetConstant() 969 */ public new setConstant(bool flag)970 int setConstant(bool flag) { 971 int ret = libsbmlPINVOKE.Parameter_setConstant(swigCPtr, flag); 972 return ret; 973 } 974 975 976 /** 977 * Unsets the value of the 'name' attribute of this Parameter. 978 * 979 * 980 * 981 * 982 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 983 * moved to SBase directly, instead of being defined individually for many 984 * (but not all) objects. LibSBML has for a long time provided functions 985 * defined on SBase itself to get, set, and unset those attributes, which 986 * would fail or otherwise return empty strings if executed on any object 987 * for which those attributes were not defined. Now that all SBase objects 988 * define those attributes, those functions now succeed for any object with 989 * the appropriate level and version. 990 * 991 * The 'name' attribute is 992 * optional and is not intended to be used for cross-referencing purposes 993 * within a model. Its purpose instead is to provide a human-readable 994 * label for the component. The data type of 'name' is the type 995 * <code>string</code> defined in XML Schema. SBML imposes no 996 * restrictions as to the content of 'name' attributes beyond those 997 * restrictions defined by the <code>string</code> type in XML Schema. 998 * 999 * The recommended practice for handling 'name' is as follows. If a 1000 * software tool has the capability for displaying the content of 'name' 1001 * attributes, it should display this content to the user as a 1002 * component's label instead of the component's 'id'. If the user 1003 * interface does not have this capability (e.g., because it cannot 1004 * display or use special characters in symbol names), or if the 'name' 1005 * attribute is missing on a given component, then the user interface 1006 * should display the value of the 'id' attribute instead. (Script 1007 * language interpreters are especially likely to display 'id' instead of 1008 * 'name'.) 1009 * 1010 * As a consequence of the above, authors of systems that automatically 1011 * generate the values of 'id' attributes should be aware some systems 1012 * may display the 'id''s to the user. Authors therefore may wish to 1013 * take some care to have their software create 'id' values that are: (a) 1014 * reasonably easy for humans to type and read; and (b) likely to be 1015 * meaningful, for example by making the 'id' attribute be an abbreviated 1016 * form of the name attribute value. 1017 * 1018 * An additional point worth mentioning is although there are 1019 * restrictions on the uniqueness of 'id' values, there are no 1020 * restrictions on the uniqueness of 'name' values in a model. This 1021 * allows software applications leeway in assigning component identifiers. 1022 * 1023 * Regardless of the level and version of the SBML, these functions allow 1024 * client applications to use more generalized code in some situations 1025 * (for instance, when manipulating objects that are all known to have 1026 * names). If the object in question does not posess a 'name' attribute 1027 * according to the SBML specification for the Level and Version in use, 1028 * libSBML will not allow the name to be set, nor will it read or 1029 * write 'name' attributes for those objects. 1030 * 1031 * 1032 * 1033 * 1034 * @return integer value indicating success/failure of the 1035 * function. @if clike The value is drawn from the 1036 * enumeration #OperationReturnValues_t. @endif The possible values 1037 * returned by this function are: 1038 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1039 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1040 * 1041 * @see getName() 1042 * @see setName(string sid) 1043 * @see isSetName() 1044 * 1045 * 1046 */ public new unsetName()1047 int unsetName() { 1048 int ret = libsbmlPINVOKE.Parameter_unsetName(swigCPtr); 1049 return ret; 1050 } 1051 1052 1053 /** 1054 * Unsets the value of the 'constant' attribute of this Parameter object. 1055 * 1056 * 1057 * @return integer value indicating success/failure of the 1058 * function. @if clike The value is drawn from the 1059 * enumeration #OperationReturnValues_t. @endif The possible values 1060 * returned by this function are: 1061 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1062 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1063 * 1064 * @see isSetConstant() 1065 * @see setConstant(@if java boolean@endif) 1066 * @see getConstant() 1067 */ public unsetConstant()1068 int unsetConstant() { 1069 int ret = libsbmlPINVOKE.Parameter_unsetConstant(swigCPtr); 1070 return ret; 1071 } 1072 1073 1074 /** 1075 * Unsets the 'value' attribute of this Parameter instance. 1076 * 1077 * 1078 * @return integer value indicating success/failure of the 1079 * function. @if clike The value is drawn from the 1080 * enumeration #OperationReturnValues_t. @endif This particular 1081 * function only does one thing irrespective of user input or 1082 * object state, and thus will only return a single value: 1083 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1084 * 1085 * In SBML Level 1 Version 1, parameters are required to have 1086 * values and therefore, the value of a Parameter <b>should always be 1087 * set</b>. In SBML Level 1 Version 2 and beyond, the value 1088 * is optional and as such, the 'value' attribute may or may not be set. 1089 */ public unsetValue()1090 int unsetValue() { 1091 int ret = libsbmlPINVOKE.Parameter_unsetValue(swigCPtr); 1092 return ret; 1093 } 1094 1095 1096 /** 1097 * Unsets the 'units' attribute of this Parameter instance. 1098 * 1099 * 1100 * @return integer value indicating success/failure of the 1101 * function. @if clike The value is drawn from the 1102 * enumeration #OperationReturnValues_t. @endif The possible values 1103 * returned by this function are: 1104 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1105 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1106 */ public unsetUnits()1107 int unsetUnits() { 1108 int ret = libsbmlPINVOKE.Parameter_unsetUnits(swigCPtr); 1109 return ret; 1110 } 1111 1112 1113 /** 1114 * Constructs and returns a UnitDefinition that corresponds to the units 1115 * of this Parameter's value. 1116 * 1117 * Parameters in SBML have an attribute ('units') for declaring the units 1118 * of measurement intended for the parameter's value. <b>No defaults are 1119 * defined</b> by SBML in the absence of a definition for 'units'. This 1120 * method returns a UnitDefinition object based on the units declared for 1121 * this Parameter using its 'units' attribute, or it returns @c null if 1122 * no units have been declared. 1123 * 1124 * Note that unit declarations for Parameter objects are specified in 1125 * terms of the @em identifier of a unit (e.g., using setUnits()), but 1126 * @em this method returns a UnitDefinition object, not a unit 1127 * identifier. It does this by constructing an appropriate 1128 * UnitDefinition.For SBML Level 2 models, it will do this even when 1129 * the value of the 'units' attribute is one of the special SBML 1130 * Level 2 unit identifiers @c 'substance', @c 'volume', @c 'area', 1131 * @c 'length' or @c 'time'. Callers may find this useful in conjunction 1132 * with the helper methods provided by the UnitDefinition class for 1133 * comparing different UnitDefinition objects. 1134 * 1135 * @return a UnitDefinition that expresses the units of this 1136 * Parameter, or @c null if one cannot be constructed. 1137 * 1138 * @note The libSBML system for unit analysis depends on the model as a 1139 * whole. In cases where the Parameter object has not yet been added to 1140 * a model, or the model itself is incomplete, unit analysis is not 1141 * possible, and consequently this method will return @c null. 1142 * 1143 * @see isSetUnits() 1144 */ public getDerivedUnitDefinition()1145 UnitDefinition getDerivedUnitDefinition() { 1146 global::System.IntPtr cPtr = libsbmlPINVOKE.Parameter_getDerivedUnitDefinition__SWIG_0(swigCPtr); 1147 UnitDefinition ret = (cPtr == global::System.IntPtr.Zero) ? null : new UnitDefinition(cPtr, false); 1148 return ret; 1149 } 1150 1151 1152 /** 1153 * Returns the libSBML type code for this SBML object. 1154 * 1155 * 1156 * 1157 * LibSBML attaches an identifying code to every kind of SBML object. These 1158 * are integer constants known as <em>SBML type codes</em>. The names of all 1159 * the codes begin with the characters <code>SBML_</code>. 1160 * @if clike The set of possible type codes for core elements is defined in 1161 * the enumeration #SBMLTypeCode_t, and in addition, libSBML plug-ins for 1162 * SBML Level 3 packages define their own extra enumerations of type 1163 * codes (e.g., #SBMLLayoutTypeCode_t for the Level 3 Layout 1164 * package).@endif@if java In the Java language interface for libSBML, the 1165 * type codes are defined as static integer constants in the interface class 1166 * {@link libsbmlConstants}. @endif@if python In the Python language 1167 * interface for libSBML, the type codes are defined as static integer 1168 * constants in the interface class @link libsbml@endlink.@endif@if csharp In 1169 * the C# language interface for libSBML, the type codes are defined as 1170 * static integer constants in the interface class 1171 * @link libsbmlcs.libsbml@endlink.@endif Note that different Level 3 1172 * package plug-ins may use overlapping type codes; to identify the package 1173 * to which a given object belongs, call the 1174 * <code>@if conly SBase_getPackageName() 1175 * @else SBase::getPackageName() 1176 * @endif</code> 1177 * method on the object. 1178 * 1179 * The exception to this is lists: all SBML-style list elements have the type 1180 * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink, regardless of what package they 1181 * are from. 1182 * 1183 * 1184 * 1185 * @return the SBML type code for this object: 1186 * @link libsbml#SBML_PARAMETER SBML_PARAMETER@endlink (default). 1187 * 1188 * 1189 * @warning <span class='warning'>The specific integer values of the possible 1190 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 1191 * packages, To fully identify the correct code, <strong>it is necessary to 1192 * invoke both getPackageName() and getTypeCode()</strong> (or 1193 * ListOf::getItemTypeCode()).</span> 1194 * 1195 * 1196 * 1197 * @see getElementName() 1198 * @see getPackageName() 1199 */ public new getTypeCode()1200 int getTypeCode() { 1201 int ret = libsbmlPINVOKE.Parameter_getTypeCode(swigCPtr); 1202 return ret; 1203 } 1204 1205 1206 /** 1207 * Returns the XML element name of this object, which for Parameter, is 1208 * always @c 'parameter'. 1209 * 1210 * @return the name of this element, i.e., @c 'parameter'. 1211 */ public new getElementName()1212 string getElementName() { 1213 string ret = libsbmlPINVOKE.Parameter_getElementName(swigCPtr); 1214 return ret; 1215 } 1216 1217 1218 /** 1219 * Predicate returning @c true if 1220 * all the required attributes for this Parameter object 1221 * have been set. 1222 * 1223 * The required attributes for a Parameter object are: 1224 * @li 'id' (or 'name' in SBML Level 1) 1225 * @li 'value' (required in Level 1, optional otherwise) 1226 * 1227 * @return @c true if the required attributes have been set, @c false 1228 * otherwise. 1229 */ public new hasRequiredAttributes()1230 bool hasRequiredAttributes() { 1231 bool ret = libsbmlPINVOKE.Parameter_hasRequiredAttributes(swigCPtr); 1232 return ret; 1233 } 1234 1235 1236 /** 1237 * Renames all the @c UnitSIdRef attributes on this element. 1238 * 1239 * 1240 * 1241 * In SBML, unit definitions have identifiers of type <code>UnitSId</code>. In 1242 * SBML Level 3, an explicit data type called <code>UnitSIdRef</code> was 1243 * introduced for attribute values that refer to <code>UnitSId</code> values; in 1244 * previous Levels of SBML, this data type did not exist and attributes were 1245 * simply described to as 'referring to a unit identifier', but the effective 1246 * data type was the same as <code>UnitSIdRef</code> in Level 3. These and 1247 * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all 1248 * Levels of SBML, even if the corresponding SBML specification did not 1249 * explicitly name the data type. 1250 * 1251 * 1252 * 1253 * This method works by looking at all unit identifier attribute values 1254 * (including, if appropriate, inside mathematical formulas), comparing the 1255 * unit identifiers to the value of @p oldid. If any matches are found, 1256 * the matching identifiers are replaced with @p newid. The method does 1257 * @em not descend into child elements. 1258 * 1259 * @param oldid the old identifier. 1260 * @param newid the new identifier. 1261 */ public new renameUnitSIdRefs(string oldid, string newid)1262 void renameUnitSIdRefs(string oldid, string newid) { 1263 libsbmlPINVOKE.Parameter_renameUnitSIdRefs(swigCPtr, oldid, newid); 1264 } 1265 1266 1267 /** */ /* libsbml-internal */ public new setCalculatingUnits(bool calculatingUnits)1268 void setCalculatingUnits(bool calculatingUnits) { 1269 libsbmlPINVOKE.Parameter_setCalculatingUnits(swigCPtr, calculatingUnits); 1270 } 1271 1272 } 1273 1274 } 1275