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 SBML's <em>%SBase</em> class, base class of most SBML objects. 20 * 21 * Most components in SBML are derived from a single abstract base type, 22 * SBase. In addition to serving as the parent class for most other 23 * classes of objects in SBML, this base type is designed to allow a 24 * modeler or a software package to attach arbitrary information to each 25 * major element or list in an SBML model. 26 * 27 * SBase has an optional subelement called 'notes'. It is intended to 28 * serve as a place for storing optional information intended to be seen by 29 * humans. An example use of the 'notes' element would be to contain 30 * formatted user comments about the model element in which the 'notes' 31 * element is enclosed. There are certain conditions on the XHTML content 32 * permitted inside the 'notes' element; please consult the <a 33 * target='_blank' href='http://sbml.org/Documents/Specifications'>SBML 34 * specification document</a> corresponding to the SBML Level and Version 35 * of your model for more information about the requirements for 'notes' 36 * content. 37 * 38 * SBase has another optional subelement called 'annotation'. Whereas the 39 * 'notes' element described above is a container for content to be shown 40 * directly to humans, the 'annotation' element is a container for optional 41 * software-generated content @em not meant to be shown to humans. The 42 * element's content type is <a target='_blank' 43 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 44 * 'any'</a>, allowing essentially arbitrary data content. SBML places 45 * only a few restrictions on the organization of the content; these are 46 * intended to help software tools read and write the data as well as help 47 * reduce conflicts between annotations added by different tools. As is 48 * the case with 'notes', it is important to refer to the <a 49 * target='_blank' href='http://sbml.org/Documents/Specifications'>SBML 50 * specification document</a> corresponding to the SBML Level and Version 51 * of your model for more information about the requirements for 52 * 'annotation' content. 53 * 54 * It is worth pointing out that the 'annotation' element in the definition 55 * of SBase exists in order that software developers may attach optional 56 * application-specific data to the elements in an SBML model. However, it 57 * is important that this facility not be misused. In particular, it is 58 * <em>critical</em> that data essential to a model definition or that can 59 * be encoded in existing SBML elements is <em>not</em> stored in 60 * 'annotation'. Parameter values, functional dependencies between model 61 * elements, etc., should not be recorded as annotations. It is crucial to 62 * keep in mind the fact that data placed in annotations can be freely 63 * ignored by software applications. If such data affects the 64 * interpretation of a model, then software interoperability is greatly 65 * impeded. 66 * 67 * SBML Level 2 introduced an optional SBase attribute named 'metaid' for 68 * supporting metadata annotations using RDF (<a target='_blank' 69 * href='http://www.w3.org/RDF/'>Resource Description Format</a>). The 70 * attribute value has the data type <a 71 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML identifier 72 * type, which means each 'metaid' value must be globally unique within an 73 * SBML file. (Importantly, this uniqueness criterion applies across any 74 * attribute with type <a href='http://www.w3.org/TR/REC-xml/#id'>XML 75 * ID</a>, not just the 'metaid' attribute used by SBML---something to 76 * be aware of if your application-specific XML content inside the 77 * 'annotation' subelement happens to use <a 78 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) The 'metaid' value 79 * serves to identify a model component for purposes such as referencing 80 * that component from metadata placed within 'annotation' subelements. 81 * 82 * Beginning with SBML Level 2 Version 2, SBase has an optional 83 * attribute named 'sboTerm' for supporting the use of the Systems Biology 84 * Ontology. In SBML proper, the data type of the attribute is a string of 85 * the form 'SBO:NNNNNNN', where 'NNNNNNN' is a seven digit integer number; 86 * libSBML simplifies the representation by only storing the 'NNNNNNN' 87 * integer portion. Thus, in libSBML, the 'sboTerm' attribute on SBase has 88 * data type @c int, and SBO identifiers are stored simply as integers. 89 * (For convenience, SBase offers methods for returning both the integer 90 * form and a text-string form of the SBO identifier.) SBO terms are a 91 * type of optional annotation, and each different class of SBML object 92 * derived from SBase imposes its own requirements about the values 93 * permitted for 'sboTerm'. More details can be found in SBML specifications 94 * for Level 2 Version 2 and above. 95 * 96 * Finally, note that, in the list of methods on SBase, there is no public 97 * constructor because SBase is an abstract class. The constructors reside 98 * in the subclasses derived from SBase. 99 * 100 * 101 * @section sbase-miriam Standard format for annotations linking data resources 102 * 103 * SBML Level 2 Versions 2, 3 and 4, and Level 3, define a proposed 104 * regular format for encoding two particular categories of annotations: 105 * (a) references to controlled vocabulary terms and database identifiers 106 * which define and describe biological and biochemical entities in a 107 * model; and (b) descriptions of the provenance of a model, including its 108 * author(s) and modification history. 109 */ 110 111 public class SBase : global::System.IDisposable { 112 private HandleRef swigCPtr; 113 protected bool swigCMemOwn; 114 SBase(IntPtr cPtr, bool cMemoryOwn)115 internal SBase(IntPtr cPtr, bool cMemoryOwn) 116 { 117 swigCMemOwn = cMemoryOwn; 118 swigCPtr = new HandleRef(this, cPtr); 119 } 120 getCPtr(SBase obj)121 internal static HandleRef getCPtr(SBase obj) 122 { 123 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 124 } 125 getCPtrAndDisown(SBase obj)126 internal static HandleRef getCPtrAndDisown (SBase obj) 127 { 128 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 129 130 if (obj != null) 131 { 132 ptr = obj.swigCPtr; 133 obj.swigCMemOwn = false; 134 } 135 136 return ptr; 137 } 138 ~SBase()139 ~SBase() { 140 Dispose(false); 141 } 142 Dispose()143 public void Dispose() { 144 Dispose(true); 145 global::System.GC.SuppressFinalize(this); 146 } 147 Dispose(bool disposing)148 protected virtual void Dispose(bool disposing) { 149 lock(this) { 150 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 151 if (swigCMemOwn) { 152 swigCMemOwn = false; 153 libsbmlPINVOKE.delete_SBase(swigCPtr); 154 } 155 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 156 } 157 } 158 } 159 operator ==(SBase lhs, SBase rhs)160 public static bool operator==(SBase lhs, SBase rhs) 161 { 162 if((Object)lhs == (Object)rhs) 163 { 164 return true; 165 } 166 167 if( ((Object)lhs == null) || ((Object)rhs == null) ) 168 { 169 return false; 170 } 171 172 return (getCPtr(lhs).Handle.ToString() == getCPtr(rhs).Handle.ToString()); 173 } 174 operator !=(SBase lhs, SBase rhs)175 public static bool operator!=(SBase lhs, SBase rhs) 176 { 177 return !(lhs == rhs); 178 } 179 Equals(Object sb)180 public override bool Equals(Object sb) 181 { 182 if ( ! (sb is SBase) ) 183 { 184 return false; 185 } 186 187 return this == (SBase)sb; 188 } 189 GetHashCode()190 public override int GetHashCode() 191 { 192 return swigCPtr.Handle.ToInt32(); 193 } 194 195 196 /** 197 * Creates and returns a deep copy of this SBase object. 198 * 199 * @return the (deep) copy of this SBase object. 200 */ public new clone()201 SBase clone() { 202 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.SBase_clone(swigCPtr), true); 203 return ret; 204 } 205 206 207 /** 208 * Returns the first child element found that has the given @p id in the 209 * model-wide @c SId namespace, or @c null if no such object is found. 210 * 211 * @param id string representing the 'id' attribute value of the object 212 * to find. 213 * 214 * @return pointer to the first element found with the given identifier. 215 */ public new getElementBySId(string id)216 SBase getElementBySId(string id) { 217 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.SBase_getElementBySId__SWIG_0(swigCPtr, id), false); 218 return ret; 219 } 220 221 222 /** 223 * Returns the first child element it can find with a specific 'metaid' 224 * attribute value, or @c null if no such object is found. 225 * 226 * 227 * 228 * The optional attribute named 'metaid', present on every major SBML 229 * component type, is for supporting metadata annotations using RDF (<a 230 * href='http://www.w3.org/RDF/'>Resource Description Format</a>). The 231 * attribute value has the data type <a 232 * href='http://www.w3.org/TR/REC-xml/#id'>XML <code>ID</code></a>, the XML 233 * identifier type, which means each 'metaid' value must be globally unique 234 * within an SBML file. The latter point is important, because the 235 * uniqueness criterion applies across <em>any</em> attribute with type 236 * <code>ID</code> anywhere in the file, not just the 'metaid' attribute used 237 * by SBML---something to be aware of if your application-specific XML 238 * content inside the 'annotation' subelement happens to use the XML 239 * <code>ID</code> type. Although SBML itself specifies the use of <a 240 * href='http://www.w3.org/TR/REC-xml/#id'>XML <code>ID</code></a> only for 241 * the 'metaid' attribute, SBML-compatible applications should be careful if 242 * they use XML <code>ID</code>'s in XML portions of a model that are not 243 * defined by SBML, such as in the application-specific content of the 244 * 'annotation' subelement. Finally, note that LibSBML does not provide an 245 * explicit XML <code>ID</code> data type; it uses ordinary character 246 * strings, which is easier for applications to support. 247 * 248 * 249 * 250 * @param metaid string representing the 'metaid' attribute value of the 251 * object to find. 252 * 253 * @return pointer to the first element found with the given meta-identifier. 254 */ public new getElementByMetaId(string metaid)255 SBase getElementByMetaId(string metaid) { 256 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.SBase_getElementByMetaId__SWIG_0(swigCPtr, metaid), false); 257 return ret; 258 } 259 260 261 /** 262 * 263 * Replaces all uses of a given @c SIdRef type attribute value with another 264 * value. 265 * 266 * 267 * 268 269 * In SBML, object identifiers are of a data type called <code>SId</code>. 270 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 271 * introduced for attribute values that refer to <code>SId</code> values; in 272 * previous Levels of SBML, this data type did not exist and attributes were 273 * simply described to as 'referring to an identifier', but the effective 274 * data type was the same as <code>SIdRef</code> in Level 3. These and 275 * other methods of libSBML refer to the type <code>SIdRef</code> for all 276 * Levels of SBML, even if the corresponding SBML specification did not 277 * explicitly name the data type. 278 * 279 * 280 * 281 * This method works by looking at all attributes and (if appropriate) 282 * mathematical formulas in MathML content, comparing the referenced 283 * identifiers to the value of @p oldid. If any matches are found, the 284 * matching values are replaced with @p newid. The method does @em not 285 * descend into child elements. 286 * 287 * @param oldid the old identifier. 288 * @param newid the new identifier. 289 * 290 * 291 */ public new renameSIdRefs(string oldid, string newid)292 void renameSIdRefs(string oldid, string newid) { 293 libsbmlPINVOKE.SBase_renameSIdRefs(swigCPtr, oldid, newid); 294 } 295 296 297 /** 298 * 299 * Replaces all uses of a given meta identifier attribute value with 300 * another value. 301 * 302 * 303 * 304 * In SBML, object 'meta' identifiers are of the XML data type <code>ID</code>; 305 * the SBML object attribute itself is typically named <code>metaid</code>. All 306 * attributes that hold values <em>referring</em> to values of type 307 * <code>ID</code> are of the XML data type <code>IDREF</code>. They are also 308 * sometimes informally referred to as 'metaid refs', in analogy to the 309 * SBML-defined type <code>SIdRef</code>. 310 * 311 * 312 * 313 * This method works by looking at all meta-identifier attribute values, 314 * comparing the identifiers to the value of @p oldid. If any matches are 315 * found, the matching identifiers are replaced with @p newid. The method 316 * does @em not descend into child elements. 317 * 318 * @param oldid the old identifier. 319 * @param newid the new identifier. 320 * 321 * 322 */ public new renameMetaIdRefs(string oldid, string newid)323 void renameMetaIdRefs(string oldid, string newid) { 324 libsbmlPINVOKE.SBase_renameMetaIdRefs(swigCPtr, oldid, newid); 325 } 326 327 328 /** 329 * 330 * Replaces all uses of a given @c UnitSIdRef type attribute value with 331 * another value. 332 * 333 * 334 * 335 * In SBML, unit definitions have identifiers of type <code>UnitSId</code>. In 336 * SBML Level 3, an explicit data type called <code>UnitSIdRef</code> was 337 * introduced for attribute values that refer to <code>UnitSId</code> values; in 338 * previous Levels of SBML, this data type did not exist and attributes were 339 * simply described to as 'referring to a unit identifier', but the effective 340 * data type was the same as <code>UnitSIdRef</code> in Level 3. These and 341 * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all 342 * Levels of SBML, even if the corresponding SBML specification did not 343 * explicitly name the data type. 344 * 345 * 346 * 347 * This method works by looking at all unit identifier attribute values 348 * (including, if appropriate, inside mathematical formulas), comparing the 349 * referenced unit identifiers to the value of @p oldid. If any matches 350 * are found, the matching values are replaced with @p newid. The method 351 * does @em not descend into child elements. 352 * 353 * @param oldid the old identifier. 354 * @param newid the new identifier. 355 * 356 * 357 */ public new renameUnitSIdRefs(string oldid, string newid)358 void renameUnitSIdRefs(string oldid, string newid) { 359 libsbmlPINVOKE.SBase_renameUnitSIdRefs(swigCPtr, oldid, newid); 360 } 361 362 363 /** */ /* libsbml-internal */ public new replaceSIDWithFunction(string id, ASTNode function)364 void replaceSIDWithFunction(string id, ASTNode function) { 365 libsbmlPINVOKE.SBase_replaceSIDWithFunction(swigCPtr, id, ASTNode.getCPtr(function)); 366 } 367 368 369 /** */ /* libsbml-internal */ public new divideAssignmentsToSIdByFunction(string id, ASTNode function)370 void divideAssignmentsToSIdByFunction(string id, ASTNode function) { 371 libsbmlPINVOKE.SBase_divideAssignmentsToSIdByFunction(swigCPtr, id, ASTNode.getCPtr(function)); 372 } 373 374 375 /** */ /* libsbml-internal */ public new multiplyAssignmentsToSIdByFunction(string id, ASTNode function)376 void multiplyAssignmentsToSIdByFunction(string id, ASTNode function) { 377 libsbmlPINVOKE.SBase_multiplyAssignmentsToSIdByFunction(swigCPtr, id, ASTNode.getCPtr(function)); 378 } 379 380 381 /** */ /* libsbml-internal */ public new getElementFromPluginsBySId(string id)382 SBase getElementFromPluginsBySId(string id) { 383 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.SBase_getElementFromPluginsBySId(swigCPtr, id), false); 384 return ret; 385 } 386 387 388 /** */ /* libsbml-internal */ public new getElementFromPluginsByMetaId(string metaid)389 SBase getElementFromPluginsByMetaId(string metaid) { 390 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.SBase_getElementFromPluginsByMetaId(swigCPtr, metaid), false); 391 return ret; 392 } 393 394 395 /** */ /* libsbml-internal */ public new hasNonstandardIdentifierBeginningWith(string prefix)396 bool hasNonstandardIdentifierBeginningWith(string prefix) { 397 bool ret = libsbmlPINVOKE.SBase_hasNonstandardIdentifierBeginningWith(swigCPtr, prefix); 398 return ret; 399 } 400 401 402 /** */ /* libsbml-internal */ public new prependStringToAllIdentifiers(string prefix)403 int prependStringToAllIdentifiers(string prefix) { 404 int ret = libsbmlPINVOKE.SBase_prependStringToAllIdentifiers(swigCPtr, prefix); 405 return ret; 406 } 407 408 409 /** */ /* libsbml-internal */ public new transformIdentifiers(IdentifierTransformer idTransformer)410 int transformIdentifiers(IdentifierTransformer idTransformer) { 411 int ret = libsbmlPINVOKE.SBase_transformIdentifiers(swigCPtr, IdentifierTransformer.getCPtr(idTransformer)); 412 return ret; 413 } 414 415 416 /** 417 * Returns the value of the 'metaid' attribute of this SBML object. 418 * 419 * 420 * 421 * The optional attribute named 'metaid', present on every major SBML 422 * component type, is for supporting metadata annotations using RDF (<a 423 * href='http://www.w3.org/RDF/'>Resource Description Format</a>). The 424 * attribute value has the data type <a 425 * href='http://www.w3.org/TR/REC-xml/#id'>XML <code>ID</code></a>, the XML 426 * identifier type, which means each 'metaid' value must be globally unique 427 * within an SBML file. The latter point is important, because the 428 * uniqueness criterion applies across <em>any</em> attribute with type 429 * <code>ID</code> anywhere in the file, not just the 'metaid' attribute used 430 * by SBML---something to be aware of if your application-specific XML 431 * content inside the 'annotation' subelement happens to use the XML 432 * <code>ID</code> type. Although SBML itself specifies the use of <a 433 * href='http://www.w3.org/TR/REC-xml/#id'>XML <code>ID</code></a> only for 434 * the 'metaid' attribute, SBML-compatible applications should be careful if 435 * they use XML <code>ID</code>'s in XML portions of a model that are not 436 * defined by SBML, such as in the application-specific content of the 437 * 'annotation' subelement. Finally, note that LibSBML does not provide an 438 * explicit XML <code>ID</code> data type; it uses ordinary character 439 * strings, which is easier for applications to support. 440 * 441 * 442 * 443 * @return the meta-identifier of this SBML object. 444 * 445 * @see isSetMetaId() 446 * @see setMetaId(string metaid) 447 */ public getMetaId()448 string getMetaId() { 449 string ret = libsbmlPINVOKE.SBase_getMetaId(swigCPtr); 450 return ret; 451 } 452 453 454 /** 455 * Returns the value of the 'id' attribute of this SBML object, if it has one, 456 * or the 'variable' attribute of a Rule, or the 'symbol' attribute of 457 * an InitialAssignment. 458 * 459 * 460 * 461 * The identifier given by an object's 'id' attribute value 462 * is used to identify the object within the SBML model definition. 463 * Other objects can refer to the component using this identifier. The 464 * data type of 'id' is always <code>SId</code> or a type derived 465 * from that, such as <code>UnitSId</code>, depending on the object in 466 * question. All data types are defined as follows: 467 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 468 * letter ::= 'a'..'z','A'..'Z' 469 * digit ::= '0'..'9' 470 * idChar ::= letter | digit | '_' 471 * SId ::= ( letter | '_' ) idChar* 472 * </pre> 473 * The characters <code>(</code> and <code>)</code> are used for grouping, 474 * the character <code>*</code> 'zero or more times', and the character 475 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 476 * is determined by an exact character sequence match; i.e., comparisons must 477 * be performed in a case-sensitive manner. This applies to all uses of 478 * <code>SId</code>, <code>SIdRef</code>, and derived types. 479 * 480 * Users need to be aware of some important API issues that are the result of 481 * the history of SBML and libSBML. Prior to SBML Level 3 482 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 483 * of SBML objects. To simplify the work of programmers, libSBML's API 484 * provided get, set, check, and unset on the SBase object class itself 485 * instead of on individual subobject classes. This made the 486 * get/set/etc. methods uniformly available on all objects in the libSBML 487 * API. LibSBML simply returned empty strings or otherwise did not act when 488 * the methods were applied to SBML objects that were not defined by the SBML 489 * specification to have 'id' or 'name' attributes. Additional complications 490 * arose with the rule and assignment objects: InitialAssignment, 491 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 492 * the rule object hierarchy was different, and in addition, then as now, 493 * they possess different attributes: 'variable' (for the rules and event 494 * assignments), 'symbol' (for initial assignments), or neither (for 495 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 496 * would always return an empty string, and isSetId() would always return @c 497 * false for objects of these classes. 498 * 499 * With the addition of 'id' and 'name' attributes on SBase in Level 3 500 * Version 2, it became necessary to introduce a new way to interact 501 * with the attributes more consistently in libSBML to avoid breaking 502 * backward compatibility in the behavior of the original 'id' methods. For 503 * this reason, libSBML provides four functions (getIdAttribute(), 504 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 505 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 506 * from SBase, regardless of the object's type. <strong>These new methods 507 * should be used instead of the older getId()/setId()/etc. methods</strong> 508 * unless the old behavior is somehow necessary. Regardless of the Level and 509 * Version of the SBML, these functions allow client applications to use more 510 * generalized code in some situations (for instance, when manipulating 511 * objects that are all known to have identifiers). If the object in 512 * question does not posess an 'id' attribute according to the SBML 513 * specification for the Level and Version in use, libSBML will not allow the 514 * identifier to be set, nor will it read or write 'id' attributes for those 515 * objects. 516 * 517 * 518 * 519 * @return the id of this SBML object, or the 'variable' if the object is a 520 * Rule, or the 'symbol' if the object is an InitialAssignment. 521 * 522 * @note Because of the inconsistent behavior of this function with respect 523 * to assignments and rules, callers should use getIdAttribute() instead. 524 * 525 * @see getIdAttribute() 526 * @see setIdAttribute(string sid) 527 * @see isSetIdAttribute() 528 * @see unsetIdAttribute() 529 */ public new getId()530 string getId() { 531 string ret = libsbmlPINVOKE.SBase_getId(swigCPtr); 532 return ret; 533 } 534 535 536 /** 537 * Returns the value of the 'id' attribute of this SBML object. 538 * 539 * 540 * 541 * The identifier given by an object's 'id' attribute value 542 * is used to identify the object within the SBML model definition. 543 * Other objects can refer to the component using this identifier. The 544 * data type of 'id' is always <code>SId</code> or a type derived 545 * from that, such as <code>UnitSId</code>, depending on the object in 546 * question. All data types are defined as follows: 547 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 548 * letter ::= 'a'..'z','A'..'Z' 549 * digit ::= '0'..'9' 550 * idChar ::= letter | digit | '_' 551 * SId ::= ( letter | '_' ) idChar* 552 * </pre> 553 * The characters <code>(</code> and <code>)</code> are used for grouping, 554 * the character <code>*</code> 'zero or more times', and the character 555 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 556 * is determined by an exact character sequence match; i.e., comparisons must 557 * be performed in a case-sensitive manner. This applies to all uses of 558 * <code>SId</code>, <code>SIdRef</code>, and derived types. 559 * 560 * Users need to be aware of some important API issues that are the result of 561 * the history of SBML and libSBML. Prior to SBML Level 3 562 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 563 * of SBML objects. To simplify the work of programmers, libSBML's API 564 * provided get, set, check, and unset on the SBase object class itself 565 * instead of on individual subobject classes. This made the 566 * get/set/etc. methods uniformly available on all objects in the libSBML 567 * API. LibSBML simply returned empty strings or otherwise did not act when 568 * the methods were applied to SBML objects that were not defined by the SBML 569 * specification to have 'id' or 'name' attributes. Additional complications 570 * arose with the rule and assignment objects: InitialAssignment, 571 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 572 * the rule object hierarchy was different, and in addition, then as now, 573 * they possess different attributes: 'variable' (for the rules and event 574 * assignments), 'symbol' (for initial assignments), or neither (for 575 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 576 * would always return an empty string, and isSetId() would always return @c 577 * false for objects of these classes. 578 * 579 * With the addition of 'id' and 'name' attributes on SBase in Level 3 580 * Version 2, it became necessary to introduce a new way to interact 581 * with the attributes more consistently in libSBML to avoid breaking 582 * backward compatibility in the behavior of the original 'id' methods. For 583 * this reason, libSBML provides four functions (getIdAttribute(), 584 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 585 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 586 * from SBase, regardless of the object's type. <strong>These new methods 587 * should be used instead of the older getId()/setId()/etc. methods</strong> 588 * unless the old behavior is somehow necessary. Regardless of the Level and 589 * Version of the SBML, these functions allow client applications to use more 590 * generalized code in some situations (for instance, when manipulating 591 * objects that are all known to have identifiers). If the object in 592 * question does not posess an 'id' attribute according to the SBML 593 * specification for the Level and Version in use, libSBML will not allow the 594 * identifier to be set, nor will it read or write 'id' attributes for those 595 * objects. 596 * 597 * 598 * 599 * @return the id of this SBML object, if set and valid for this 600 * level and version of SBML; an empty string otherwise. 601 * 602 * @note Because of the inconsistent behavior of this function with respect 603 * to assignments and rules, callers should use getIdAttribute() instead. 604 * 605 * @see setIdAttribute(string sid) 606 * @see isSetIdAttribute() 607 * @see unsetIdAttribute() 608 */ public getIdAttribute()609 string getIdAttribute() { 610 string ret = libsbmlPINVOKE.SBase_getIdAttribute(swigCPtr); 611 return ret; 612 } 613 614 615 /** 616 * Returns the value of the 'name' attribute of this SBML object. 617 * 618 * 619 * 620 * 621 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 622 * moved to SBase directly, instead of being defined individually for many 623 * (but not all) objects. LibSBML has for a long time provided functions 624 * defined on SBase itself to get, set, and unset those attributes, which 625 * would fail or otherwise return empty strings if executed on any object 626 * for which those attributes were not defined. Now that all SBase objects 627 * define those attributes, those functions now succeed for any object with 628 * the appropriate level and version. 629 * 630 * The 'name' attribute is 631 * optional and is not intended to be used for cross-referencing purposes 632 * within a model. Its purpose instead is to provide a human-readable 633 * label for the component. The data type of 'name' is the type 634 * <code>string</code> defined in XML Schema. SBML imposes no 635 * restrictions as to the content of 'name' attributes beyond those 636 * restrictions defined by the <code>string</code> type in XML Schema. 637 * 638 * The recommended practice for handling 'name' is as follows. If a 639 * software tool has the capability for displaying the content of 'name' 640 * attributes, it should display this content to the user as a 641 * component's label instead of the component's 'id'. If the user 642 * interface does not have this capability (e.g., because it cannot 643 * display or use special characters in symbol names), or if the 'name' 644 * attribute is missing on a given component, then the user interface 645 * should display the value of the 'id' attribute instead. (Script 646 * language interpreters are especially likely to display 'id' instead of 647 * 'name'.) 648 * 649 * As a consequence of the above, authors of systems that automatically 650 * generate the values of 'id' attributes should be aware some systems 651 * may display the 'id''s to the user. Authors therefore may wish to 652 * take some care to have their software create 'id' values that are: (a) 653 * reasonably easy for humans to type and read; and (b) likely to be 654 * meaningful, for example by making the 'id' attribute be an abbreviated 655 * form of the name attribute value. 656 * 657 * An additional point worth mentioning is although there are 658 * restrictions on the uniqueness of 'id' values, there are no 659 * restrictions on the uniqueness of 'name' values in a model. This 660 * allows software applications leeway in assigning component identifiers. 661 * 662 * Regardless of the level and version of the SBML, these functions allow 663 * client applications to use more generalized code in some situations 664 * (for instance, when manipulating objects that are all known to have 665 * names). If the object in question does not posess a 'name' attribute 666 * according to the SBML specification for the Level and Version in use, 667 * libSBML will not allow the name to be set, nor will it read or 668 * write 'name' attributes for those objects. 669 * 670 * 671 * 672 * @return the name of this SBML object, or the empty string if not set or unsettable. 673 * 674 * @see getIdAttribute() 675 * @see isSetName() 676 * @see setName(string sid) 677 * @see unsetName() 678 * 679 * 680 */ public new getName()681 string getName() { 682 string ret = libsbmlPINVOKE.SBase_getName(swigCPtr); 683 return ret; 684 } 685 686 687 /** 688 * Returns the content of the 'notes' subelement of this object as 689 * a tree of XMLNode objects. 690 * 691 * 692 * 693 * The optional SBML element named 'notes', present on every major SBML 694 * component type (and in SBML Level 3, the 'message' subelement of 695 * Constraint), is intended as a place for storing optional information 696 * intended to be seen by humans. An example use of the 'notes' element 697 * would be to contain formatted user comments about the model element in 698 * which the 'notes' element is enclosed. Every object derived directly or 699 * indirectly from type SBase can have a separate value for 'notes', allowing 700 * users considerable freedom when adding comments to their models. 701 * 702 * The format of 'notes' elements conform to the definition of <a 703 * target='_blank' href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. 704 * However, the content cannot be @em entirely free-form; it must satisfy 705 * certain requirements defined in the <a target='_blank' 706 * href='http://sbml.org/Documents/Specifications'>SBML specifications</a> 707 * for specific SBML Levels. To help verify the formatting of 'notes' 708 * content, libSBML provides the static utility method 709 * SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif); this 710 * method implements a verification process that lets callers check whether 711 * the content of a given XMLNode object conforms to the SBML requirements 712 * for 'notes' and 'message' structure. Developers are urged to consult the 713 * appropriate <a target='_blank' 714 * href='http://sbml.org/Documents/Specifications'>SBML specification 715 * document</a> for the Level and Version of their model for more in-depth 716 * explanations of using 'notes' in SBML. The SBML Level 2 and 3 717 * specifications have considerable detail about how 'notes' element content 718 * must be structured. 719 * 720 * 721 * 722 * The 'notes' element content returned by this method will be in XML 723 * form, but libSBML does not provide an object model specifically for 724 * the content of notes. Callers will need to traverse the XML tree 725 * structure using the facilities available on XMLNode and related 726 * objects. For an alternative method of accessing the notes, see 727 * getNotesString(). 728 * 729 * @return the content of the 'notes' subelement of this SBML object as a 730 * tree structure composed of XMLNode objects. 731 * 732 * @see getNotesString() 733 * @see isSetNotes() 734 * @see setNotes(XMLNode notes) 735 * @see setNotes(string notes, bool addXHTMLMarkup) 736 * @see appendNotes(XMLNode notes) 737 * @see appendNotes(string notes) 738 * @see unsetNotes() 739 * @see SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif) 740 */ public getNotes()741 XMLNode getNotes() { 742 global::System.IntPtr cPtr = libsbmlPINVOKE.SBase_getNotes__SWIG_0(swigCPtr); 743 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, false); 744 return ret; 745 } 746 747 748 /** 749 * Returns the content of the 'notes' subelement of this object as a 750 * string. 751 * 752 * 753 * 754 * The optional SBML element named 'notes', present on every major SBML 755 * component type (and in SBML Level 3, the 'message' subelement of 756 * Constraint), is intended as a place for storing optional information 757 * intended to be seen by humans. An example use of the 'notes' element 758 * would be to contain formatted user comments about the model element in 759 * which the 'notes' element is enclosed. Every object derived directly or 760 * indirectly from type SBase can have a separate value for 'notes', allowing 761 * users considerable freedom when adding comments to their models. 762 * 763 * The format of 'notes' elements conform to the definition of <a 764 * target='_blank' href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. 765 * However, the content cannot be @em entirely free-form; it must satisfy 766 * certain requirements defined in the <a target='_blank' 767 * href='http://sbml.org/Documents/Specifications'>SBML specifications</a> 768 * for specific SBML Levels. To help verify the formatting of 'notes' 769 * content, libSBML provides the static utility method 770 * SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif); this 771 * method implements a verification process that lets callers check whether 772 * the content of a given XMLNode object conforms to the SBML requirements 773 * for 'notes' and 'message' structure. Developers are urged to consult the 774 * appropriate <a target='_blank' 775 * href='http://sbml.org/Documents/Specifications'>SBML specification 776 * document</a> for the Level and Version of their model for more in-depth 777 * explanations of using 'notes' in SBML. The SBML Level 2 and 3 778 * specifications have considerable detail about how 'notes' element content 779 * must be structured. 780 * 781 * 782 * 783 * For an alternative method of accessing the notes, see getNotes(), 784 * which returns the content as an XMLNode tree structure. Depending on 785 * an application's needs, one or the other method may be more 786 * convenient. 787 * 788 * @return the content of the 'notes' subelement of this SBML object as a 789 * string. 790 * 791 * @see getNotes() 792 * @see isSetNotes() 793 * @see setNotes(XMLNode notes) 794 * @see setNotes(string notes, bool addXHTMLMarkup) 795 * @see appendNotes(XMLNode notes) 796 * @see appendNotes(string notes) 797 * @see unsetNotes() 798 * @see SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif) 799 */ public getNotesString()800 string getNotesString() { 801 string ret = libsbmlPINVOKE.SBase_getNotesString__SWIG_0(swigCPtr); 802 return ret; 803 } 804 805 806 /** 807 * Returns the content of the 'annotation' subelement of this object as 808 * a tree of XMLNode objects. 809 * 810 * 811 * 812 * Whereas the SBML 'notes' subelement is a container for content to be 813 * shown directly to humans, the 'annotation' element is a container for 814 * optional software-generated content @em not meant to be shown to 815 * humans. Every object derived from SBase can have its own value for 816 * 'annotation'. The element's content type is <a target='_blank' 817 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 818 * 'any'</a>, allowing essentially arbitrary well-formed XML data 819 * content. 820 * 821 * SBML places a few restrictions on the organization of the content of 822 * annotations; these are intended to help software tools read and write 823 * the data as well as help reduce conflicts between annotations added by 824 * different tools. Please see the SBML specifications for more details. 825 * 826 * 827 * 828 * The annotations returned by this method will be in XML form. LibSBML 829 * provides an object model and related interfaces for certain specific 830 * kinds of annotations, namely model history information and RDF 831 * content. See the ModelHistory, CVTerm and RDFAnnotationParser classes 832 * for more information about the facilities available. 833 * 834 * @return the annotation of this SBML object as a tree of XMLNode objects. 835 * 836 * @see getAnnotationString() 837 * @see isSetAnnotation() 838 * @see setAnnotation(XMLNode annotation) 839 * @see setAnnotation(string annotation) 840 * @see appendAnnotation(XMLNode annotation) 841 * @see appendAnnotation(string annotation) 842 * @see unsetAnnotation() 843 */ public getAnnotation()844 XMLNode getAnnotation() { 845 global::System.IntPtr cPtr = libsbmlPINVOKE.SBase_getAnnotation__SWIG_0(swigCPtr); 846 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, false); 847 return ret; 848 } 849 850 851 /** 852 * Returns the content of the 'annotation' subelement of this object as a 853 * character string. 854 * 855 * 856 * 857 * Whereas the SBML 'notes' subelement is a container for content to be 858 * shown directly to humans, the 'annotation' element is a container for 859 * optional software-generated content @em not meant to be shown to 860 * humans. Every object derived from SBase can have its own value for 861 * 'annotation'. The element's content type is <a target='_blank' 862 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 863 * 'any'</a>, allowing essentially arbitrary well-formed XML data 864 * content. 865 * 866 * SBML places a few restrictions on the organization of the content of 867 * annotations; these are intended to help software tools read and write 868 * the data as well as help reduce conflicts between annotations added by 869 * different tools. Please see the SBML specifications for more details. 870 * 871 * 872 * 873 * The annotations returned by this method will be in string form. See the 874 * method getAnnotation() for a version that returns annotations in XML form. 875 * 876 * @return the annotation of this SBML object as a character string. 877 * 878 * @see getAnnotation() 879 * @see isSetAnnotation() 880 * @see setAnnotation(XMLNode annotation) 881 * @see setAnnotation(string annotation) 882 * @see appendAnnotation(XMLNode annotation) 883 * @see appendAnnotation(string annotation) 884 * @see unsetAnnotation() 885 */ public getAnnotationString()886 string getAnnotationString() { 887 string ret = libsbmlPINVOKE.SBase_getAnnotationString__SWIG_0(swigCPtr); 888 return ret; 889 } 890 891 892 /** 893 * Returns a list of the XML Namespaces declared on the SBML document 894 * owning this object. 895 * 896 * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces 897 * information. It is used to communicate the SBML Level, Version, and (in 898 * Level 3) packages used in addition to SBML Level 3 Core. 899 * 900 * @return the XML Namespaces associated with this SBML object, or @c null 901 * in certain very usual circumstances where a namespace is not set. 902 * 903 * @see getLevel() 904 * @see getVersion() 905 */ public new getNamespaces()906 XMLNamespaces getNamespaces() { 907 global::System.IntPtr cPtr = libsbmlPINVOKE.SBase_getNamespaces(swigCPtr); 908 XMLNamespaces ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNamespaces(cPtr, false); 909 return ret; 910 } 911 912 913 /** 914 * Returns the SBMLDocument object containing this object instance. 915 * 916 * 917 * 918 * LibSBML uses the class SBMLDocument as a top-level container for 919 * storing SBML content and data associated with it (such as warnings and 920 * error messages). An SBML model in libSBML is contained inside an 921 * SBMLDocument object. SBMLDocument corresponds roughly to the class 922 * <i>SBML</i> defined in the SBML Level 3 and Level 2 923 * specifications, but it does not have a direct correspondence in SBML 924 * Level 1. (But, it is created by libSBML no matter whether the 925 * model is Level 1, Level 2 or Level 3.) 926 * 927 * 928 * 929 * This method allows the caller to obtain the SBMLDocument for the 930 * current object. 931 * 932 * @return the parent SBMLDocument object of this SBML object. 933 * 934 * @see getParentSBMLObject() 935 * @see getModel() 936 */ public getSBMLDocument()937 SBMLDocument getSBMLDocument() { 938 global::System.IntPtr cPtr = libsbmlPINVOKE.SBase_getSBMLDocument__SWIG_0(swigCPtr); 939 SBMLDocument ret = (cPtr == global::System.IntPtr.Zero) ? null : new SBMLDocument(cPtr, false); 940 return ret; 941 } 942 943 944 /** 945 * Returns the parent SBML object containing this object. 946 * 947 * This returns the immediately-containing object. This method is 948 * convenient when holding an object nested inside other objects in an 949 * SBML model. 950 * 951 * @return the parent SBML object of this SBML object. 952 * 953 * @see getSBMLDocument() 954 * @see getModel() 955 */ public getParentSBMLObject()956 SBase getParentSBMLObject() { 957 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.SBase_getParentSBMLObject__SWIG_0(swigCPtr), false); 958 return ret; 959 } 960 961 962 /** 963 * Returns the first ancestor object that has the given SBML type code from the given package. 964 * 965 * @if clike LibSBML attaches an identifying code to every kind of SBML 966 * object. These are known as <em>SBML type codes</em>. The set of 967 * possible type codes is defined in the enumeration #SBMLTypeCode_t. 968 * The names of the type codes all begin with the characters 969 * @c SBML_. @endif@if java LibSBML attaches an identifying code to every 970 * kind of SBML object. These are known as <em>SBML type codes</em>. In 971 * other languages, the set of type codes is stored in an enumeration; in 972 * the Java language interface for libSBML, the type codes are defined as 973 * static integer constants in the interface class {@link 974 * libsbmlConstants}. The names of the type codes all begin with the 975 * characters @c SBML_. @endif@if python LibSBML attaches an identifying 976 * code to every kind of SBML object. These are known as <em>SBML type 977 * codes</em>. In the Python language interface for libSBML, the type 978 * codes are defined as static integer constants in the interface class 979 * @link libsbml@endlink. The names of the type codes all begin with the 980 * characters @c SBML_. @endif@if csharp LibSBML attaches an identifying 981 * code to every kind of SBML object. These are known as <em>SBML type 982 * codes</em>. In the C# language interface for libSBML, the type codes 983 * are defined as static integer constants in the interface class @link 984 * libsbmlcs.libsbml libsbml@endlink. The names of the type codes all begin with 985 * the characters @c SBML_. @endif 986 * 987 * This method searches the tree of objects that are parents of this 988 * object, and returns the first one that has the given SBML type code from 989 * the given @p pkgName. 990 * 991 * @param type the SBML type code of the object sought. 992 * 993 * @param pkgName (optional) the short name of an SBML Level 3 994 * package to which the sought-after object must belong. 995 * 996 * @return the ancestor SBML object of this SBML object that corresponds 997 * to the given @if clike #SBMLTypeCode_t value@else SBML object type 998 * code@endif, or @c null if no ancestor exists. 999 * 1000 * @warning The optional argument @p pkgName must be used for all type codes 1001 * from SBML Level 3 packages. Otherwise, the function will search the 1002 * 'core' namespace alone, not find any corresponding elements, and return 1003 * null. 1004 * 1005 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 1006 */ public getAncestorOfType(int type, string pkgName)1007 SBase getAncestorOfType(int type, string pkgName) { 1008 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.SBase_getAncestorOfType__SWIG_0(swigCPtr, type, pkgName), false); 1009 return ret; 1010 } 1011 1012 1013 /** 1014 * Returns the first ancestor object that has the given SBML type code from the given package. 1015 * 1016 * @if clike LibSBML attaches an identifying code to every kind of SBML 1017 * object. These are known as <em>SBML type codes</em>. The set of 1018 * possible type codes is defined in the enumeration #SBMLTypeCode_t. 1019 * The names of the type codes all begin with the characters 1020 * @c SBML_. @endif@if java LibSBML attaches an identifying code to every 1021 * kind of SBML object. These are known as <em>SBML type codes</em>. In 1022 * other languages, the set of type codes is stored in an enumeration; in 1023 * the Java language interface for libSBML, the type codes are defined as 1024 * static integer constants in the interface class {@link 1025 * libsbmlConstants}. The names of the type codes all begin with the 1026 * characters @c SBML_. @endif@if python LibSBML attaches an identifying 1027 * code to every kind of SBML object. These are known as <em>SBML type 1028 * codes</em>. In the Python language interface for libSBML, the type 1029 * codes are defined as static integer constants in the interface class 1030 * @link libsbml@endlink. The names of the type codes all begin with the 1031 * characters @c SBML_. @endif@if csharp LibSBML attaches an identifying 1032 * code to every kind of SBML object. These are known as <em>SBML type 1033 * codes</em>. In the C# language interface for libSBML, the type codes 1034 * are defined as static integer constants in the interface class @link 1035 * libsbmlcs.libsbml libsbml@endlink. The names of the type codes all begin with 1036 * the characters @c SBML_. @endif 1037 * 1038 * This method searches the tree of objects that are parents of this 1039 * object, and returns the first one that has the given SBML type code from 1040 * the given @p pkgName. 1041 * 1042 * @param type the SBML type code of the object sought. 1043 * 1044 * @param pkgName (optional) the short name of an SBML Level 3 1045 * package to which the sought-after object must belong. 1046 * 1047 * @return the ancestor SBML object of this SBML object that corresponds 1048 * to the given @if clike #SBMLTypeCode_t value@else SBML object type 1049 * code@endif, or @c null if no ancestor exists. 1050 * 1051 * @warning The optional argument @p pkgName must be used for all type codes 1052 * from SBML Level 3 packages. Otherwise, the function will search the 1053 * 'core' namespace alone, not find any corresponding elements, and return 1054 * null. 1055 * 1056 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 1057 */ public getAncestorOfType(int type)1058 SBase getAncestorOfType(int type) { 1059 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.SBase_getAncestorOfType__SWIG_1(swigCPtr, type), false); 1060 return ret; 1061 } 1062 1063 1064 /** 1065 * Returns the integer portion of the value of the 'sboTerm' attribute of 1066 * this object. 1067 * 1068 * 1069 * 1070 * Beginning with SBML Level 2 Version 2, objects derived from SBase have 1071 * an optional attribute named 'sboTerm' for supporting the use of the 1072 * Systems Biology Ontology. In SBML proper, the data type of the 1073 * attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a 1074 * seven digit integer number; libSBML simplifies the representation by 1075 * only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 1076 * 'sboTerm' attribute on SBase has data type @c int, and SBO identifiers 1077 * are stored simply as integers. 1078 * 1079 * 1080 * 1081 * 1082 * SBO terms are a type of optional annotation, and each different class 1083 * of SBML object derived from SBase imposes its own requirements about 1084 * the values permitted for 'sboTerm'. More details can be found in SBML 1085 * specifications for Level 2 Version 2 and above. 1086 * 1087 * 1088 * 1089 * @return the value of the 'sboTerm' attribute as an integer, or @c -1 1090 * if the value is not set. 1091 */ public getSBOTerm()1092 int getSBOTerm() { 1093 int ret = libsbmlPINVOKE.SBase_getSBOTerm(swigCPtr); 1094 return ret; 1095 } 1096 1097 1098 /** 1099 * Returns the string representation of the 'sboTerm' attribute of 1100 * this object. 1101 * 1102 * 1103 * 1104 * Beginning with SBML Level 2 Version 2, objects derived from SBase have 1105 * an optional attribute named 'sboTerm' for supporting the use of the 1106 * Systems Biology Ontology. In SBML proper, the data type of the 1107 * attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a 1108 * seven digit integer number; libSBML simplifies the representation by 1109 * only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 1110 * 'sboTerm' attribute on SBase has data type @c int, and SBO identifiers 1111 * are stored simply as integers. 1112 * 1113 * 1114 * 1115 * 1116 * SBO terms are a type of optional annotation, and each different class 1117 * of SBML object derived from SBase imposes its own requirements about 1118 * the values permitted for 'sboTerm'. More details can be found in SBML 1119 * specifications for Level 2 Version 2 and above. 1120 * 1121 * 1122 * 1123 * @return the value of the 'sboTerm' attribute as a string (its value 1124 * will be of the form 'SBO:NNNNNNN'), or an empty string if 1125 * the value is not set. 1126 */ public getSBOTermID()1127 string getSBOTermID() { 1128 string ret = libsbmlPINVOKE.SBase_getSBOTermID(swigCPtr); 1129 return ret; 1130 } 1131 1132 1133 /** 1134 * Returns the URL representation of the 'sboTerm' attribute of this 1135 * object. 1136 * 1137 * This method returns the entire SBO identifier as a text string in the 1138 * form <code style='margin-right:0; padding-right:0'>http</code><code style='margin-left:0; padding-left:0'>://identifiers.org/biomodels.sbo/SBO:NNNNNNN'</code>. 1139 * 1140 * 1141 * 1142 * SBO terms are a type of optional annotation, and each different class 1143 * of SBML object derived from SBase imposes its own requirements about 1144 * the values permitted for 'sboTerm'. More details can be found in SBML 1145 * specifications for Level 2 Version 2 and above. 1146 * 1147 * 1148 * 1149 * @return the value of the 'sboTerm' attribute as an identifiers.org URL, 1150 * or an empty string if the value is not set. 1151 */ public getSBOTermAsURL()1152 string getSBOTermAsURL() { 1153 string ret = libsbmlPINVOKE.SBase_getSBOTermAsURL(swigCPtr); 1154 return ret; 1155 } 1156 1157 1158 /** 1159 * Returns the line number where this object first appears in the XML 1160 * representation of the SBML document. 1161 * 1162 * @return the line number of this SBML object. If this object was 1163 * created programmatically and not read from a file, this method will 1164 * return the value @c 0. 1165 * 1166 * @note The line number for each construct in an SBML model is set upon 1167 * reading the model. The accuracy of the line number depends on the 1168 * correctness of the XML representation of the model, and on the 1169 * particular XML parser library being used. The former limitation 1170 * relates to the following problem: if the model is actually invalid 1171 * XML, then the parser may not be able to interpret the data correctly 1172 * and consequently may not be able to establish the real line number. 1173 * The latter limitation is simply that different parsers seem to have 1174 * their own accuracy limitations, and out of all the parsers supported 1175 * by libSBML, none have been 100% accurate in all situations. (At this 1176 * time, libSBML supports the use of <a target='_blank' 1177 * href='http://xmlsoft.org'>libxml2</a>, <a target='_blank' 1178 * href='http://expat.sourceforge.net/'>Expat</a> and <a target='_blank' 1179 * href='http://xerces.apache.org/xerces-c/'>Xerces</a>.) 1180 * 1181 * @see getColumn() 1182 */ public getLine()1183 long getLine() { return (long)libsbmlPINVOKE.SBase_getLine(swigCPtr); } 1184 1185 1186 /** 1187 * Returns the column number where this object first appears in the XML 1188 * representation of the SBML document. 1189 * 1190 * @return the column number of this SBML object. If this object was 1191 * created programmatically and not read from a file, this method will 1192 * return the value @c 0. 1193 * 1194 * @note The column number for each construct in an SBML model is set 1195 * upon reading the model. The accuracy of the column number depends on 1196 * the correctness of the XML representation of the model, and on the 1197 * particular XML parser library being used. The former limitation 1198 * relates to the following problem: if the model is actually invalid 1199 * XML, then the parser may not be able to interpret the data correctly 1200 * and consequently may not be able to establish the real column number. 1201 * The latter limitation is simply that different parsers seem to have 1202 * their own accuracy limitations, and out of all the parsers supported 1203 * by libSBML, none have been 100% accurate in all situations. (At this 1204 * time, libSBML supports the use of <a target='_blank' 1205 * href='http://xmlsoft.org'>libxml2</a>, <a target='_blank' 1206 * href='http://expat.sourceforge.net/'>Expat</a> and <a target='_blank' 1207 * href='http://xerces.apache.org/xerces-c/'>Xerces</a>.) 1208 * 1209 * @see getLine() 1210 */ public getColumn()1211 long getColumn() { return (long)libsbmlPINVOKE.SBase_getColumn(swigCPtr); } 1212 1213 1214 /** 1215 * Returns the ModelHistory object, if any, attached to this object. 1216 * 1217 * @return the ModelHistory object attached to this object, or @c null if 1218 * none exist. 1219 * 1220 * @note In SBML Level 2, model history annotations were only 1221 * permitted on the Model element. In SBML Level 3, they are 1222 * permitted on all SBML components derived from SBase. 1223 */ public getModelHistory()1224 ModelHistory getModelHistory() { 1225 global::System.IntPtr cPtr = libsbmlPINVOKE.SBase_getModelHistory__SWIG_0(swigCPtr); 1226 ModelHistory ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModelHistory(cPtr, false); 1227 return ret; 1228 } 1229 1230 1231 /** 1232 * Predicate returning @c true if this object's 'metaid' attribute is set. 1233 * 1234 * 1235 * 1236 * The optional attribute named 'metaid', present on every major SBML 1237 * component type, is for supporting metadata annotations using RDF (<a 1238 * href='http://www.w3.org/RDF/'>Resource Description Format</a>). The 1239 * attribute value has the data type <a 1240 * href='http://www.w3.org/TR/REC-xml/#id'>XML <code>ID</code></a>, the XML 1241 * identifier type, which means each 'metaid' value must be globally unique 1242 * within an SBML file. The latter point is important, because the 1243 * uniqueness criterion applies across <em>any</em> attribute with type 1244 * <code>ID</code> anywhere in the file, not just the 'metaid' attribute used 1245 * by SBML---something to be aware of if your application-specific XML 1246 * content inside the 'annotation' subelement happens to use the XML 1247 * <code>ID</code> type. Although SBML itself specifies the use of <a 1248 * href='http://www.w3.org/TR/REC-xml/#id'>XML <code>ID</code></a> only for 1249 * the 'metaid' attribute, SBML-compatible applications should be careful if 1250 * they use XML <code>ID</code>'s in XML portions of a model that are not 1251 * defined by SBML, such as in the application-specific content of the 1252 * 'annotation' subelement. Finally, note that LibSBML does not provide an 1253 * explicit XML <code>ID</code> data type; it uses ordinary character 1254 * strings, which is easier for applications to support. 1255 * 1256 * 1257 * 1258 * @return @c true if the 'metaid' attribute of this SBML object is 1259 * set, @c false otherwise. 1260 * 1261 * @see getMetaId() 1262 * @see setMetaId(string metaid) 1263 */ public isSetMetaId()1264 bool isSetMetaId() { 1265 bool ret = libsbmlPINVOKE.SBase_isSetMetaId(swigCPtr); 1266 return ret; 1267 } 1268 1269 1270 /** 1271 * Predicate returning @c true if a call to getId() returns a 1272 * non-empty string. 1273 * 1274 * For most objects, this function will return @c true if its 'id' 1275 * attribute is set, and @c false if it is not, or if the object has no 1276 * 'id' attribute at all. However, for an EventAssignment or a Rule, 1277 * isSetId() checks whether the 'variable' attribute is set, and for an 1278 * InitialAssignment, it checks whether the 'symbol' attribute is set. 1279 * Because those elements will also have an 'id' attribute in SBML 1280 * Level 3 Version 2 which isSetId() will not check, the function 1281 * itself is deprecated, and it is recommended to use isSetIdAttribute() in 1282 * all cases where one needs to know whether the 'id' attribute is set, and 1283 * to use EventAssignment::isSetVariable(), Rule::isSetVariable() and 1284 * InitialAssignment::isSetSymbol() when the status of the 'variable' or 1285 * 'symbol' attributes need to be checked. 1286 * 1287 * 1288 * 1289 * 1290 * The identifier given by an object's 'id' attribute value 1291 * is used to identify the object within the SBML model definition. 1292 * Other objects can refer to the component using this identifier. The 1293 * data type of 'id' is always <code>SId</code> or a type derived 1294 * from that, such as <code>UnitSId</code>, depending on the object in 1295 * question. All data types are defined as follows: 1296 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 1297 * letter ::= 'a'..'z','A'..'Z' 1298 * digit ::= '0'..'9' 1299 * idChar ::= letter | digit | '_' 1300 * SId ::= ( letter | '_' ) idChar* 1301 * </pre> 1302 * The characters <code>(</code> and <code>)</code> are used for grouping, 1303 * the character <code>*</code> 'zero or more times', and the character 1304 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 1305 * is determined by an exact character sequence match; i.e., comparisons must 1306 * be performed in a case-sensitive manner. This applies to all uses of 1307 * <code>SId</code>, <code>SIdRef</code>, and derived types. 1308 * 1309 * Users need to be aware of some important API issues that are the result of 1310 * the history of SBML and libSBML. Prior to SBML Level 3 1311 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 1312 * of SBML objects. To simplify the work of programmers, libSBML's API 1313 * provided get, set, check, and unset on the SBase object class itself 1314 * instead of on individual subobject classes. This made the 1315 * get/set/etc. methods uniformly available on all objects in the libSBML 1316 * API. LibSBML simply returned empty strings or otherwise did not act when 1317 * the methods were applied to SBML objects that were not defined by the SBML 1318 * specification to have 'id' or 'name' attributes. Additional complications 1319 * arose with the rule and assignment objects: InitialAssignment, 1320 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 1321 * the rule object hierarchy was different, and in addition, then as now, 1322 * they possess different attributes: 'variable' (for the rules and event 1323 * assignments), 'symbol' (for initial assignments), or neither (for 1324 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 1325 * would always return an empty string, and isSetId() would always return @c 1326 * false for objects of these classes. 1327 * 1328 * With the addition of 'id' and 'name' attributes on SBase in Level 3 1329 * Version 2, it became necessary to introduce a new way to interact 1330 * with the attributes more consistently in libSBML to avoid breaking 1331 * backward compatibility in the behavior of the original 'id' methods. For 1332 * this reason, libSBML provides four functions (getIdAttribute(), 1333 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 1334 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 1335 * from SBase, regardless of the object's type. <strong>These new methods 1336 * should be used instead of the older getId()/setId()/etc. methods</strong> 1337 * unless the old behavior is somehow necessary. Regardless of the Level and 1338 * Version of the SBML, these functions allow client applications to use more 1339 * generalized code in some situations (for instance, when manipulating 1340 * objects that are all known to have identifiers). If the object in 1341 * question does not posess an 'id' attribute according to the SBML 1342 * specification for the Level and Version in use, libSBML will not allow the 1343 * identifier to be set, nor will it read or write 'id' attributes for those 1344 * objects. 1345 * 1346 * 1347 * 1348 * @return @c true if the 'id' attribute of this SBML object is 1349 * set, @c false otherwise. 1350 * 1351 * @note Because of the inconsistent behavior of this function with 1352 * respect to assignments and rules, it is recommended that callers 1353 * use isSetIdAttribute() instead. 1354 * 1355 * @see getIdAttribute() 1356 * @see setIdAttribute(string sid) 1357 * @see unsetIdAttribute() 1358 * @see isSetIdAttribute() 1359 * 1360 * 1361 */ public new isSetId()1362 bool isSetId() { 1363 bool ret = libsbmlPINVOKE.SBase_isSetId(swigCPtr); 1364 return ret; 1365 } 1366 1367 1368 /** 1369 * Predicate returning @c true if this object's 'id' attribute is set. 1370 * 1371 * 1372 * 1373 * The identifier given by an object's 'id' attribute value 1374 * is used to identify the object within the SBML model definition. 1375 * Other objects can refer to the component using this identifier. The 1376 * data type of 'id' is always <code>SId</code> or a type derived 1377 * from that, such as <code>UnitSId</code>, depending on the object in 1378 * question. All data types are defined as follows: 1379 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 1380 * letter ::= 'a'..'z','A'..'Z' 1381 * digit ::= '0'..'9' 1382 * idChar ::= letter | digit | '_' 1383 * SId ::= ( letter | '_' ) idChar* 1384 * </pre> 1385 * The characters <code>(</code> and <code>)</code> are used for grouping, 1386 * the character <code>*</code> 'zero or more times', and the character 1387 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 1388 * is determined by an exact character sequence match; i.e., comparisons must 1389 * be performed in a case-sensitive manner. This applies to all uses of 1390 * <code>SId</code>, <code>SIdRef</code>, and derived types. 1391 * 1392 * Users need to be aware of some important API issues that are the result of 1393 * the history of SBML and libSBML. Prior to SBML Level 3 1394 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 1395 * of SBML objects. To simplify the work of programmers, libSBML's API 1396 * provided get, set, check, and unset on the SBase object class itself 1397 * instead of on individual subobject classes. This made the 1398 * get/set/etc. methods uniformly available on all objects in the libSBML 1399 * API. LibSBML simply returned empty strings or otherwise did not act when 1400 * the methods were applied to SBML objects that were not defined by the SBML 1401 * specification to have 'id' or 'name' attributes. Additional complications 1402 * arose with the rule and assignment objects: InitialAssignment, 1403 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 1404 * the rule object hierarchy was different, and in addition, then as now, 1405 * they possess different attributes: 'variable' (for the rules and event 1406 * assignments), 'symbol' (for initial assignments), or neither (for 1407 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 1408 * would always return an empty string, and isSetId() would always return @c 1409 * false for objects of these classes. 1410 * 1411 * With the addition of 'id' and 'name' attributes on SBase in Level 3 1412 * Version 2, it became necessary to introduce a new way to interact 1413 * with the attributes more consistently in libSBML to avoid breaking 1414 * backward compatibility in the behavior of the original 'id' methods. For 1415 * this reason, libSBML provides four functions (getIdAttribute(), 1416 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 1417 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 1418 * from SBase, regardless of the object's type. <strong>These new methods 1419 * should be used instead of the older getId()/setId()/etc. methods</strong> 1420 * unless the old behavior is somehow necessary. Regardless of the Level and 1421 * Version of the SBML, these functions allow client applications to use more 1422 * generalized code in some situations (for instance, when manipulating 1423 * objects that are all known to have identifiers). If the object in 1424 * question does not posess an 'id' attribute according to the SBML 1425 * specification for the Level and Version in use, libSBML will not allow the 1426 * identifier to be set, nor will it read or write 'id' attributes for those 1427 * objects. 1428 * 1429 * 1430 * 1431 * @return @c true if the 'id' attribute of this SBML object is 1432 * set, @c false otherwise. 1433 * 1434 * @see getIdAttribute() 1435 * @see setIdAttribute(string sid) 1436 * @see unsetIdAttribute() 1437 */ public isSetIdAttribute()1438 bool isSetIdAttribute() { 1439 bool ret = libsbmlPINVOKE.SBase_isSetIdAttribute(swigCPtr); 1440 return ret; 1441 } 1442 1443 1444 /** 1445 * Predicate returning @c true if this 1446 * object's 'name' attribute is set. 1447 * 1448 * 1449 * 1450 * 1451 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 1452 * moved to SBase directly, instead of being defined individually for many 1453 * (but not all) objects. LibSBML has for a long time provided functions 1454 * defined on SBase itself to get, set, and unset those attributes, which 1455 * would fail or otherwise return empty strings if executed on any object 1456 * for which those attributes were not defined. Now that all SBase objects 1457 * define those attributes, those functions now succeed for any object with 1458 * the appropriate level and version. 1459 * 1460 * The 'name' attribute is 1461 * optional and is not intended to be used for cross-referencing purposes 1462 * within a model. Its purpose instead is to provide a human-readable 1463 * label for the component. The data type of 'name' is the type 1464 * <code>string</code> defined in XML Schema. SBML imposes no 1465 * restrictions as to the content of 'name' attributes beyond those 1466 * restrictions defined by the <code>string</code> type in XML Schema. 1467 * 1468 * The recommended practice for handling 'name' is as follows. If a 1469 * software tool has the capability for displaying the content of 'name' 1470 * attributes, it should display this content to the user as a 1471 * component's label instead of the component's 'id'. If the user 1472 * interface does not have this capability (e.g., because it cannot 1473 * display or use special characters in symbol names), or if the 'name' 1474 * attribute is missing on a given component, then the user interface 1475 * should display the value of the 'id' attribute instead. (Script 1476 * language interpreters are especially likely to display 'id' instead of 1477 * 'name'.) 1478 * 1479 * As a consequence of the above, authors of systems that automatically 1480 * generate the values of 'id' attributes should be aware some systems 1481 * may display the 'id''s to the user. Authors therefore may wish to 1482 * take some care to have their software create 'id' values that are: (a) 1483 * reasonably easy for humans to type and read; and (b) likely to be 1484 * meaningful, for example by making the 'id' attribute be an abbreviated 1485 * form of the name attribute value. 1486 * 1487 * An additional point worth mentioning is although there are 1488 * restrictions on the uniqueness of 'id' values, there are no 1489 * restrictions on the uniqueness of 'name' values in a model. This 1490 * allows software applications leeway in assigning component identifiers. 1491 * 1492 * Regardless of the level and version of the SBML, these functions allow 1493 * client applications to use more generalized code in some situations 1494 * (for instance, when manipulating objects that are all known to have 1495 * names). If the object in question does not posess a 'name' attribute 1496 * according to the SBML specification for the Level and Version in use, 1497 * libSBML will not allow the name to be set, nor will it read or 1498 * write 'name' attributes for those objects. 1499 * 1500 * 1501 * 1502 * @return @c true if the 'name' attribute of this SBML object is 1503 * set, @c false otherwise. 1504 * 1505 * @see getName() 1506 * @see setName(string sid) 1507 * @see unsetName() 1508 * 1509 * 1510 */ public new isSetName()1511 bool isSetName() { 1512 bool ret = libsbmlPINVOKE.SBase_isSetName(swigCPtr); 1513 return ret; 1514 } 1515 1516 1517 /** 1518 * Predicate returning @c true if this 1519 * object's 'notes' subelement exists and has content. 1520 * 1521 * The optional SBML element named 'notes', present on every major SBML 1522 * component type, is intended as a place for storing optional 1523 * information intended to be seen by humans. An example use of the 1524 * 'notes' element would be to contain formatted user comments about the 1525 * model element in which the 'notes' element is enclosed. Every object 1526 * derived directly or indirectly from type SBase can have a separate 1527 * value for 'notes', allowing users considerable freedom when adding 1528 * comments to their models. 1529 * 1530 * The format of 'notes' elements must be <a target='_blank' 1531 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 1532 * verify the formatting of 'notes' content, libSBML provides the static 1533 * utility method SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode xhtml@endif); however, 1534 * readers are urged to consult the appropriate <a target='_blank' 1535 * href='http://sbml.org/Documents/Specifications'>SBML specification 1536 * document</a> for the Level and Version of their model for more 1537 * in-depth explanations. The SBML Level 2 and 3 1538 * specifications have considerable detail about how 'notes' element 1539 * content must be structured. 1540 * 1541 * @return @c true if a 'notes' subelement exists, @c false otherwise. 1542 * 1543 * @see getNotes() 1544 * @see getNotesString() 1545 * @see setNotes(XMLNode notes) 1546 * @see setNotes(string notes, bool addXHTMLMarkup) 1547 * @see appendNotes(XMLNode notes) 1548 * @see appendNotes(string notes) 1549 * @see unsetNotes() 1550 * @see SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif) 1551 */ public isSetNotes()1552 bool isSetNotes() { 1553 bool ret = libsbmlPINVOKE.SBase_isSetNotes(swigCPtr); 1554 return ret; 1555 } 1556 1557 1558 /** 1559 * Predicate returning @c true if this 1560 * object's 'annotation' subelement exists and has content. 1561 * 1562 * Whereas the SBase 'notes' subelement is a container for content to be 1563 * shown directly to humans, the 'annotation' element is a container for 1564 * optional software-generated content @em not meant to be shown to 1565 * humans. Every object derived from SBase can have its own value for 1566 * 'annotation'. The element's content type is <a target='_blank' 1567 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 1568 * 'any'</a>, allowing essentially arbitrary well-formed XML data 1569 * content. 1570 * 1571 * SBML places a few restrictions on the organization of the content of 1572 * annotations; these are intended to help software tools read and write 1573 * the data as well as help reduce conflicts between annotations added by 1574 * different tools. Please see the SBML specifications for more details. 1575 * 1576 * @return @c true if a 'annotation' subelement exists, @c false 1577 * otherwise. 1578 * 1579 * @see getAnnotation() 1580 * @see getAnnotationString() 1581 * @see setAnnotation(XMLNode annotation) 1582 * @see setAnnotation(string annotation) 1583 * @see appendAnnotation(XMLNode annotation) 1584 * @see appendAnnotation(string annotation) 1585 * @see unsetAnnotation() 1586 */ public isSetAnnotation()1587 bool isSetAnnotation() { 1588 bool ret = libsbmlPINVOKE.SBase_isSetAnnotation(swigCPtr); 1589 return ret; 1590 } 1591 1592 1593 /** 1594 * Predicate returning @c true if this 1595 * object's 'sboTerm' attribute is set. 1596 * 1597 * @return @c true if the 'sboTerm' attribute of this SBML object is 1598 * set, @c false otherwise. 1599 */ public isSetSBOTerm()1600 bool isSetSBOTerm() { 1601 bool ret = libsbmlPINVOKE.SBase_isSetSBOTerm(swigCPtr); 1602 return ret; 1603 } 1604 1605 1606 /** 1607 * Sets the value of the meta-identifier attribute of this SBML object. 1608 * 1609 * 1610 * 1611 * The optional attribute named 'metaid', present on every major SBML 1612 * component type, is for supporting metadata annotations using RDF (<a 1613 * href='http://www.w3.org/RDF/'>Resource Description Format</a>). The 1614 * attribute value has the data type <a 1615 * href='http://www.w3.org/TR/REC-xml/#id'>XML <code>ID</code></a>, the XML 1616 * identifier type, which means each 'metaid' value must be globally unique 1617 * within an SBML file. The latter point is important, because the 1618 * uniqueness criterion applies across <em>any</em> attribute with type 1619 * <code>ID</code> anywhere in the file, not just the 'metaid' attribute used 1620 * by SBML---something to be aware of if your application-specific XML 1621 * content inside the 'annotation' subelement happens to use the XML 1622 * <code>ID</code> type. Although SBML itself specifies the use of <a 1623 * href='http://www.w3.org/TR/REC-xml/#id'>XML <code>ID</code></a> only for 1624 * the 'metaid' attribute, SBML-compatible applications should be careful if 1625 * they use XML <code>ID</code>'s in XML portions of a model that are not 1626 * defined by SBML, such as in the application-specific content of the 1627 * 'annotation' subelement. Finally, note that LibSBML does not provide an 1628 * explicit XML <code>ID</code> data type; it uses ordinary character 1629 * strings, which is easier for applications to support. 1630 * 1631 * 1632 * 1633 * The string @p metaid is copied. 1634 * 1635 * @param metaid the identifier string to use as the value of the 1636 * 'metaid' attribute. 1637 * 1638 * 1639 * @return integer value indicating success/failure of the 1640 * function. @if clike The value is drawn from the 1641 * enumeration #OperationReturnValues_t. @endif The possible values 1642 * returned by this function are: 1643 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1644 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1645 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 1646 * 1647 * @see getMetaId() 1648 * @see isSetMetaId() 1649 */ public setMetaId(string metaid)1650 int setMetaId(string metaid) { 1651 int ret = libsbmlPINVOKE.SBase_setMetaId(swigCPtr, metaid); 1652 return ret; 1653 } 1654 1655 1656 /** 1657 * Predicate returning @c true if this 1658 * object has a ModelHistory object attached to it. 1659 * 1660 * @return @c true if the ModelHistory of this object is set, 1661 * @c false otherwise. 1662 * 1663 * @note In SBML Level 2, model history annotations were only 1664 * permitted on the Model element. In SBML Level 3, they are 1665 * permitted on all SBML components derived from SBase. 1666 */ public isSetModelHistory()1667 bool isSetModelHistory() { 1668 bool ret = libsbmlPINVOKE.SBase_isSetModelHistory(swigCPtr); 1669 return ret; 1670 } 1671 1672 1673 /** 1674 * Sets the value of the 'id' attribute of this SBML object. 1675 * 1676 * 1677 * 1678 * The string @p sid is copied. 1679 * 1680 * 1681 * 1682 * The identifier given by an object's 'id' attribute value 1683 * is used to identify the object within the SBML model definition. 1684 * Other objects can refer to the component using this identifier. The 1685 * data type of 'id' is always <code>SId</code> or a type derived 1686 * from that, such as <code>UnitSId</code>, depending on the object in 1687 * question. All data types are defined as follows: 1688 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 1689 * letter ::= 'a'..'z','A'..'Z' 1690 * digit ::= '0'..'9' 1691 * idChar ::= letter | digit | '_' 1692 * SId ::= ( letter | '_' ) idChar* 1693 * </pre> 1694 * The characters <code>(</code> and <code>)</code> are used for grouping, 1695 * the character <code>*</code> 'zero or more times', and the character 1696 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 1697 * is determined by an exact character sequence match; i.e., comparisons must 1698 * be performed in a case-sensitive manner. This applies to all uses of 1699 * <code>SId</code>, <code>SIdRef</code>, and derived types. 1700 * 1701 * Users need to be aware of some important API issues that are the result of 1702 * the history of SBML and libSBML. Prior to SBML Level 3 1703 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 1704 * of SBML objects. To simplify the work of programmers, libSBML's API 1705 * provided get, set, check, and unset on the SBase object class itself 1706 * instead of on individual subobject classes. This made the 1707 * get/set/etc. methods uniformly available on all objects in the libSBML 1708 * API. LibSBML simply returned empty strings or otherwise did not act when 1709 * the methods were applied to SBML objects that were not defined by the SBML 1710 * specification to have 'id' or 'name' attributes. Additional complications 1711 * arose with the rule and assignment objects: InitialAssignment, 1712 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 1713 * the rule object hierarchy was different, and in addition, then as now, 1714 * they possess different attributes: 'variable' (for the rules and event 1715 * assignments), 'symbol' (for initial assignments), or neither (for 1716 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 1717 * would always return an empty string, and isSetId() would always return @c 1718 * false for objects of these classes. 1719 * 1720 * With the addition of 'id' and 'name' attributes on SBase in Level 3 1721 * Version 2, it became necessary to introduce a new way to interact 1722 * with the attributes more consistently in libSBML to avoid breaking 1723 * backward compatibility in the behavior of the original 'id' methods. For 1724 * this reason, libSBML provides four functions (getIdAttribute(), 1725 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 1726 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 1727 * from SBase, regardless of the object's type. <strong>These new methods 1728 * should be used instead of the older getId()/setId()/etc. methods</strong> 1729 * unless the old behavior is somehow necessary. Regardless of the Level and 1730 * Version of the SBML, these functions allow client applications to use more 1731 * generalized code in some situations (for instance, when manipulating 1732 * objects that are all known to have identifiers). If the object in 1733 * question does not posess an 'id' attribute according to the SBML 1734 * specification for the Level and Version in use, libSBML will not allow the 1735 * identifier to be set, nor will it read or write 'id' attributes for those 1736 * objects. 1737 * 1738 * 1739 * 1740 * @param sid the string to use as the identifier of this object. 1741 * 1742 * 1743 * @return integer value indicating success/failure of the 1744 * function. @if clike The value is drawn from the 1745 * enumeration #OperationReturnValues_t. @endif The possible values 1746 * returned by this function are: 1747 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1748 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1749 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 1750 * 1751 * @see getIdAttribute() 1752 * @see setIdAttribute(string sid) 1753 * @see isSetIdAttribute() 1754 * @see unsetIdAttribute() 1755 * 1756 * 1757 */ public new setId(string sid)1758 int setId(string sid) { 1759 int ret = libsbmlPINVOKE.SBase_setId(swigCPtr, sid); 1760 return ret; 1761 } 1762 1763 1764 /** 1765 * Sets the value of the 'id' attribute of this SBML object. 1766 * 1767 * 1768 * 1769 * The string @p sid is copied. 1770 * 1771 * 1772 * 1773 * The identifier given by an object's 'id' attribute value 1774 * is used to identify the object within the SBML model definition. 1775 * Other objects can refer to the component using this identifier. The 1776 * data type of 'id' is always <code>SId</code> or a type derived 1777 * from that, such as <code>UnitSId</code>, depending on the object in 1778 * question. All data types are defined as follows: 1779 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 1780 * letter ::= 'a'..'z','A'..'Z' 1781 * digit ::= '0'..'9' 1782 * idChar ::= letter | digit | '_' 1783 * SId ::= ( letter | '_' ) idChar* 1784 * </pre> 1785 * The characters <code>(</code> and <code>)</code> are used for grouping, 1786 * the character <code>*</code> 'zero or more times', and the character 1787 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 1788 * is determined by an exact character sequence match; i.e., comparisons must 1789 * be performed in a case-sensitive manner. This applies to all uses of 1790 * <code>SId</code>, <code>SIdRef</code>, and derived types. 1791 * 1792 * Users need to be aware of some important API issues that are the result of 1793 * the history of SBML and libSBML. Prior to SBML Level 3 1794 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 1795 * of SBML objects. To simplify the work of programmers, libSBML's API 1796 * provided get, set, check, and unset on the SBase object class itself 1797 * instead of on individual subobject classes. This made the 1798 * get/set/etc. methods uniformly available on all objects in the libSBML 1799 * API. LibSBML simply returned empty strings or otherwise did not act when 1800 * the methods were applied to SBML objects that were not defined by the SBML 1801 * specification to have 'id' or 'name' attributes. Additional complications 1802 * arose with the rule and assignment objects: InitialAssignment, 1803 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 1804 * the rule object hierarchy was different, and in addition, then as now, 1805 * they possess different attributes: 'variable' (for the rules and event 1806 * assignments), 'symbol' (for initial assignments), or neither (for 1807 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 1808 * would always return an empty string, and isSetId() would always return @c 1809 * false for objects of these classes. 1810 * 1811 * With the addition of 'id' and 'name' attributes on SBase in Level 3 1812 * Version 2, it became necessary to introduce a new way to interact 1813 * with the attributes more consistently in libSBML to avoid breaking 1814 * backward compatibility in the behavior of the original 'id' methods. For 1815 * this reason, libSBML provides four functions (getIdAttribute(), 1816 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 1817 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 1818 * from SBase, regardless of the object's type. <strong>These new methods 1819 * should be used instead of the older getId()/setId()/etc. methods</strong> 1820 * unless the old behavior is somehow necessary. Regardless of the Level and 1821 * Version of the SBML, these functions allow client applications to use more 1822 * generalized code in some situations (for instance, when manipulating 1823 * objects that are all known to have identifiers). If the object in 1824 * question does not posess an 'id' attribute according to the SBML 1825 * specification for the Level and Version in use, libSBML will not allow the 1826 * identifier to be set, nor will it read or write 'id' attributes for those 1827 * objects. 1828 * 1829 * 1830 * 1831 * @param sid the string to use as the identifier of this object. 1832 * 1833 * 1834 * @return integer value indicating success/failure of the 1835 * function. @if clike The value is drawn from the 1836 * enumeration #OperationReturnValues_t. @endif The possible values 1837 * returned by this function are: 1838 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1839 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1840 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 1841 * 1842 * @see getIdAttribute() 1843 * @see setIdAttribute(string sid) 1844 * @see isSetIdAttribute() 1845 * @see unsetIdAttribute() 1846 * 1847 * 1848 */ public new setIdAttribute(string sid)1849 int setIdAttribute(string sid) { 1850 int ret = libsbmlPINVOKE.SBase_setIdAttribute(swigCPtr, sid); 1851 return ret; 1852 } 1853 1854 1855 /** 1856 * Sets the value of the 'name' attribute of this SBML object. 1857 * 1858 * 1859 * 1860 * 1861 * The string in @p name is copied. 1862 * 1863 * @param name the new name for the SBML object. 1864 * 1865 * 1866 * @return integer value indicating success/failure of the 1867 * function. @if clike The value is drawn from the 1868 * enumeration #OperationReturnValues_t. @endif The possible values 1869 * returned by this function are: 1870 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1871 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1872 * 1873 * 1874 */ public new setName(string name)1875 int setName(string name) { 1876 int ret = libsbmlPINVOKE.SBase_setName(swigCPtr, name); 1877 return ret; 1878 } 1879 1880 1881 /** 1882 * Sets the value of the 'annotation' subelement of this SBML object. 1883 * 1884 * The content of @p annotation is copied, and any previous content of 1885 * this object's 'annotation' subelement is deleted. 1886 * 1887 * Whereas the SBase 'notes' subelement is a container for content to be 1888 * shown directly to humans, the 'annotation' element is a container for 1889 * optional software-generated content @em not meant to be shown to 1890 * humans. Every object derived from SBase can have its own value for 1891 * 'annotation'. The element's content type is <a target='_blank' 1892 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 1893 * 'any'</a>, allowing essentially arbitrary well-formed XML data 1894 * content. 1895 * 1896 * SBML places a few restrictions on the organization of the content of 1897 * annotations; these are intended to help software tools read and write 1898 * the data as well as help reduce conflicts between annotations added by 1899 * different tools. Please see the SBML specifications for more details. 1900 * 1901 * Call this method will result in any existing content of the 1902 * 'annotation' subelement to be discarded. Unless you have taken steps 1903 * to first copy and reconstitute any existing annotations into the @p 1904 * annotation that is about to be assigned, it is likely that performing 1905 * such wholesale replacement is unfriendly towards other software 1906 * applications whose annotations are discarded. An alternative may be 1907 * to use SBase::appendAnnotation(XMLNode annotation) or 1908 * SBase::appendAnnotation(string annotation). 1909 * 1910 * @param annotation an XML structure that is to be used as the new content 1911 * of the 'annotation' subelement of this object. 1912 * 1913 * 1914 * @return integer value indicating success/failure of the 1915 * function. @if clike The value is drawn from the 1916 * enumeration #OperationReturnValues_t. @endif This particular 1917 * function only does one thing irrespective of user input or 1918 * object state, and thus will only return a single value: 1919 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1920 * 1921 * @see getAnnotationString() 1922 * @see isSetAnnotation() 1923 * @see setAnnotation(string annotation) 1924 * @see appendAnnotation(XMLNode annotation) 1925 * @see appendAnnotation(string annotation) 1926 * @see unsetAnnotation() 1927 */ public new setAnnotation(XMLNode annotation)1928 int setAnnotation(XMLNode annotation) { 1929 int ret = libsbmlPINVOKE.SBase_setAnnotation__SWIG_0(swigCPtr, XMLNode.getCPtr(annotation)); 1930 return ret; 1931 } 1932 1933 1934 /** 1935 * Sets the value of the 'annotation' subelement of this SBML object. 1936 * 1937 * The content of @p annotation is copied, and any previous content of 1938 * this object's 'annotation' subelement is deleted. 1939 * 1940 * Whereas the SBase 'notes' subelement is a container for content to be 1941 * shown directly to humans, the 'annotation' element is a container for 1942 * optional software-generated content @em not meant to be shown to 1943 * humans. Every object derived from SBase can have its own value for 1944 * 'annotation'. The element's content type is <a target='_blank' 1945 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 1946 * 'any'</a>, allowing essentially arbitrary well-formed XML data 1947 * content. 1948 * 1949 * SBML places a few restrictions on the organization of the content of 1950 * annotations; these are intended to help software tools read and write 1951 * the data as well as help reduce conflicts between annotations added by 1952 * different tools. Please see the SBML specifications for more details. 1953 * 1954 * Call this method will result in any existing content of the 1955 * 'annotation' subelement to be discarded. Unless you have taken steps 1956 * to first copy and reconstitute any existing annotations into the @p 1957 * annotation that is about to be assigned, it is likely that performing 1958 * such wholesale replacement is unfriendly towards other software 1959 * applications whose annotations are discarded. An alternative may be 1960 * to use SBase::appendAnnotation(XMLNode annotation) or 1961 * SBase::appendAnnotation(string annotation). 1962 * 1963 * @param annotation an XML string that is to be used as the content 1964 * of the 'annotation' subelement of this object. 1965 * 1966 * 1967 * @return integer value indicating success/failure of the 1968 * function. @if clike The value is drawn from the 1969 * enumeration #OperationReturnValues_t. @endif The possible values 1970 * returned by this function are: 1971 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1972 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1973 * 1974 * @see getAnnotationString() 1975 * @see isSetAnnotation() 1976 * @see setAnnotation(XMLNode annotation) 1977 * @see appendAnnotation(XMLNode annotation) 1978 * @see appendAnnotation(string annotation) 1979 * @see unsetAnnotation() 1980 */ public new setAnnotation(string annotation)1981 int setAnnotation(string annotation) { 1982 int ret = libsbmlPINVOKE.SBase_setAnnotation__SWIG_1(swigCPtr, annotation); 1983 return ret; 1984 } 1985 1986 1987 /** 1988 * Appends the given @p annotation to the 'annotation' subelement of this 1989 * object. 1990 * 1991 * Whereas the SBase 'notes' subelement is a container for content to be 1992 * shown directly to humans, the 'annotation' element is a container for 1993 * optional software-generated content @em not meant to be shown to 1994 * humans. Every object derived from SBase can have its own value for 1995 * 'annotation'. The element's content type is <a 1996 * target='_blank' 1997 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 'any'</a>, 1998 * allowing essentially arbitrary well-formed XML data content. 1999 * 2000 * SBML places a few restrictions on the organization of the content of 2001 * annotations; these are intended to help software tools read and write 2002 * the data as well as help reduce conflicts between annotations added by 2003 * different tools. Please see the SBML specifications for more details. 2004 * 2005 * Unlike SBase::setAnnotation(XMLNode annotation) or 2006 * SBase::setAnnotation(string annotation), this method 2007 * allows other annotations to be preserved when an application adds its 2008 * own data. 2009 * 2010 * @param annotation an XML structure that is to be copied and appended 2011 * to the content of the 'annotation' subelement of this object. 2012 * 2013 * 2014 * @return integer value indicating success/failure of the 2015 * function. @if clike The value is drawn from the 2016 * enumeration #OperationReturnValues_t. @endif The possible values 2017 * returned by this function are: 2018 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2019 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2020 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 2021 * (if the parent element does not have the 'metaid' attribute set) 2022 * @li @link libsbml#LIBSBML_DUPLICATE_ANNOTATION_NS LIBSBML_DUPLICATE_ANNOTATION_NS@endlink 2023 * (if the parent was already annotated with the annotation in question) 2024 * 2025 * @see getAnnotationString() 2026 * @see isSetAnnotation() 2027 * @see setAnnotation(XMLNode annotation) 2028 * @see setAnnotation(string annotation) 2029 * @see appendAnnotation(string annotation) 2030 * @see unsetAnnotation() 2031 */ public new appendAnnotation(XMLNode annotation)2032 int appendAnnotation(XMLNode annotation) { 2033 int ret = libsbmlPINVOKE.SBase_appendAnnotation__SWIG_0(swigCPtr, XMLNode.getCPtr(annotation)); 2034 return ret; 2035 } 2036 2037 2038 /** 2039 * Appends the given @p annotation to the 'annotation' subelement of this 2040 * object. 2041 * 2042 * Whereas the SBase 'notes' subelement is a container for content to be 2043 * shown directly to humans, the 'annotation' element is a container for 2044 * optional software-generated content @em not meant to be shown to 2045 * humans. Every object derived from SBase can have its own value for 2046 * 'annotation'. The element's content type is <a 2047 * target='_blank' 2048 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 'any'</a>, 2049 * allowing essentially arbitrary well-formed XML data content. 2050 * 2051 * SBML places a few restrictions on the organization of the content of 2052 * annotations; these are intended to help software tools read and write 2053 * the data as well as help reduce conflicts between annotations added by 2054 * different tools. Please see the SBML specifications for more details. 2055 * 2056 * Unlike SBase::setAnnotation(XMLNode annotation) or 2057 * SBase::setAnnotation(string annotation), this method 2058 * allows other annotations to be preserved when an application adds its 2059 * own data. 2060 * 2061 * @param annotation an XML string that is to be copied and appended 2062 * to the content of the 'annotation' subelement of this object. 2063 * 2064 * 2065 * @return integer value indicating success/failure of the 2066 * function. @if clike The value is drawn from the 2067 * enumeration #OperationReturnValues_t. @endif The possible values 2068 * returned by this function are: 2069 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2070 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2071 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 2072 * (if the parent element does not have the 'metaid' attribute set) 2073 * @li @link libsbml#LIBSBML_DUPLICATE_ANNOTATION_NS LIBSBML_DUPLICATE_ANNOTATION_NS@endlink 2074 * (if the parent was already annotated with the annotation in question) 2075 * 2076 * @see getAnnotationString() 2077 * @see isSetAnnotation() 2078 * @see setAnnotation(XMLNode annotation) 2079 * @see setAnnotation(string annotation) 2080 * @see appendAnnotation(XMLNode annotation) 2081 * @see unsetAnnotation() 2082 */ public new appendAnnotation(string annotation)2083 int appendAnnotation(string annotation) { 2084 int ret = libsbmlPINVOKE.SBase_appendAnnotation__SWIG_1(swigCPtr, annotation); 2085 return ret; 2086 } 2087 2088 2089 /** 2090 * Removes the top-level element within the 'annotation' subelement of this 2091 * SBML object with the given name and optional URI. 2092 * 2093 * SBML places a few restrictions on the organization of the content of 2094 * annotations; these are intended to help software tools read and write 2095 * the data as well as help reduce conflicts between annotations added by 2096 * different tools. Please see the SBML specifications for more details. 2097 * 2098 * Calling this method allows a particular annotation element to be removed 2099 * whilst the remaining annotations remain intact. 2100 * 2101 * @param elementName a string representing the name of the top level 2102 * annotation element that is to be removed. 2103 * @param elementURI an optional string that is used to check both the name 2104 * and URI of the top level element to be removed. 2105 * @param removeEmpty if after removing of the element, the annotation is 2106 * empty, and the removeEmpty argument is true, the annotation node will be 2107 * deleted (default). 2108 * 2109 * 2110 * @return integer value indicating success/failure of the 2111 * function. @if clike The value is drawn from the 2112 * enumeration #OperationReturnValues_t. @endif The possible values 2113 * returned by this function are: 2114 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2115 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2116 * @li @link libsbml#LIBSBML_ANNOTATION_NAME_NOT_FOUND LIBSBML_ANNOTATION_NAME_NOT_FOUND@endlink 2117 * @li @link libsbml#LIBSBML_ANNOTATION_NS_NOT_FOUND LIBSBML_ANNOTATION_NS_NOT_FOUND@endlink 2118 * 2119 * @see replaceTopLevelAnnotationElement(XMLNode ) 2120 * @see replaceTopLevelAnnotationElement(string) 2121 */ public removeTopLevelAnnotationElement(string elementName, string elementURI, bool removeEmpty)2122 int removeTopLevelAnnotationElement(string elementName, string elementURI, bool removeEmpty) { 2123 int ret = libsbmlPINVOKE.SBase_removeTopLevelAnnotationElement__SWIG_0(swigCPtr, elementName, elementURI, removeEmpty); 2124 return ret; 2125 } 2126 2127 2128 /** 2129 * Removes the top-level element within the 'annotation' subelement of this 2130 * SBML object with the given name and optional URI. 2131 * 2132 * SBML places a few restrictions on the organization of the content of 2133 * annotations; these are intended to help software tools read and write 2134 * the data as well as help reduce conflicts between annotations added by 2135 * different tools. Please see the SBML specifications for more details. 2136 * 2137 * Calling this method allows a particular annotation element to be removed 2138 * whilst the remaining annotations remain intact. 2139 * 2140 * @param elementName a string representing the name of the top level 2141 * annotation element that is to be removed. 2142 * @param elementURI an optional string that is used to check both the name 2143 * and URI of the top level element to be removed. 2144 * @param removeEmpty if after removing of the element, the annotation is 2145 * empty, and the removeEmpty argument is true, the annotation node will be 2146 * deleted (default). 2147 * 2148 * 2149 * @return integer value indicating success/failure of the 2150 * function. @if clike The value is drawn from the 2151 * enumeration #OperationReturnValues_t. @endif The possible values 2152 * returned by this function are: 2153 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2154 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2155 * @li @link libsbml#LIBSBML_ANNOTATION_NAME_NOT_FOUND LIBSBML_ANNOTATION_NAME_NOT_FOUND@endlink 2156 * @li @link libsbml#LIBSBML_ANNOTATION_NS_NOT_FOUND LIBSBML_ANNOTATION_NS_NOT_FOUND@endlink 2157 * 2158 * @see replaceTopLevelAnnotationElement(XMLNode ) 2159 * @see replaceTopLevelAnnotationElement(string) 2160 */ public removeTopLevelAnnotationElement(string elementName, string elementURI)2161 int removeTopLevelAnnotationElement(string elementName, string elementURI) { 2162 int ret = libsbmlPINVOKE.SBase_removeTopLevelAnnotationElement__SWIG_1(swigCPtr, elementName, elementURI); 2163 return ret; 2164 } 2165 2166 2167 /** 2168 * Removes the top-level element within the 'annotation' subelement of this 2169 * SBML object with the given name and optional URI. 2170 * 2171 * SBML places a few restrictions on the organization of the content of 2172 * annotations; these are intended to help software tools read and write 2173 * the data as well as help reduce conflicts between annotations added by 2174 * different tools. Please see the SBML specifications for more details. 2175 * 2176 * Calling this method allows a particular annotation element to be removed 2177 * whilst the remaining annotations remain intact. 2178 * 2179 * @param elementName a string representing the name of the top level 2180 * annotation element that is to be removed. 2181 * @param elementURI an optional string that is used to check both the name 2182 * and URI of the top level element to be removed. 2183 * @param removeEmpty if after removing of the element, the annotation is 2184 * empty, and the removeEmpty argument is true, the annotation node will be 2185 * deleted (default). 2186 * 2187 * 2188 * @return integer value indicating success/failure of the 2189 * function. @if clike The value is drawn from the 2190 * enumeration #OperationReturnValues_t. @endif The possible values 2191 * returned by this function are: 2192 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2193 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2194 * @li @link libsbml#LIBSBML_ANNOTATION_NAME_NOT_FOUND LIBSBML_ANNOTATION_NAME_NOT_FOUND@endlink 2195 * @li @link libsbml#LIBSBML_ANNOTATION_NS_NOT_FOUND LIBSBML_ANNOTATION_NS_NOT_FOUND@endlink 2196 * 2197 * @see replaceTopLevelAnnotationElement(XMLNode ) 2198 * @see replaceTopLevelAnnotationElement(string) 2199 */ public removeTopLevelAnnotationElement(string elementName)2200 int removeTopLevelAnnotationElement(string elementName) { 2201 int ret = libsbmlPINVOKE.SBase_removeTopLevelAnnotationElement__SWIG_2(swigCPtr, elementName); 2202 return ret; 2203 } 2204 2205 2206 /** 2207 * Replaces the given top-level element within the 'annotation' 2208 * subelement of this SBML object and with the annotation element supplied. 2209 * 2210 * SBML places a few restrictions on the organization of the content of 2211 * annotations; these are intended to help software tools read and write 2212 * the data as well as help reduce conflicts between annotations added by 2213 * different tools. Please see the SBML specifications for more details. 2214 * 2215 * This method determines the name of the element to be replaced from the 2216 * annotation argument. Functionally it is equivalent to calling <code> 2217 * removeTopLevelAnnotationElement(name)</code> followed by calling 2218 * <code>appendAnnotation(annotation_with_name)</code>, with the exception 2219 * that the placement of the annotation element remains the same. 2220 * 2221 * @param annotation XMLNode representing the replacement top level annotation. 2222 * 2223 * 2224 * @return integer value indicating success/failure of the 2225 * function. @if clike The value is drawn from the 2226 * enumeration #OperationReturnValues_t. @endif The possible values 2227 * returned by this function are: 2228 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2229 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2230 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 2231 * 2232 * @see removeTopLevelAnnotationElement(string elementName, string elementURI, bool removeEmpty) 2233 * @see replaceTopLevelAnnotationElement(string) 2234 */ public replaceTopLevelAnnotationElement(XMLNode annotation)2235 int replaceTopLevelAnnotationElement(XMLNode annotation) { 2236 int ret = libsbmlPINVOKE.SBase_replaceTopLevelAnnotationElement__SWIG_0(swigCPtr, XMLNode.getCPtr(annotation)); 2237 return ret; 2238 } 2239 2240 2241 /** 2242 * Replaces the given top-level element within the 'annotation' 2243 * subelement of this SBML object and with the annotation element supplied. 2244 * 2245 * SBML places a few restrictions on the organization of the content of 2246 * annotations; these are intended to help software tools read and write 2247 * the data as well as help reduce conflicts between annotations added by 2248 * different tools. Please see the SBML specifications for more details. 2249 * 2250 * This method determines the name of the element to be replaced from the 2251 * annotation argument. Functionally it is equivalent to calling <code> 2252 * removeTopLevelAnnotationElement(name)</code> followed by calling 2253 * <code>appendAnnotation(annotation_with_name)</code>, with the exception 2254 * that the placement of the annotation element remains the same. 2255 * 2256 * @param annotation string representing the replacement top level annotation. 2257 * 2258 * 2259 * @return integer value indicating success/failure of the 2260 * function. @if clike The value is drawn from the 2261 * enumeration #OperationReturnValues_t. @endif The possible values 2262 * returned by this function are: 2263 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2264 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2265 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 2266 * 2267 * @see removeTopLevelAnnotationElement(string elementName, string elementURI) 2268 * @see replaceTopLevelAnnotationElement(XMLNode) 2269 */ public replaceTopLevelAnnotationElement(string annotation)2270 int replaceTopLevelAnnotationElement(string annotation) { 2271 int ret = libsbmlPINVOKE.SBase_replaceTopLevelAnnotationElement__SWIG_1(swigCPtr, annotation); 2272 return ret; 2273 } 2274 2275 2276 /** 2277 * Sets the value of the 'notes' subelement of this SBML object. 2278 * 2279 * The content of @p notes is copied, and any existing content of this 2280 * object's 'notes' subelement is deleted. 2281 * 2282 * The optional SBML element named 'notes', present on every major SBML 2283 * component type, is intended as a place for storing optional 2284 * information intended to be seen by humans. An example use of the 2285 * 'notes' element would be to contain formatted user comments about the 2286 * model element in which the 'notes' element is enclosed. Every object 2287 * derived directly or indirectly from type SBase can have a separate 2288 * value for 'notes', allowing users considerable freedom when adding 2289 * comments to their models. 2290 * 2291 * The format of 'notes' elements must be <a target='_blank' 2292 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 2293 * verify the formatting of 'notes' content, libSBML provides the static 2294 * utility method SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode xhtml@endif); however, 2295 * readers are urged to consult the appropriate <a target='_blank' 2296 * href='http://sbml.org/Documents/Specifications'>SBML specification 2297 * document</a> for the Level and Version of their model for more 2298 * in-depth explanations. The SBML Level 2 and 3 2299 * specifications have considerable detail about how 'notes' element 2300 * content must be structured. 2301 * 2302 * @param notes an XML structure that is to be used as the content of the 2303 * 'notes' subelement of this object. 2304 * 2305 * 2306 * @return integer value indicating success/failure of the 2307 * function. @if clike The value is drawn from the 2308 * enumeration #OperationReturnValues_t. @endif The possible values 2309 * returned by this function are: 2310 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2311 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 2312 * 2313 * @see getNotesString() 2314 * @see isSetNotes() 2315 * @see setNotes(string notes, bool addXHTMLMarkup) 2316 * @see appendNotes(XMLNode notes) 2317 * @see appendNotes(string notes) 2318 * @see unsetNotes() 2319 * @see SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif) 2320 */ public setNotes(XMLNode notes)2321 int setNotes(XMLNode notes) { 2322 int ret = libsbmlPINVOKE.SBase_setNotes__SWIG_0(swigCPtr, XMLNode.getCPtr(notes)); 2323 return ret; 2324 } 2325 2326 2327 /** 2328 * Sets the value of the 'notes' subelement of this SBML object to a copy 2329 * of the string @p notes. 2330 * 2331 * The content of @p notes is copied, and any existing content of this 2332 * object's 'notes' subelement is deleted. 2333 * 2334 * The optional SBML element named 'notes', present on every major SBML 2335 * component type, is intended as a place for storing optional 2336 * information intended to be seen by humans. An example use of the 2337 * 'notes' element would be to contain formatted user comments about the 2338 * model element in which the 'notes' element is enclosed. Every object 2339 * derived directly or indirectly from type SBase can have a separate 2340 * value for 'notes', allowing users considerable freedom when adding 2341 * comments to their models. 2342 * 2343 * The format of 'notes' elements must be <a target='_blank' 2344 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 2345 * verify the formatting of 'notes' content, libSBML provides the static 2346 * utility method SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif); however, 2347 * readers are urged to consult the appropriate <a target='_blank' 2348 * href='http://sbml.org/Documents/Specifications'>SBML specification 2349 * document</a> for the Level and Version of their model for more 2350 * in-depth explanations. The SBML Level 2 and 3 2351 * specifications have considerable detail about how 'notes' element 2352 * content must be structured. 2353 * 2354 * The following code illustrates a very simple way of setting the notes 2355 * using this method. Here, the object being annotated is the whole SBML 2356 * document, but that is for illustration purposes only; you could of 2357 * course use this same approach to annotate any other SBML component. 2358 * @if cpp 2359 @code{.cpp} 2360 SBMLDocument s = new SBMLDocument(3, 1); 2361 s->setNotes('<body xmlns='http://www.w3.org/1999/xhtml'><p>here is my note</p></body>'); 2362 @endcode 2363 @endif 2364 @if java 2365 @code{.java} 2366 SBMLDocument s = new SBMLDocument(3, 1); 2367 s.setNotes('<body xmlns='http://www.w3.org/1999/xhtml'><p>here is my note</p></body>'); 2368 @endcode 2369 @endif 2370 @if python 2371 @code{.py} 2372 try: 2373 sbmlDoc = SBMLDocument(3, 1) 2374 except ValueError: 2375 print('Could not create SBMLDocument object') 2376 sys.exit(1) 2377 2378 note = '<body xmlns='http://www.w3.org/1999/xhtml'><p>here is my note</p></body>' 2379 2380 status = sbmlDoc.setNotes(note) 2381 if status != LIBSBML_OPERATION_SUCCESS: 2382 # Do something to handle the error here. 2383 print('Unable to set notes on the SBML document object') 2384 sys.exit(1) 2385 @endcode 2386 @endif 2387 @if csharp 2388 @code 2389 SBMLDocument s = new SBMLDocument(3, 1); 2390 s.setNotes('<body xmlns='http://www.w3.org/1999/xhtml'><p>here is my note</p></body>'); 2391 @endcode 2392 @endif 2393 * 2394 * @param notes an XML string that is to be used as the content of the 2395 * 'notes' subelement of this object. 2396 * 2397 * @param addXHTMLMarkup a boolean indicating whether to wrap the contents 2398 * of the @p notes argument with XHTML paragraph (<code><p></code>) 2399 * tags. This is appropriate when the string in @p notes does not already 2400 * containg the appropriate XHTML markup. 2401 * 2402 * 2403 * @return integer value indicating success/failure of the 2404 * function. @if clike The value is drawn from the 2405 * enumeration #OperationReturnValues_t. @endif The possible values 2406 * returned by this function are: 2407 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2408 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 2409 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2410 * 2411 * @see getNotesString() 2412 * @see isSetNotes() 2413 * @see setNotes(XMLNode notes) 2414 * @see appendNotes(XMLNode notes) 2415 * @see appendNotes(string notes) 2416 * @see unsetNotes() 2417 * @see SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif) 2418 */ public setNotes(string notes, bool addXHTMLMarkup)2419 int setNotes(string notes, bool addXHTMLMarkup) { 2420 int ret = libsbmlPINVOKE.SBase_setNotes__SWIG_1(swigCPtr, notes, addXHTMLMarkup); 2421 return ret; 2422 } 2423 2424 2425 /** 2426 * Sets the value of the 'notes' subelement of this SBML object to a copy 2427 * of the string @p notes. 2428 * 2429 * The content of @p notes is copied, and any existing content of this 2430 * object's 'notes' subelement is deleted. 2431 * 2432 * The optional SBML element named 'notes', present on every major SBML 2433 * component type, is intended as a place for storing optional 2434 * information intended to be seen by humans. An example use of the 2435 * 'notes' element would be to contain formatted user comments about the 2436 * model element in which the 'notes' element is enclosed. Every object 2437 * derived directly or indirectly from type SBase can have a separate 2438 * value for 'notes', allowing users considerable freedom when adding 2439 * comments to their models. 2440 * 2441 * The format of 'notes' elements must be <a target='_blank' 2442 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 2443 * verify the formatting of 'notes' content, libSBML provides the static 2444 * utility method SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif); however, 2445 * readers are urged to consult the appropriate <a target='_blank' 2446 * href='http://sbml.org/Documents/Specifications'>SBML specification 2447 * document</a> for the Level and Version of their model for more 2448 * in-depth explanations. The SBML Level 2 and 3 2449 * specifications have considerable detail about how 'notes' element 2450 * content must be structured. 2451 * 2452 * The following code illustrates a very simple way of setting the notes 2453 * using this method. Here, the object being annotated is the whole SBML 2454 * document, but that is for illustration purposes only; you could of 2455 * course use this same approach to annotate any other SBML component. 2456 * @if cpp 2457 @code{.cpp} 2458 SBMLDocument s = new SBMLDocument(3, 1); 2459 s->setNotes('<body xmlns='http://www.w3.org/1999/xhtml'><p>here is my note</p></body>'); 2460 @endcode 2461 @endif 2462 @if java 2463 @code{.java} 2464 SBMLDocument s = new SBMLDocument(3, 1); 2465 s.setNotes('<body xmlns='http://www.w3.org/1999/xhtml'><p>here is my note</p></body>'); 2466 @endcode 2467 @endif 2468 @if python 2469 @code{.py} 2470 try: 2471 sbmlDoc = SBMLDocument(3, 1) 2472 except ValueError: 2473 print('Could not create SBMLDocument object') 2474 sys.exit(1) 2475 2476 note = '<body xmlns='http://www.w3.org/1999/xhtml'><p>here is my note</p></body>' 2477 2478 status = sbmlDoc.setNotes(note) 2479 if status != LIBSBML_OPERATION_SUCCESS: 2480 # Do something to handle the error here. 2481 print('Unable to set notes on the SBML document object') 2482 sys.exit(1) 2483 @endcode 2484 @endif 2485 @if csharp 2486 @code 2487 SBMLDocument s = new SBMLDocument(3, 1); 2488 s.setNotes('<body xmlns='http://www.w3.org/1999/xhtml'><p>here is my note</p></body>'); 2489 @endcode 2490 @endif 2491 * 2492 * @param notes an XML string that is to be used as the content of the 2493 * 'notes' subelement of this object. 2494 * 2495 * @param addXHTMLMarkup a boolean indicating whether to wrap the contents 2496 * of the @p notes argument with XHTML paragraph (<code><p></code>) 2497 * tags. This is appropriate when the string in @p notes does not already 2498 * containg the appropriate XHTML markup. 2499 * 2500 * 2501 * @return integer value indicating success/failure of the 2502 * function. @if clike The value is drawn from the 2503 * enumeration #OperationReturnValues_t. @endif The possible values 2504 * returned by this function are: 2505 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2506 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 2507 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2508 * 2509 * @see getNotesString() 2510 * @see isSetNotes() 2511 * @see setNotes(XMLNode notes) 2512 * @see appendNotes(XMLNode notes) 2513 * @see appendNotes(string notes) 2514 * @see unsetNotes() 2515 * @see SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif) 2516 */ public setNotes(string notes)2517 int setNotes(string notes) { 2518 int ret = libsbmlPINVOKE.SBase_setNotes__SWIG_2(swigCPtr, notes); 2519 return ret; 2520 } 2521 2522 2523 /** 2524 * Appends the given @p notes to the 'notes' subelement of this object. 2525 * 2526 * The content of @p notes is copied. 2527 * 2528 * The optional SBML element named 'notes', present on every major SBML 2529 * component type, is intended as a place for storing optional 2530 * information intended to be seen by humans. An example use of the 2531 * 'notes' element would be to contain formatted user comments about the 2532 * model element in which the 'notes' element is enclosed. Every object 2533 * derived directly or indirectly from type SBase can have a separate 2534 * value for 'notes', allowing users considerable freedom when adding 2535 * comments to their models. 2536 * 2537 * The format of 'notes' elements must be <a target='_blank' 2538 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 2539 * verify the formatting of 'notes' content, libSBML provides the static 2540 * utility method SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif); however, 2541 * readers are urged to consult the appropriate <a target='_blank' 2542 * href='http://sbml.org/Documents/Specifications'>SBML specification 2543 * document</a> for the Level and Version of their model for more 2544 * in-depth explanations. The SBML Level 2 and 3 2545 * specifications have considerable detail about how 'notes' element 2546 * content must be structured. 2547 * 2548 * @param notes an XML node structure that is to appended to the content 2549 * of the 'notes' subelement of this object. 2550 * 2551 * 2552 * @return integer value indicating success/failure of the 2553 * function. @if clike The value is drawn from the 2554 * enumeration #OperationReturnValues_t. @endif The possible values 2555 * returned by this function are: 2556 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2557 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 2558 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2559 * 2560 * @see getNotesString() 2561 * @see isSetNotes() 2562 * @see setNotes(XMLNode notes) 2563 * @see setNotes(string notes, bool addXHTMLMarkup) 2564 * @see appendNotes(string notes) 2565 * @see unsetNotes() 2566 * @see SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif) 2567 */ public appendNotes(XMLNode notes)2568 int appendNotes(XMLNode notes) { 2569 int ret = libsbmlPINVOKE.SBase_appendNotes__SWIG_0(swigCPtr, XMLNode.getCPtr(notes)); 2570 return ret; 2571 } 2572 2573 2574 /** 2575 * Appends the given @p notes to the 'notes' subelement of this object. 2576 * 2577 * The content of the parameter @p notes is copied. 2578 * 2579 * The optional SBML element named 'notes', present on every major SBML 2580 * component type, is intended as a place for storing optional 2581 * information intended to be seen by humans. An example use of the 2582 * 'notes' element would be to contain formatted user comments about the 2583 * model element in which the 'notes' element is enclosed. Every object 2584 * derived directly or indirectly from type SBase can have a separate 2585 * value for 'notes', allowing users considerable freedom when adding 2586 * comments to their models. 2587 * 2588 * The format of 'notes' elements must be <a target='_blank' 2589 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 2590 * verify the formatting of 'notes' content, libSBML provides the static 2591 * utility method SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif); however, 2592 * readers are urged to consult the appropriate <a target='_blank' 2593 * href='http://sbml.org/Documents/Specifications'>SBML specification 2594 * document</a> for the Level and Version of their model for more 2595 * in-depth explanations. The SBML Level 2 and 3 2596 * specifications have considerable detail about how 'notes' element 2597 * content must be structured. 2598 * 2599 * @param notes an XML string that is to appended to the content of 2600 * the 'notes' subelement of this object. 2601 * 2602 * 2603 * @return integer value indicating success/failure of the 2604 * function. @if clike The value is drawn from the 2605 * enumeration #OperationReturnValues_t. @endif The possible values 2606 * returned by this function are: 2607 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2608 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 2609 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2610 * 2611 * @see getNotesString() 2612 * @see isSetNotes() 2613 * @see setNotes(XMLNode notes) 2614 * @see setNotes(string notes, bool addXHTMLMarkup) 2615 * @see appendNotes(XMLNode notes) 2616 * @see unsetNotes() 2617 * @see SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif) 2618 */ public appendNotes(string notes)2619 int appendNotes(string notes) { 2620 int ret = libsbmlPINVOKE.SBase_appendNotes__SWIG_1(swigCPtr, notes); 2621 return ret; 2622 } 2623 2624 2625 /** 2626 * Sets the ModelHistory of this object. 2627 * 2628 * The content of @p history is copied, and this object's existing model 2629 * history content is deleted. 2630 * 2631 * @param history ModelHistory of this object. 2632 * 2633 * 2634 * @return integer value indicating success/failure of the 2635 * function. @if clike The value is drawn from the 2636 * enumeration #OperationReturnValues_t. @endif The possible values 2637 * returned by this function are: 2638 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2639 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 2640 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 2641 * 2642 * @note In SBML Level 2, model history annotations were only 2643 * permitted on the Model element. In SBML Level 3, they are 2644 * permitted on all SBML components derived from SBase. 2645 */ public setModelHistory(ModelHistory history)2646 int setModelHistory(ModelHistory history) { 2647 int ret = libsbmlPINVOKE.SBase_setModelHistory(swigCPtr, ModelHistory.getCPtr(history)); 2648 return ret; 2649 } 2650 2651 2652 /** */ /* libsbml-internal */ public new connectToParent(SBase parent)2653 void connectToParent(SBase parent) { 2654 libsbmlPINVOKE.SBase_connectToParent(swigCPtr, SBase.getCPtr(parent)); 2655 } 2656 connectToChild()2657 public virtual void connectToChild() { 2658 libsbmlPINVOKE.SBase_connectToChild(swigCPtr); 2659 } 2660 2661 2662 /** 2663 * Sets the value of the 'sboTerm' attribute. 2664 * 2665 * 2666 * 2667 * Beginning with SBML Level 2 Version 2, objects derived from SBase have 2668 * an optional attribute named 'sboTerm' for supporting the use of the 2669 * Systems Biology Ontology. In SBML proper, the data type of the 2670 * attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a 2671 * seven digit integer number; libSBML simplifies the representation by 2672 * only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 2673 * 'sboTerm' attribute on SBase has data type @c int, and SBO identifiers 2674 * are stored simply as integers. 2675 * 2676 * 2677 * 2678 * 2679 * SBO terms are a type of optional annotation, and each different class 2680 * of SBML object derived from SBase imposes its own requirements about 2681 * the values permitted for 'sboTerm'. More details can be found in SBML 2682 * specifications for Level 2 Version 2 and above. 2683 * 2684 * 2685 * 2686 * @param value the NNNNNNN integer portion of the SBO identifier. 2687 * 2688 * 2689 * @return integer value indicating success/failure of the 2690 * function. @if clike The value is drawn from the 2691 * enumeration #OperationReturnValues_t. @endif The possible values 2692 * returned by this function are: 2693 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2694 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 2695 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 2696 * 2697 * @see setSBOTerm(string &sboid) 2698 */ public new setSBOTerm(int value)2699 int setSBOTerm(int value) { 2700 int ret = libsbmlPINVOKE.SBase_setSBOTerm__SWIG_0(swigCPtr, value); 2701 return ret; 2702 } 2703 2704 2705 /** 2706 * Sets the value of the 'sboTerm' attribute by string. 2707 * 2708 * 2709 * 2710 * Beginning with SBML Level 2 Version 2, objects derived from SBase have 2711 * an optional attribute named 'sboTerm' for supporting the use of the 2712 * Systems Biology Ontology. In SBML proper, the data type of the 2713 * attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a 2714 * seven digit integer number; libSBML simplifies the representation by 2715 * only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 2716 * 'sboTerm' attribute on SBase has data type @c int, and SBO identifiers 2717 * are stored simply as integers. 2718 * 2719 * 2720 * 2721 * 2722 * SBO terms are a type of optional annotation, and each different class 2723 * of SBML object derived from SBase imposes its own requirements about 2724 * the values permitted for 'sboTerm'. More details can be found in SBML 2725 * specifications for Level 2 Version 2 and above. 2726 * 2727 * 2728 * 2729 * @param sboid the SBO identifier string of the form 'SBO:NNNNNNN'. 2730 * 2731 * 2732 * @return integer value indicating success/failure of the 2733 * function. @if clike The value is drawn from the 2734 * enumeration #OperationReturnValues_t. @endif The possible values 2735 * returned by this function are: 2736 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2737 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 2738 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 2739 * 2740 * @see setSBOTerm(int value) 2741 */ public new setSBOTerm(string sboid)2742 int setSBOTerm(string sboid) { 2743 int ret = libsbmlPINVOKE.SBase_setSBOTerm__SWIG_1(swigCPtr, sboid); 2744 return ret; 2745 } 2746 2747 2748 /** 2749 * Sets the namespaces relevant of this SBML object. 2750 * 2751 * The content of @p xmlns is copied, and this object's existing 2752 * namespace content is deleted. 2753 * 2754 * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces 2755 * information. It is used to communicate the SBML Level, Version, and 2756 * (in Level 3) packages used in addition to SBML Level 3 Core. 2757 * 2758 * @param xmlns the namespaces to set. 2759 * 2760 * 2761 * @return integer value indicating success/failure of the 2762 * function. @if clike The value is drawn from the 2763 * enumeration #OperationReturnValues_t. @endif The possible values 2764 * returned by this function are: 2765 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2766 */ public setNamespaces(XMLNamespaces xmlns)2767 int setNamespaces(XMLNamespaces xmlns) { 2768 int ret = libsbmlPINVOKE.SBase_setNamespaces(swigCPtr, XMLNamespaces.getCPtr(xmlns)); 2769 return ret; 2770 } 2771 2772 2773 /** 2774 * Unsets the value of the 'metaid' attribute of this SBML object. 2775 * 2776 * 2777 * 2778 * The optional attribute named 'metaid', present on every major SBML 2779 * component type, is for supporting metadata annotations using RDF (<a 2780 * href='http://www.w3.org/RDF/'>Resource Description Format</a>). The 2781 * attribute value has the data type <a 2782 * href='http://www.w3.org/TR/REC-xml/#id'>XML <code>ID</code></a>, the XML 2783 * identifier type, which means each 'metaid' value must be globally unique 2784 * within an SBML file. The latter point is important, because the 2785 * uniqueness criterion applies across <em>any</em> attribute with type 2786 * <code>ID</code> anywhere in the file, not just the 'metaid' attribute used 2787 * by SBML---something to be aware of if your application-specific XML 2788 * content inside the 'annotation' subelement happens to use the XML 2789 * <code>ID</code> type. Although SBML itself specifies the use of <a 2790 * href='http://www.w3.org/TR/REC-xml/#id'>XML <code>ID</code></a> only for 2791 * the 'metaid' attribute, SBML-compatible applications should be careful if 2792 * they use XML <code>ID</code>'s in XML portions of a model that are not 2793 * defined by SBML, such as in the application-specific content of the 2794 * 'annotation' subelement. Finally, note that LibSBML does not provide an 2795 * explicit XML <code>ID</code> data type; it uses ordinary character 2796 * strings, which is easier for applications to support. 2797 * 2798 * 2799 * 2800 * 2801 * @return integer value indicating success/failure of the 2802 * function. @if clike The value is drawn from the 2803 * enumeration #OperationReturnValues_t. @endif The possible values 2804 * returned by this function are: 2805 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2806 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 2807 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2808 */ public unsetMetaId()2809 int unsetMetaId() { 2810 int ret = libsbmlPINVOKE.SBase_unsetMetaId(swigCPtr); 2811 return ret; 2812 } 2813 2814 2815 /** 2816 * Unsets the value of the 'id' attribute of this SBML object. 2817 * 2818 * 2819 * 2820 * 2821 * The identifier given by an object's 'id' attribute value 2822 * is used to identify the object within the SBML model definition. 2823 * Other objects can refer to the component using this identifier. The 2824 * data type of 'id' is always <code>SId</code> or a type derived 2825 * from that, such as <code>UnitSId</code>, depending on the object in 2826 * question. All data types are defined as follows: 2827 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 2828 * letter ::= 'a'..'z','A'..'Z' 2829 * digit ::= '0'..'9' 2830 * idChar ::= letter | digit | '_' 2831 * SId ::= ( letter | '_' ) idChar* 2832 * </pre> 2833 * The characters <code>(</code> and <code>)</code> are used for grouping, 2834 * the character <code>*</code> 'zero or more times', and the character 2835 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 2836 * is determined by an exact character sequence match; i.e., comparisons must 2837 * be performed in a case-sensitive manner. This applies to all uses of 2838 * <code>SId</code>, <code>SIdRef</code>, and derived types. 2839 * 2840 * Users need to be aware of some important API issues that are the result of 2841 * the history of SBML and libSBML. Prior to SBML Level 3 2842 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 2843 * of SBML objects. To simplify the work of programmers, libSBML's API 2844 * provided get, set, check, and unset on the SBase object class itself 2845 * instead of on individual subobject classes. This made the 2846 * get/set/etc. methods uniformly available on all objects in the libSBML 2847 * API. LibSBML simply returned empty strings or otherwise did not act when 2848 * the methods were applied to SBML objects that were not defined by the SBML 2849 * specification to have 'id' or 'name' attributes. Additional complications 2850 * arose with the rule and assignment objects: InitialAssignment, 2851 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 2852 * the rule object hierarchy was different, and in addition, then as now, 2853 * they possess different attributes: 'variable' (for the rules and event 2854 * assignments), 'symbol' (for initial assignments), or neither (for 2855 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 2856 * would always return an empty string, and isSetId() would always return @c 2857 * false for objects of these classes. 2858 * 2859 * With the addition of 'id' and 'name' attributes on SBase in Level 3 2860 * Version 2, it became necessary to introduce a new way to interact 2861 * with the attributes more consistently in libSBML to avoid breaking 2862 * backward compatibility in the behavior of the original 'id' methods. For 2863 * this reason, libSBML provides four functions (getIdAttribute(), 2864 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 2865 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 2866 * from SBase, regardless of the object's type. <strong>These new methods 2867 * should be used instead of the older getId()/setId()/etc. methods</strong> 2868 * unless the old behavior is somehow necessary. Regardless of the Level and 2869 * Version of the SBML, these functions allow client applications to use more 2870 * generalized code in some situations (for instance, when manipulating 2871 * objects that are all known to have identifiers). If the object in 2872 * question does not posess an 'id' attribute according to the SBML 2873 * specification for the Level and Version in use, libSBML will not allow the 2874 * identifier to be set, nor will it read or write 'id' attributes for those 2875 * objects. 2876 * 2877 * 2878 * 2879 * 2880 * @return integer value indicating success/failure of the 2881 * function. @if clike The value is drawn from the 2882 * enumeration #OperationReturnValues_t. @endif The possible values 2883 * returned by this function are: 2884 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2885 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2886 * 2887 * @see getIdAttribute() 2888 * @see setIdAttribute(string sid) 2889 * @see isSetIdAttribute() 2890 * @see unsetIdAttribute() 2891 * 2892 * 2893 */ public new unsetId()2894 int unsetId() { 2895 int ret = libsbmlPINVOKE.SBase_unsetId(swigCPtr); 2896 return ret; 2897 } 2898 2899 2900 /** 2901 * Unsets the value of the 'id' attribute of this SBML object. 2902 * 2903 * Most (but not all) objects in SBML include two common attributes: 'id' 2904 * and 'name'. The identifier given by an object's 'id' attribute value 2905 * is used to identify the object within the SBML model definition. 2906 * Other objects can refer to the component using this identifier. 2907 * 2908 * 2909 * @return integer value indicating success/failure of the 2910 * function. @if clike The value is drawn from the 2911 * enumeration #OperationReturnValues_t. @endif The possible values 2912 * returned by this function are: 2913 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2914 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2915 * 2916 * @see getIdAttribute() 2917 * @see setIdAttribute(string sid) 2918 * @see isSetIdAttribute() 2919 */ public unsetIdAttribute()2920 int unsetIdAttribute() { 2921 int ret = libsbmlPINVOKE.SBase_unsetIdAttribute(swigCPtr); 2922 return ret; 2923 } 2924 2925 2926 /** 2927 * Unsets the value of the 'name' attribute of this SBML object. 2928 * 2929 * 2930 * 2931 * 2932 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 2933 * moved to SBase directly, instead of being defined individually for many 2934 * (but not all) objects. LibSBML has for a long time provided functions 2935 * defined on SBase itself to get, set, and unset those attributes, which 2936 * would fail or otherwise return empty strings if executed on any object 2937 * for which those attributes were not defined. Now that all SBase objects 2938 * define those attributes, those functions now succeed for any object with 2939 * the appropriate level and version. 2940 * 2941 * The 'name' attribute is 2942 * optional and is not intended to be used for cross-referencing purposes 2943 * within a model. Its purpose instead is to provide a human-readable 2944 * label for the component. The data type of 'name' is the type 2945 * <code>string</code> defined in XML Schema. SBML imposes no 2946 * restrictions as to the content of 'name' attributes beyond those 2947 * restrictions defined by the <code>string</code> type in XML Schema. 2948 * 2949 * The recommended practice for handling 'name' is as follows. If a 2950 * software tool has the capability for displaying the content of 'name' 2951 * attributes, it should display this content to the user as a 2952 * component's label instead of the component's 'id'. If the user 2953 * interface does not have this capability (e.g., because it cannot 2954 * display or use special characters in symbol names), or if the 'name' 2955 * attribute is missing on a given component, then the user interface 2956 * should display the value of the 'id' attribute instead. (Script 2957 * language interpreters are especially likely to display 'id' instead of 2958 * 'name'.) 2959 * 2960 * As a consequence of the above, authors of systems that automatically 2961 * generate the values of 'id' attributes should be aware some systems 2962 * may display the 'id''s to the user. Authors therefore may wish to 2963 * take some care to have their software create 'id' values that are: (a) 2964 * reasonably easy for humans to type and read; and (b) likely to be 2965 * meaningful, for example by making the 'id' attribute be an abbreviated 2966 * form of the name attribute value. 2967 * 2968 * An additional point worth mentioning is although there are 2969 * restrictions on the uniqueness of 'id' values, there are no 2970 * restrictions on the uniqueness of 'name' values in a model. This 2971 * allows software applications leeway in assigning component identifiers. 2972 * 2973 * Regardless of the level and version of the SBML, these functions allow 2974 * client applications to use more generalized code in some situations 2975 * (for instance, when manipulating objects that are all known to have 2976 * names). If the object in question does not posess a 'name' attribute 2977 * according to the SBML specification for the Level and Version in use, 2978 * libSBML will not allow the name to be set, nor will it read or 2979 * write 'name' attributes for those objects. 2980 * 2981 * 2982 * 2983 * 2984 * @return integer value indicating success/failure of the 2985 * function. @if clike The value is drawn from the 2986 * enumeration #OperationReturnValues_t. @endif The possible values 2987 * returned by this function are: 2988 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2989 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2990 * 2991 * @see getName() 2992 * @see setName(string sid) 2993 * @see isSetName() 2994 * 2995 * 2996 */ public new unsetName()2997 int unsetName() { 2998 int ret = libsbmlPINVOKE.SBase_unsetName(swigCPtr); 2999 return ret; 3000 } 3001 3002 3003 /** 3004 * Unsets the value of the 'notes' subelement of this SBML object. 3005 * 3006 * The optional SBML element named 'notes', present on every major SBML 3007 * component type, is intended as a place for storing optional 3008 * information intended to be seen by humans. An example use of the 3009 * 'notes' element would be to contain formatted user comments about the 3010 * model element in which the 'notes' element is enclosed. Every object 3011 * derived directly or indirectly from type SBase can have a separate 3012 * value for 'notes', allowing users considerable freedom when adding 3013 * comments to their models. 3014 * 3015 * The format of 'notes' elements must be <a target='_blank' 3016 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 3017 * verify the formatting of 'notes' content, libSBML provides the static 3018 * utility method SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif); however, 3019 * readers are urged to consult the appropriate <a target='_blank' 3020 * href='http://sbml.org/Documents/Specifications'>SBML specification 3021 * document</a> for the Level and Version of their model for more 3022 * in-depth explanations. The SBML Level 2 and 3 3023 * specifications have considerable detail about how 'notes' element 3024 * content must be structured. 3025 * 3026 * 3027 * @return integer value indicating success/failure of the 3028 * function. @if clike The value is drawn from the 3029 * enumeration #OperationReturnValues_t. @endif This particular 3030 * function only does one thing irrespective of user input or 3031 * object state, and thus will only return a single value: 3032 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 3033 * 3034 * @see getNotesString() 3035 * @see isSetNotes() 3036 * @see setNotes(XMLNode notes) 3037 * @see setNotes(string notes, bool addXHTMLMarkup) 3038 * @see appendNotes(XMLNode notes) 3039 * @see appendNotes(string notes) 3040 * @see SyntaxChecker::hasExpectedXHTMLSyntax(@if java XMLNode@endif) 3041 */ public unsetNotes()3042 int unsetNotes() { 3043 int ret = libsbmlPINVOKE.SBase_unsetNotes(swigCPtr); 3044 return ret; 3045 } 3046 3047 3048 /** 3049 * Unsets the value of the 'annotation' subelement of this SBML object. 3050 * 3051 * Whereas the SBase 'notes' subelement is a container for content to be 3052 * shown directly to humans, the 'annotation' element is a container for 3053 * optional software-generated content @em not meant to be shown to 3054 * humans. Every object derived from SBase can have its own value for 3055 * 'annotation'. The element's content type is <a target='_blank' 3056 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 3057 * 'any'</a>, allowing essentially arbitrary well-formed XML data 3058 * content. 3059 * 3060 * SBML places a few restrictions on the organization of the content of 3061 * annotations; these are intended to help software tools read and write 3062 * the data as well as help reduce conflicts between annotations added by 3063 * different tools. Please see the SBML specifications for more details. 3064 * 3065 * 3066 * @return integer value indicating success/failure of the 3067 * function. @if clike The value is drawn from the 3068 * enumeration #OperationReturnValues_t. @endif This particular 3069 * function only does one thing irrespective of user input or 3070 * object state, and thus will only return a single value: 3071 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 3072 * 3073 * @see getAnnotation() 3074 * @see getAnnotationString() 3075 * @see isSetAnnotation() 3076 * @see setAnnotation(XMLNode annotation) 3077 * @see setAnnotation(string annotation) 3078 * @see appendAnnotation(XMLNode annotation) 3079 * @see appendAnnotation(string annotation) 3080 */ public unsetAnnotation()3081 int unsetAnnotation() { 3082 int ret = libsbmlPINVOKE.SBase_unsetAnnotation(swigCPtr); 3083 return ret; 3084 } 3085 3086 3087 /** 3088 * Unsets the value of the 'sboTerm' attribute of this SBML object. 3089 * 3090 * 3091 * @return integer value indicating success/failure of the 3092 * function. @if clike The value is drawn from the 3093 * enumeration #OperationReturnValues_t. @endif The possible values 3094 * returned by this function are: 3095 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 3096 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 3097 */ public unsetSBOTerm()3098 int unsetSBOTerm() { 3099 int ret = libsbmlPINVOKE.SBase_unsetSBOTerm(swigCPtr); 3100 return ret; 3101 } 3102 3103 3104 /** 3105 * Adds a copy of the given CVTerm object to this SBML object. 3106 * 3107 * @param term the CVTerm to assign. 3108 * 3109 * @param newBag if @c true, creates a new RDF bag with the same identifier 3110 * as a previous bag, and if @c false, adds the term to an existing 3111 * RDF bag with the same type of qualifier as the term being added. 3112 * 3113 * 3114 * @return integer value indicating success/failure of the 3115 * function. @if clike The value is drawn from the 3116 * enumeration #OperationReturnValues_t. @endif The possible values 3117 * returned by this function are: 3118 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 3119 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 3120 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink, if 3121 * this object lacks a 'metaid' attribute 3122 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 3123 * 3124 * @note Since the CV Term uses the 'metaid' attribute of the object as a 3125 * reference, if the object has no 'metaid' attribute value set, then the 3126 * CVTerm will not be added. 3127 * 3128 * 3129 * @note This method should be used with some caution. The fact that this 3130 * method @em copies the object passed to it means that the caller will be 3131 * left holding a physically different object instance than the one contained 3132 * inside this object. Changes made to the original object instance (such as 3133 * resetting attribute values) will <em>not affect the instance in this 3134 * object</em>. In addition, the caller should make sure to free the 3135 * original object if it is no longer being used, or else a memory leak will 3136 * result. Please see other methods on this class (particularly a 3137 * corresponding method whose name begins with the word <code>create</code>) 3138 * for alternatives that do not lead to these issues. 3139 * 3140 * 3141 * 3142 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 3143 */ public addCVTerm(CVTerm term, bool newBag)3144 int addCVTerm(CVTerm term, bool newBag) { 3145 int ret = libsbmlPINVOKE.SBase_addCVTerm__SWIG_0(swigCPtr, CVTerm.getCPtr(term), newBag); 3146 return ret; 3147 } 3148 3149 3150 /** 3151 * Adds a copy of the given CVTerm object to this SBML object. 3152 * 3153 * @param term the CVTerm to assign. 3154 * 3155 * @param newBag if @c true, creates a new RDF bag with the same identifier 3156 * as a previous bag, and if @c false, adds the term to an existing 3157 * RDF bag with the same type of qualifier as the term being added. 3158 * 3159 * 3160 * @return integer value indicating success/failure of the 3161 * function. @if clike The value is drawn from the 3162 * enumeration #OperationReturnValues_t. @endif The possible values 3163 * returned by this function are: 3164 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 3165 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 3166 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink, if 3167 * this object lacks a 'metaid' attribute 3168 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 3169 * 3170 * @note Since the CV Term uses the 'metaid' attribute of the object as a 3171 * reference, if the object has no 'metaid' attribute value set, then the 3172 * CVTerm will not be added. 3173 * 3174 * 3175 * @note This method should be used with some caution. The fact that this 3176 * method @em copies the object passed to it means that the caller will be 3177 * left holding a physically different object instance than the one contained 3178 * inside this object. Changes made to the original object instance (such as 3179 * resetting attribute values) will <em>not affect the instance in this 3180 * object</em>. In addition, the caller should make sure to free the 3181 * original object if it is no longer being used, or else a memory leak will 3182 * result. Please see other methods on this class (particularly a 3183 * corresponding method whose name begins with the word <code>create</code>) 3184 * for alternatives that do not lead to these issues. 3185 * 3186 * 3187 * 3188 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 3189 */ public addCVTerm(CVTerm term)3190 int addCVTerm(CVTerm term) { 3191 int ret = libsbmlPINVOKE.SBase_addCVTerm__SWIG_1(swigCPtr, CVTerm.getCPtr(term)); 3192 return ret; 3193 } 3194 3195 3196 /** 3197 * Returns a list of CVTerm objects in the annotations of this SBML 3198 * object. 3199 * 3200 * @return the list of CVTerms for this SBML object. 3201 */ public getCVTerms()3202 CVTermList getCVTerms() { 3203 IntPtr cPtr = libsbmlPINVOKE.SBase_getCVTerms__SWIG_0(swigCPtr); 3204 return (cPtr == IntPtr.Zero) ? null : new CVTermList(cPtr, true); 3205 } 3206 3207 3208 /** 3209 * Returns the number of CVTerm objects in the annotations of this SBML 3210 * object. 3211 * 3212 * @return the number of CVTerms for this SBML object. 3213 */ public getNumCVTerms()3214 long getNumCVTerms() { return (long)libsbmlPINVOKE.SBase_getNumCVTerms(swigCPtr); } 3215 3216 3217 /** 3218 * Returns the nth CVTerm in the list of CVTerms of this SBML 3219 * object. 3220 * 3221 * @param n unsigned int the index of the CVTerm to retrieve. 3222 * 3223 * @return the nth CVTerm in the list of CVTerms for this SBML object. 3224 * If the index @p n is invalid, @c null is returned. 3225 */ public getCVTerm(long n)3226 CVTerm getCVTerm(long n) { 3227 global::System.IntPtr cPtr = libsbmlPINVOKE.SBase_getCVTerm(swigCPtr, n); 3228 CVTerm ret = (cPtr == global::System.IntPtr.Zero) ? null : new CVTerm(cPtr, false); 3229 return ret; 3230 } 3231 3232 3233 /** 3234 * Clears the list of CVTerm objects attached to this SBML object. 3235 * 3236 * 3237 * @return integer value indicating success/failure of the 3238 * function. @if clike The value is drawn from the 3239 * enumeration #OperationReturnValues_t. @endif The possible values 3240 * returned by this function are: 3241 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 3242 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 3243 */ public unsetCVTerms()3244 int unsetCVTerms() { 3245 int ret = libsbmlPINVOKE.SBase_unsetCVTerms(swigCPtr); 3246 return ret; 3247 } 3248 3249 3250 /** 3251 * Unsets the ModelHistory object attached to this object. 3252 * 3253 * 3254 * @return integer value indicating success/failure of the 3255 * function. @if clike The value is drawn from the 3256 * enumeration #OperationReturnValues_t. @endif The possible values 3257 * returned by this function are: 3258 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 3259 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 3260 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 3261 * 3262 * @note In SBML Level 2, model history annotations were only 3263 * permitted on the Model element. In SBML Level 3, they are 3264 * permitted on all SBML components derived from SBase. 3265 */ public unsetModelHistory()3266 int unsetModelHistory() { 3267 int ret = libsbmlPINVOKE.SBase_unsetModelHistory(swigCPtr); 3268 return ret; 3269 } 3270 3271 3272 /** 3273 * Returns the MIRIAM <em>biological qualifier</em> associated with the 3274 * given resource. 3275 * 3276 * In <a target='_blank' href='http://biomodels.net/miriam'>MIRIAM</a>, 3277 * qualifiers are an optional means of indicating the relationship 3278 * between a model component and its annotations. There are two broad 3279 * kinds of annotations: <em>model</em> and <em>biological</em>. The 3280 * latter kind is used to qualify the relationship between a model 3281 * component and a biological entity which it represents. Examples of 3282 * relationships include 'is' and 'has part', but many others are 3283 * possible. MIRIAM defines <a target='_blank' 3284 * href='http://www.ebi.ac.uk/miriam/main/qualifiers/'>numerous 3285 * relationship qualifiers</a> to enable different software tools to 3286 * qualify biological annotations in the same standardized way. In 3287 * libSBML, the MIRIAM controlled-vocabulary annotations on an SBML model 3288 * element are represented using lists of CVTerm objects, and the 3289 * the MIRIAM biological qualifiers are represented using 3290 * values @if clike from the enumeration 3291 * type #BiolQualifierType_t.@endif@if python whose 3292 * names begin with <code>BQB_</code> in the interface class 3293 * @link libsbml libsbml@endlink.@endif@if java whose 3294 * names begin with <code>BQB_</code> in the interface class 3295 * {@link libsbmlConstants}.@endif@if csharp whose 3296 * names begin with <code>BQB_</code> in the interface class 3297 * @link libsbmlcs.libsbml libsbml@endlink.@endif 3298 * 3299 * This method searches the controlled-vocabulary annotations 3300 * (i.e., the list of CVTerm objects) on the present object, then out of 3301 * those that have biological qualifiers, looks for an annotation to the 3302 * given @p resource. If such an annotation is found, it returns the 3303 * type of biological qualifier associated with that resource as a 3304 * value @if clike from the enumeration type 3305 * #BiolQualifierType_t.@endif@if python whose name begins with 3306 * <code>BQB_</code> from the interface 3307 * class @link libsbml libsbml@endlink.@endif@if java whose name 3308 * begins with <code>BQB_</code> from the interface 3309 * class {@link libsbmlConstants}.@endif@if csharp whose 3310 * names begin with <code>BQB_</code> in the interface class 3311 * @link libsbmlcs.libsbml libsbml@endlink.@endif 3312 * 3313 * @param resource string representing the resource; e.g., 3314 * <code>'http://www.geneontology.org/#GO:0005892'</code>. 3315 * 3316 * @return the qualifier associated with the resource, 3317 * or @link libsbml#BQB_UNKNOWN BQB_UNKNOWN@endlink if the 3318 * resource does not exist. 3319 * 3320 * @if clike 3321 * @note The set of MIRIAM biological qualifiers grows over 3322 * time, although relatively slowly. The values in the enumeration 3323 * #BiolQualifierType_t are up to date with MIRIAM at the time of a given 3324 * libSBML release. The set of values may be expanded in later libSBML 3325 * releases, to match the values defined by MIRIAM at that later time. 3326 * @endif@if python 3327 * @note The set of MIRIAM biological qualifiers grows over 3328 * time, although relatively slowly. The values are up to date with 3329 * MIRIAM at the time of a given libSBML release. The set of values in 3330 * list of <code>BQB_</code> constants defined in @link libsbml 3331 * libsbml@endlink may be expanded in later libSBML releases, to match 3332 * the values defined by MIRIAM at that later time. 3333 * @endif@if java 3334 * @note The set of MIRIAM biological qualifiers grows over 3335 * time, although relatively slowly. The values are up to date with 3336 * MIRIAM at the time of a given libSBML release. The set of values in 3337 * list of <code>BQB_</code> constants defined in {@link libsbmlConstants} 3338 * may be expanded in later libSBML releases, to match 3339 * the values defined by MIRIAM at that later time. 3340 * @endif@if csharp 3341 * @note The set of MIRIAM biological qualifiers grows over 3342 * time, although relatively slowly. The values are up to date with 3343 * MIRIAM at the time of a given libSBML release. The set of values in 3344 * list of <code>BQB_</code> constants defined in @link libsbmlcs.libsbml libsbml@endlink 3345 * may be expanded in later libSBML releases, to match 3346 * the values defined by MIRIAM at that later time. 3347 * @endif 3348 */ public getResourceBiologicalQualifier(string resource)3349 int getResourceBiologicalQualifier(string resource) { 3350 int ret = libsbmlPINVOKE.SBase_getResourceBiologicalQualifier(swigCPtr, resource); 3351 return ret; 3352 } 3353 3354 3355 /** 3356 * Returns the MIRIAM <em>model qualifier</em> associated with the 3357 * given resource. 3358 * 3359 * In <a target='_blank' href='http://biomodels.net/miriam'>MIRIAM</a>, 3360 * qualifiers are an optional means of indicating the relationship 3361 * between a model component and its annotations. There are two broad 3362 * kinds of annotations: <em>model</em> and <em>biological</em>. The 3363 * former kind is used to qualify the relationship between a model 3364 * component and another modeling object. An example qualifier is 3365 * 'isDerivedFrom', to indicate that a given component of the model is 3366 * derived from the modeling object represented by the referenced 3367 * resource. MIRIAM defines <a target='_blank' 3368 * href='http://www.ebi.ac.uk/miriam/main/qualifiers/'>numerous 3369 * relationship qualifiers</a> to enable different software tools to 3370 * qualify model annotations in the same standardized way. In libSBML, 3371 * the MIRIAM controlled-vocabulary annotations on an SBML model element 3372 * are represented using lists of CVTerm objects, and the 3373 * the MIRIAM model qualifiers are represented using 3374 * values @if clike from the enumeration 3375 * type #ModelQualifierType_t.@endif@if python whose 3376 * names begin with <code>BQM_</code> in the interface class 3377 * @link libsbml libsbml@endlink.@endif@if java whose 3378 * names begin with <code>BQM_</code> in the interface class 3379 * {@link libsbmlConstants}.@endif@if csharp whose 3380 * names begin with <code>BQB_</code> in the interface class 3381 * @link libsbmlcs.libsbml libsbml@endlink.@endif 3382 * 3383 * This method method searches the controlled-vocabulary annotations 3384 * (i.e., the list of CVTerm objects) on the present object, then out of 3385 * those that have model qualifiers, looks for an annotation to the given 3386 * @p resource. If such an annotation is found, it returns the type of 3387 * type of model qualifier associated with that resource as a 3388 * value @if clike from the enumeration type 3389 * #ModelQualifierType_t.@endif@if python whose name begins with 3390 * <code>BQM_</code> from the interface 3391 * class @link libsbml libsbml@endlink.@endif@if java whose name 3392 * begins with <code>BQM_</code> from the interface 3393 * class {@link libsbmlConstants}.@endif@if csharp whose 3394 * names begin with <code>BQB_</code> in the interface class 3395 * @link libsbmlcs.libsbml libsbml@endlink.@endif 3396 * 3397 * @param resource string representing the resource; e.g., 3398 * <code>'http://www.geneontology.org/#GO:0005892'</code>. 3399 * 3400 * @return the @if clike #ModelQualifierType_t value@else model qualifier 3401 * type@endif associated with the resource, or @link libsbml#BQM_UNKNOWN BQM_UNKNOWN@endlink if the resource does not exist. 3402 * 3403 * @if clike 3404 * @note The set of MIRIAM biological qualifiers grows over 3405 * time, although relatively slowly. The values in the enumeration 3406 * #ModelQualifierType_t are up to date with MIRIAM at the time of a given 3407 * libSBML release. The set of values may be expanded in later libSBML 3408 * releases, to match the values defined by MIRIAM at that later time. 3409 * @endif@if python 3410 * @note The set of MIRIAM model qualifiers grows over 3411 * time, although relatively slowly. The values are up to date with 3412 * MIRIAM at the time of a given libSBML release. The set of values in 3413 * list of <code>BQM_</code> constants defined in @link libsbml 3414 * libsbml@endlink may be expanded in later libSBML releases, to match 3415 * the values defined by MIRIAM at that later time. 3416 * @endif@if java 3417 * @note The set of MIRIAM model qualifiers grows over 3418 * time, although relatively slowly. The values are up to date with 3419 * MIRIAM at the time of a given libSBML release. The set of values in 3420 * list of <code>BQM_</code> constants defined in {@link libsbmlConstants} 3421 * may be expanded in later libSBML releases, to match 3422 * the values defined by MIRIAM at that later time. 3423 * @endif@if csharp 3424 * @note The set of MIRIAM model qualifiers grows over 3425 * time, although relatively slowly. The values are up to date with 3426 * MIRIAM at the time of a given libSBML release. The set of values in 3427 * list of <code>BQM_</code> constants defined in @link libsbmlcs.libsbml libsbml@endlink 3428 * may be expanded in later libSBML releases, to match 3429 * the values defined by MIRIAM at that later time. 3430 * @endif 3431 */ public getResourceModelQualifier(string resource)3432 int getResourceModelQualifier(string resource) { 3433 int ret = libsbmlPINVOKE.SBase_getResourceModelQualifier(swigCPtr, resource); 3434 return ret; 3435 } 3436 3437 3438 /** 3439 * Returns the Model object for the SBML Document in which the current object is located. 3440 * 3441 * @return the Model object for the SBML Document of this SBML object. 3442 * 3443 * @see getParentSBMLObject() 3444 * @see getSBMLDocument() 3445 */ public getModel()3446 Model getModel() { 3447 global::System.IntPtr cPtr = libsbmlPINVOKE.SBase_getModel(swigCPtr); 3448 Model ret = (cPtr == global::System.IntPtr.Zero) ? null : new Model(cPtr, false); 3449 return ret; 3450 } 3451 3452 3453 /** 3454 * Returns the SBML Level of the SBMLDocument object containing @em this 3455 * object. 3456 * 3457 * 3458 * 3459 * LibSBML uses the class SBMLDocument as a top-level container for 3460 * storing SBML content and data associated with it (such as warnings and 3461 * error messages). An SBML model in libSBML is contained inside an 3462 * SBMLDocument object. SBMLDocument corresponds roughly to the class 3463 * <i>SBML</i> defined in the SBML Level 3 and Level 2 3464 * specifications, but it does not have a direct correspondence in SBML 3465 * Level 1. (But, it is created by libSBML no matter whether the 3466 * model is Level 1, Level 2 or Level 3.) 3467 * 3468 * 3469 * 3470 * @return the SBML level of this SBML object. 3471 * 3472 * @see getVersion() 3473 * @see getNamespaces() 3474 * @see getPackageVersion() 3475 */ public getLevel()3476 long getLevel() { return (long)libsbmlPINVOKE.SBase_getLevel(swigCPtr); } 3477 3478 3479 /** 3480 * Returns the Version within the SBML Level of the SBMLDocument object 3481 * containing @em this object. 3482 * 3483 * 3484 * 3485 * LibSBML uses the class SBMLDocument as a top-level container for 3486 * storing SBML content and data associated with it (such as warnings and 3487 * error messages). An SBML model in libSBML is contained inside an 3488 * SBMLDocument object. SBMLDocument corresponds roughly to the class 3489 * <i>SBML</i> defined in the SBML Level 3 and Level 2 3490 * specifications, but it does not have a direct correspondence in SBML 3491 * Level 1. (But, it is created by libSBML no matter whether the 3492 * model is Level 1, Level 2 or Level 3.) 3493 * 3494 * 3495 * 3496 * @return the SBML version of this SBML object. 3497 * 3498 * @see getLevel() 3499 * @see getNamespaces() 3500 */ public getVersion()3501 long getVersion() { return (long)libsbmlPINVOKE.SBase_getVersion(swigCPtr); } 3502 3503 3504 /** 3505 * Returns the SBML Core Version within the SBML Level of the actual object. 3506 * 3507 * 3508 * 3509 * LibSBML uses the class SBMLDocument as a top-level container for 3510 * storing SBML content and data associated with it (such as warnings and 3511 * error messages). An SBML model in libSBML is contained inside an 3512 * SBMLDocument object. SBMLDocument corresponds roughly to the class 3513 * <i>SBML</i> defined in the SBML Level 3 and Level 2 3514 * specifications, but it does not have a direct correspondence in SBML 3515 * Level 1. (But, it is created by libSBML no matter whether the 3516 * model is Level 1, Level 2 or Level 3.) 3517 * 3518 * 3519 * 3520 * @return the SBML core version of this SBML object. 3521 */ public getPackageCoreVersion()3522 long getPackageCoreVersion() { return (long)libsbmlPINVOKE.SBase_getPackageCoreVersion(swigCPtr); } 3523 3524 3525 /** 3526 * Returns the Version of the SBML Level 3 package to which this 3527 * element belongs to. 3528 * 3529 * @return the version of the SBML Level 3 package to which this 3530 * element belongs. The value @c 0 will be returned if this element 3531 * belongs to the SBML Level 3 Core package. 3532 * 3533 * @see getLevel() 3534 * @see getVersion() 3535 */ public getPackageVersion()3536 long getPackageVersion() { return (long)libsbmlPINVOKE.SBase_getPackageVersion(swigCPtr); } 3537 3538 3539 /** 3540 * Returns the name of the SBML Level 3 package in which this element 3541 * is defined. 3542 * 3543 * @return the name of the SBML package in which this element is defined. 3544 * The string <code>"core"</code> will be returned if this 3545 * element is defined in SBML Level 3 Core. The string 3546 * <code>"unknown"</code> will be returned if this element is 3547 * not defined in any SBML package. 3548 */ public getPackageName()3549 string getPackageName() { 3550 string ret = libsbmlPINVOKE.SBase_getPackageName(swigCPtr); 3551 return ret; 3552 } 3553 3554 3555 /** 3556 * Returns the libSBML type code for this object. 3557 * 3558 * 3559 * 3560 * LibSBML attaches an identifying code to every kind of SBML object. These 3561 * are integer constants known as <em>SBML type codes</em>. The names of all 3562 * the codes begin with the characters <code>SBML_</code>. 3563 * @if clike The set of possible type codes for core elements is defined in 3564 * the enumeration #SBMLTypeCode_t, and in addition, libSBML plug-ins for 3565 * SBML Level 3 packages define their own extra enumerations of type 3566 * codes (e.g., #SBMLLayoutTypeCode_t for the Level 3 Layout 3567 * package).@endif@if java In the Java language interface for libSBML, the 3568 * type codes are defined as static integer constants in the interface class 3569 * {@link libsbmlConstants}. @endif@if python In the Python language 3570 * interface for libSBML, the type codes are defined as static integer 3571 * constants in the interface class @link libsbml@endlink.@endif@if csharp In 3572 * the C# language interface for libSBML, the type codes are defined as 3573 * static integer constants in the interface class 3574 * @link libsbmlcs.libsbml@endlink.@endif Note that different Level 3 3575 * package plug-ins may use overlapping type codes; to identify the package 3576 * to which a given object belongs, call the 3577 * <code>@if conly SBase_getPackageName() 3578 * @else SBase::getPackageName() 3579 * @endif</code> 3580 * method on the object. 3581 * 3582 * The exception to this is lists: all SBML-style list elements have the type 3583 * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink, regardless of what package they 3584 * are from. 3585 * 3586 * 3587 * 3588 * 3589 * 3590 * Here follow some additional general information about libSBML type codes: 3591 * 3592 * @li The codes are the possible return values (integers) for the following 3593 * functions: 3594 * <ul> 3595 * <li> SBase::getTypeCode() 3596 * <li> ListOf::getItemTypeCode() 3597 * </ul> 3598 * (Compatibility note: in libSBML 5, the type of return values of these 3599 * functions changed from an enumeration to an integer for extensibility 3600 * in the face of different programming languages.) 3601 * 3602 * @li Each package extension must define similar sets of values for each 3603 * SBase subclass (e.g. <code>SBMLLayoutTypeCode_t</code> for the SBML Level 3 3604 * %Layout extension, <code>SBMLFbcTypeCode_t</code> for the SBML Level 3 Flux 3605 * Balance Constraints extension, etc.). 3606 * 3607 * @li The value of each package-specific type code can be duplicated between 3608 * those of different packages. (This is necessary because the development 3609 * of libSBML extensions for different SBML packages may be undertaken by 3610 * different developers at different times; requiring the developers to 3611 * coordinate their use of type codes would be nettlesome and probably 3612 * doomed to failure.) 3613 * 3614 * @li To distinguish between the type codes of different packages, both the 3615 * return value of SBase::getTypeCode() and SBase::getPackageName() must be 3616 * checked. This is particularly important for functions that take an SBML 3617 * type code as an argument, such as 3618 * SBase::getAncestorOfType(@if java int, String@endif), which by 3619 * default assumes you are handing it a core type, and will return @c null if 3620 * the value you give it is actually from a package. 3621 * 3622 * The following example code illustrates the combined use of 3623 * SBase::getPackageName() and SBase::getTypeCode(): 3624 * @if cpp 3625 * @code{.cpp} 3626 void example (SBase sb) 3627 { 3628 cons string pkgName = sb->getPackageName(); 3629 if (pkgName == 'core') 3630 { 3631 switch (sb->getTypeCode()) 3632 { 3633 case SBML_MODEL: 3634 .... 3635 break; 3636 case SBML_REACTION: 3637 .... 3638 } 3639 } 3640 else if (pkgName == 'layout') 3641 { 3642 switch (sb->getTypeCode()) 3643 { 3644 case SBML_LAYOUT_LAYOUT: 3645 .... 3646 break; 3647 case SBML_LAYOUT_REACTIONGLYPH: 3648 .... 3649 } 3650 } 3651 ... 3652 } 3653 @endcode 3654 @endif 3655 @if python 3656 @code{.py} 3657 def example(item): 3658 pkg_name = item.getPackageName() 3659 type_code = item.getTypeCode() 3660 if pkg_name == 'core': 3661 print('Got a ' + SBMLTypeCode_toString(type_code, 'core') + ' object') 3662 if type_code == SBML_MODEL: 3663 print('This is a very, very nice model') 3664 # Do whatever the application wants to do with the model. 3665 elif type_code == SBML_COMPARTMENT: 3666 print('This is a very, very nice compartment') 3667 # Do whatever the application wants to do with the compartment. 3668 elif type_code == SBML_SPECIES: 3669 print('This is a very, very nice species') 3670 # Do whatever the application wants to do with the species. 3671 elif ... 3672 ... 3673 elif pkg_name == 'layout': 3674 print('Got a ' + SBMLTypeCode_toString(type_code, 'layout') + ' object') 3675 if type_code == SBML_LAYOUT_POINT: 3676 print('This is a very, very nice layout point') 3677 # Do whatever the application wants to do with the layout point. 3678 elif type_code == SBML_LAYOUT_BOUNDINGBOX: 3679 print('This is a very, very nice layout bounding box') 3680 # Do whatever the application wants to do with the layout bounding box. 3681 elif ... 3682 ... 3683 elif pkg_name == 'unknown': 3684 print('Something went wrong -- libSBML did not recognize the object type') 3685 # Handle errors 3686 @endcode 3687 @endif 3688 @if java 3689 @code{.java} 3690 void example (SBase sb) 3691 { 3692 String pkgName = sb.getPackageName(); 3693 if (pkgName.equals('core')) 3694 { 3695 switch (sb.getTypeCode()) 3696 { 3697 case libsbml.SBML_MODEL: 3698 .... 3699 break; 3700 case libsbml.SBML_REACTION: 3701 .... 3702 } 3703 } 3704 else if (pkgName.equals('layout')) 3705 { 3706 switch (sb.getTypeCode()) 3707 { 3708 case libsbml.SBML_LAYOUT_LAYOUT: 3709 .... 3710 break; 3711 case libsbml.SBML_LAYOUT_REACTIONGLYPH: 3712 .... 3713 } 3714 } 3715 ... 3716 } 3717 @endcode 3718 @endif 3719 * 3720 * 3721 * 3722 * @return the @if clike #SBMLTypeCode_t value@else SBML object type 3723 * code@endif of this SBML object, or @link libsbml#SBML_UNKNOWN SBML_UNKNOWN@endlink (the default). The latter is possible because 3724 * subclasses of SBase are not required to implement this method to return 3725 * a type code. 3726 * 3727 * 3728 * @warning <span class='warning'>The specific integer values of the possible 3729 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 3730 * packages, To fully identify the correct code, <strong>it is necessary to 3731 * invoke both getPackageName() and getTypeCode()</strong> (or 3732 * ListOf::getItemTypeCode()).</span> 3733 * 3734 * 3735 * 3736 * @see getPackageName() 3737 * @see getElementName() 3738 */ public new getTypeCode()3739 int getTypeCode() { 3740 int ret = libsbmlPINVOKE.SBase_getTypeCode(swigCPtr); 3741 return ret; 3742 } 3743 3744 3745 /** 3746 * Predicate returning @c true if this object's level/version and namespace 3747 * values correspond to a valid SBML specification. 3748 * 3749 * The valid combinations of SBML Level, Version and Namespace as of this 3750 * release of libSBML are the following: 3751 * <ul> 3752 * <li> Level 1 Version 2: "<code style='margin-right:0; padding-right:0'>http</code><code style='margin-left:0; padding-left:0'>://www.sbml.org/sbml/level1</code>" 3753 * <li> Level 2 Version 1: "<code style='margin-right:0; padding-right:0'>http</code><code style='margin-left:0; padding-left:0'>://www.sbml.org/sbml/level2</code>" 3754 * <li> Level 2 Version 2: "<code style='margin-right:0; padding-right:0'>http</code><code style='margin-left:0; padding-left:0'>://www.sbml.org/sbml/level2/version2</code>" 3755 * <li> Level 2 Version 3: "<code style='margin-right:0; padding-right:0'>http</code><code style='margin-left:0; padding-left:0'>://www.sbml.org/sbml/level2/version3</code>" 3756 * <li> Level 2 Version 4: "<code style='margin-right:0; padding-right:0'>http</code><code style='margin-left:0; padding-left:0'>://www.sbml.org/sbml/level2/version4</code>" 3757 * <li> Level 2 Version 5: "<code style='margin-right:0; padding-right:0'>http</code><code style='margin-left:0; padding-left:0'>://www.sbml.org/sbml/level2/version5</code>" 3758 * <li> Level 3 Version 1 Core: "<code style='margin-right:0; padding-right:0'>http</code><code style='margin-left:0; padding-left:0'>://www.sbml.org/sbml/level3/version1/core</code>" 3759 * <li> Level 3 Version 2 Core: "<code style='margin-right:0; padding-right:0'>http</code><code style='margin-left:0; padding-left:0'>://www.sbml.org/sbml/level3/version2/core</code>" 3760 * </ul> 3761 * 3762 * @return @c true if the level, version and namespace values of this 3763 * SBML object correspond to a valid set of values, @c false otherwise. 3764 */ public hasValidLevelVersionNamespaceCombination()3765 bool hasValidLevelVersionNamespaceCombination() { 3766 bool ret = libsbmlPINVOKE.SBase_hasValidLevelVersionNamespaceCombination(swigCPtr); 3767 return ret; 3768 } 3769 3770 3771 /** 3772 * Returns the XML element name of this object. 3773 * 3774 * This is overridden by subclasses to return a string appropriate to the 3775 * SBML component. For example, Model defines it as returning 3776 * @c 'model', CompartmentType defines it as returning @c 'compartmentType', 3777 * and so on. 3778 */ public new getElementName()3779 string getElementName() { 3780 string ret = libsbmlPINVOKE.SBase_getElementName(swigCPtr); 3781 return ret; 3782 } 3783 3784 3785 /** 3786 * Returns a string consisting of a partial SBML corresponding to just 3787 * this object. 3788 * 3789 * @return the partial SBML that describes this SBML object. 3790 * 3791 * @warning <span class='warning'>This is primarily provided for testing 3792 * and debugging purposes. It may be removed in a future version of 3793 * libSBML.</span> 3794 */ public toSBML()3795 string toSBML() { 3796 string ret = libsbmlPINVOKE.SBase_toSBML(swigCPtr); 3797 return ret; 3798 } 3799 3800 3801 /** 3802 * Returns this element as an XMLNode. 3803 * 3804 * @return this element as an XMLNode. 3805 * 3806 * @warning <span class='warning'>This operation is computationally 3807 * expensive, because the element has to be fully serialized to a string 3808 * and then parsed into the XMLNode structure. Attempting to convert a 3809 * large tree structure (e.g., a large Model) may consume significant 3810 * computer memory and time.</span> 3811 */ public toXMLNode()3812 XMLNode toXMLNode() { 3813 global::System.IntPtr cPtr = libsbmlPINVOKE.SBase_toXMLNode(swigCPtr); 3814 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, false); 3815 return ret; 3816 } 3817 3818 3819 /** 3820 * Reads (initializes) this SBML object by reading from the given XMLNode. 3821 * 3822 * @param node the XMLNode to read from. 3823 * 3824 * @param flag an optional flag that determines how how errors are logged 3825 * during the reading process. 3826 * 3827 * @warning <span class='warning'>This method is computationally expensive, 3828 * because the given node has to be serialized to a string first. 3829 * Attempting to serialize a large tree structure (e.g., a large Model) may 3830 * consume significant computer memory and time.</span> 3831 */ public read(XMLNode node, int flag)3832 void read(XMLNode node, int flag) { 3833 libsbmlPINVOKE.SBase_read__SWIG_0(swigCPtr, XMLNode.getCPtr(node), flag); 3834 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 3835 } 3836 3837 3838 /** 3839 * Reads (initializes) this SBML object by reading from the given XMLNode. 3840 * 3841 * @param node the XMLNode to read from. 3842 * 3843 * @param flag an optional flag that determines how how errors are logged 3844 * during the reading process. 3845 * 3846 * @warning <span class='warning'>This method is computationally expensive, 3847 * because the given node has to be serialized to a string first. 3848 * Attempting to serialize a large tree structure (e.g., a large Model) may 3849 * consume significant computer memory and time.</span> 3850 */ public read(XMLNode node)3851 void read(XMLNode node) { 3852 libsbmlPINVOKE.SBase_read__SWIG_1(swigCPtr, XMLNode.getCPtr(node)); 3853 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 3854 } 3855 3856 3857 /** 3858 * Returns a plug-in object (extension interface) for an SBML Level 3 3859 * package extension with the given package name or URI. 3860 * The returned plug-in will be the appropriate type of plugin requested: 3861 * calling Model::getPlugin('fbc') will return an FbcModelPlugin; calling 3862 * Parameter::getPlugin('comp') will return CompSBasePlugin, etc. 3863 * 3864 * If no such plugin exists, null is returned. 3865 * 3866 * 3867 * 3868 * SBML Level 3 consists of a <em>Core</em> definition that can be extended 3869 * via optional SBML Level 3 <em>packages</em>. A given model may indicate 3870 * that it uses one or more SBML packages, and likewise, a software tool may be 3871 * able to support one or more packages. LibSBML does not come preconfigured 3872 * with all possible packages included and enabled, in part because not all 3873 * package specifications have been finalized. To support the ability for 3874 * software systems to enable support for the Level 3 packages they choose, 3875 * libSBML features a <em>plug-in</em> mechanism. Each SBML Level 3 3876 * package is implemented in a separate code plug-in that can be enabled by the 3877 * application to support working with that SBML package. A given SBML model 3878 * may thus contain not only objects defined by SBML Level 3 Core, but also 3879 * objects created by libSBML plug-ins supporting additional Level 3 3880 * packages. 3881 * 3882 * 3883 * 3884 * @param package the name or URI of the package. 3885 * 3886 * @return the plug-in object (the libSBML extension interface) of 3887 * a package extension with the given package name or URI. 3888 * 3889 * @see getPlugin(unsigned int n) 3890 */ public getPlugin(string package)3891 SBasePlugin getPlugin(string package) { 3892 SBasePlugin ret = (SBasePlugin) libsbml.DowncastSBasePlugin(libsbmlPINVOKE.SBase_getPlugin__SWIG_0(swigCPtr, package), false); 3893 return ret; 3894 } 3895 3896 3897 /** 3898 * Returns the nth plug-in object (extension interface) for an SBML Level 3 3899 * package extension. 3900 * The returned plug-in will be the appropriate type of plugin requested: 3901 * calling Model::getPlugin('fbc') will return an FbcModelPlugin; calling 3902 * Parameter::getPlugin('comp') will return CompSBasePlugin, etc. 3903 * 3904 * If no such plugin exists, null is returned. 3905 * 3906 * 3907 * 3908 * SBML Level 3 consists of a <em>Core</em> definition that can be extended 3909 * via optional SBML Level 3 <em>packages</em>. A given model may indicate 3910 * that it uses one or more SBML packages, and likewise, a software tool may be 3911 * able to support one or more packages. LibSBML does not come preconfigured 3912 * with all possible packages included and enabled, in part because not all 3913 * package specifications have been finalized. To support the ability for 3914 * software systems to enable support for the Level 3 packages they choose, 3915 * libSBML features a <em>plug-in</em> mechanism. Each SBML Level 3 3916 * package is implemented in a separate code plug-in that can be enabled by the 3917 * application to support working with that SBML package. A given SBML model 3918 * may thus contain not only objects defined by SBML Level 3 Core, but also 3919 * objects created by libSBML plug-ins supporting additional Level 3 3920 * packages. 3921 * 3922 * 3923 * 3924 * @param n the index of the plug-in to return. 3925 * 3926 * @return the nth plug-in object (the libSBML extension interface) of a 3927 * package extension. 3928 * If the index @p n is invalid, @c null is returned. 3929 * 3930 * @see getNumPlugins() 3931 * @see getPlugin(string package) 3932 */ public getPlugin(long n)3933 SBasePlugin getPlugin(long n) { 3934 SBasePlugin ret = (SBasePlugin) libsbml.DowncastSBasePlugin(libsbmlPINVOKE.SBase_getPlugin__SWIG_2(swigCPtr, n), false); 3935 return ret; 3936 } 3937 3938 3939 /** 3940 * Returns the nth disabled plug-in object (extension interface) for an SBML Level 3 3941 * package extension. If no such plugin exists, null is returned. 3942 * 3943 * 3944 * 3945 * SBML Level 3 consists of a <em>Core</em> definition that can be extended 3946 * via optional SBML Level 3 <em>packages</em>. A given model may indicate 3947 * that it uses one or more SBML packages, and likewise, a software tool may be 3948 * able to support one or more packages. LibSBML does not come preconfigured 3949 * with all possible packages included and enabled, in part because not all 3950 * package specifications have been finalized. To support the ability for 3951 * software systems to enable support for the Level 3 packages they choose, 3952 * libSBML features a <em>plug-in</em> mechanism. Each SBML Level 3 3953 * package is implemented in a separate code plug-in that can be enabled by the 3954 * application to support working with that SBML package. A given SBML model 3955 * may thus contain not only objects defined by SBML Level 3 Core, but also 3956 * objects created by libSBML plug-ins supporting additional Level 3 3957 * packages. 3958 * 3959 * 3960 * 3961 * 3962 * 3963 * If a plugin is <em>disabled</em>, the package information it contains is 3964 * no longer considered to be part of the SBML document for the purposes of 3965 * searching the document or writing out the document. However, the information 3966 * is still retained, so if the plugin is enabled again, the same information 3967 * will once again be available, and will be written out to the final model. 3968 * 3969 * 3970 * 3971 * @param n the index of the disabled plug-in to return. 3972 * 3973 * @return the nth disabled plug-in object (the libSBML extension interface) of a 3974 * package extension. 3975 * If the index @p n is invalid, @c null is returned. 3976 * 3977 * @see getNumDisabledPlugins() 3978 * @see getPlugin(string package) 3979 */ public getDisabledPlugin(long n)3980 SBasePlugin getDisabledPlugin(long n) { 3981 SBasePlugin ret = (SBasePlugin) libsbml.DowncastSBasePlugin(libsbmlPINVOKE.SBase_getDisabledPlugin__SWIG_0(swigCPtr, n), false); 3982 return ret; 3983 } 3984 3985 3986 /** 3987 * Returns the number of plug-in objects (extenstion interfaces) for SBML 3988 * Level 3 package extensions known. 3989 * 3990 * 3991 * 3992 * SBML Level 3 consists of a <em>Core</em> definition that can be extended 3993 * via optional SBML Level 3 <em>packages</em>. A given model may indicate 3994 * that it uses one or more SBML packages, and likewise, a software tool may be 3995 * able to support one or more packages. LibSBML does not come preconfigured 3996 * with all possible packages included and enabled, in part because not all 3997 * package specifications have been finalized. To support the ability for 3998 * software systems to enable support for the Level 3 packages they choose, 3999 * libSBML features a <em>plug-in</em> mechanism. Each SBML Level 3 4000 * package is implemented in a separate code plug-in that can be enabled by the 4001 * application to support working with that SBML package. A given SBML model 4002 * may thus contain not only objects defined by SBML Level 3 Core, but also 4003 * objects created by libSBML plug-ins supporting additional Level 3 4004 * packages. 4005 * 4006 * 4007 * 4008 * @return the number of plug-in objects (extension interfaces) of 4009 * package extensions known by this instance of libSBML. 4010 * 4011 * @see getPlugin(unsigned int n) 4012 */ public getNumPlugins()4013 long getNumPlugins() { return (long)libsbmlPINVOKE.SBase_getNumPlugins(swigCPtr); } 4014 4015 4016 /** 4017 * Returns the number of disabled plug-in objects (extension interfaces) 4018 * for SBML Level 3 package extensions known. 4019 * 4020 * 4021 * 4022 * SBML Level 3 consists of a <em>Core</em> definition that can be extended 4023 * via optional SBML Level 3 <em>packages</em>. A given model may indicate 4024 * that it uses one or more SBML packages, and likewise, a software tool may be 4025 * able to support one or more packages. LibSBML does not come preconfigured 4026 * with all possible packages included and enabled, in part because not all 4027 * package specifications have been finalized. To support the ability for 4028 * software systems to enable support for the Level 3 packages they choose, 4029 * libSBML features a <em>plug-in</em> mechanism. Each SBML Level 3 4030 * package is implemented in a separate code plug-in that can be enabled by the 4031 * application to support working with that SBML package. A given SBML model 4032 * may thus contain not only objects defined by SBML Level 3 Core, but also 4033 * objects created by libSBML plug-ins supporting additional Level 3 4034 * packages. 4035 * 4036 * 4037 * 4038 * 4039 * 4040 * If a plugin is <em>disabled</em>, the package information it contains is 4041 * no longer considered to be part of the SBML document for the purposes of 4042 * searching the document or writing out the document. However, the information 4043 * is still retained, so if the plugin is enabled again, the same information 4044 * will once again be available, and will be written out to the final model. 4045 * 4046 * 4047 * 4048 * @return the number of disabled plug-in objects (extension interfaces) 4049 * of package extensions known by this instance of libSBML. 4050 * 4051 */ public getNumDisabledPlugins()4052 long getNumDisabledPlugins() { return (long)libsbmlPINVOKE.SBase_getNumDisabledPlugins(swigCPtr); } 4053 4054 4055 /** 4056 * Deletes all information stored in disabled plugins. If the plugin is 4057 * re-enabled later, it will then not have any previously-stored information. 4058 * 4059 * 4060 * 4061 * SBML Level 3 consists of a <em>Core</em> definition that can be extended 4062 * via optional SBML Level 3 <em>packages</em>. A given model may indicate 4063 * that it uses one or more SBML packages, and likewise, a software tool may be 4064 * able to support one or more packages. LibSBML does not come preconfigured 4065 * with all possible packages included and enabled, in part because not all 4066 * package specifications have been finalized. To support the ability for 4067 * software systems to enable support for the Level 3 packages they choose, 4068 * libSBML features a <em>plug-in</em> mechanism. Each SBML Level 3 4069 * package is implemented in a separate code plug-in that can be enabled by the 4070 * application to support working with that SBML package. A given SBML model 4071 * may thus contain not only objects defined by SBML Level 3 Core, but also 4072 * objects created by libSBML plug-ins supporting additional Level 3 4073 * packages. 4074 * 4075 * 4076 * 4077 * 4078 * 4079 * If a plugin is <em>disabled</em>, the package information it contains is 4080 * no longer considered to be part of the SBML document for the purposes of 4081 * searching the document or writing out the document. However, the information 4082 * is still retained, so if the plugin is enabled again, the same information 4083 * will once again be available, and will be written out to the final model. 4084 * 4085 * 4086 * 4087 * @param recursive if @c true, the disabled information will be deleted 4088 * also from all child elements, otherwise only from this SBase element. 4089 * 4090 * @see getNumDisabledPlugins() 4091 */ public deleteDisabledPlugins(bool recursive)4092 void deleteDisabledPlugins(bool recursive) { 4093 libsbmlPINVOKE.SBase_deleteDisabledPlugins__SWIG_0(swigCPtr, recursive); 4094 } 4095 4096 4097 /** 4098 * Deletes all information stored in disabled plugins. If the plugin is 4099 * re-enabled later, it will then not have any previously-stored information. 4100 * 4101 * 4102 * 4103 * SBML Level 3 consists of a <em>Core</em> definition that can be extended 4104 * via optional SBML Level 3 <em>packages</em>. A given model may indicate 4105 * that it uses one or more SBML packages, and likewise, a software tool may be 4106 * able to support one or more packages. LibSBML does not come preconfigured 4107 * with all possible packages included and enabled, in part because not all 4108 * package specifications have been finalized. To support the ability for 4109 * software systems to enable support for the Level 3 packages they choose, 4110 * libSBML features a <em>plug-in</em> mechanism. Each SBML Level 3 4111 * package is implemented in a separate code plug-in that can be enabled by the 4112 * application to support working with that SBML package. A given SBML model 4113 * may thus contain not only objects defined by SBML Level 3 Core, but also 4114 * objects created by libSBML plug-ins supporting additional Level 3 4115 * packages. 4116 * 4117 * 4118 * 4119 * 4120 * 4121 * If a plugin is <em>disabled</em>, the package information it contains is 4122 * no longer considered to be part of the SBML document for the purposes of 4123 * searching the document or writing out the document. However, the information 4124 * is still retained, so if the plugin is enabled again, the same information 4125 * will once again be available, and will be written out to the final model. 4126 * 4127 * 4128 * 4129 * @param recursive if @c true, the disabled information will be deleted 4130 * also from all child elements, otherwise only from this SBase element. 4131 * 4132 * @see getNumDisabledPlugins() 4133 */ public deleteDisabledPlugins()4134 void deleteDisabledPlugins() { 4135 libsbmlPINVOKE.SBase_deleteDisabledPlugins__SWIG_1(swigCPtr); 4136 } 4137 4138 4139 /** 4140 * Enables or disables the given SBML Level 3 package on this object. 4141 * 4142 * This method enables the specified package on this object and other 4143 * objects connected by child-parent links in the same SBMLDocument object. 4144 * This method is the converse of 4145 * SBase::disablePackage(string pkgURI, string pkgPrefix). 4146 * 4147 * @param pkgURI the URI of the package. 4148 * 4149 * @param pkgPrefix the XML prefix of the package. 4150 * 4151 * @param flag whether to enable (@c true) or disable (@c false) the package. 4152 * 4153 * 4154 * @return integer value indicating success/failure of the 4155 * function. @if clike The value is drawn from the 4156 * enumeration #OperationReturnValues_t. @endif The possible values 4157 * returned by this function are: 4158 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 4159 * @li @link libsbml#LIBSBML_PKG_UNKNOWN LIBSBML_PKG_UNKNOWN@endlink 4160 * @li @link libsbml#LIBSBML_PKG_VERSION_MISMATCH LIBSBML_PKG_VERSION_MISMATCH@endlink 4161 * @li @link libsbml#LIBSBML_PKG_CONFLICTED_VERSION LIBSBML_PKG_CONFLICTED_VERSION@endlink 4162 * 4163 * @see disablePackage(string pkgURI, string pkgPrefix) 4164 */ public enablePackage(string pkgURI, string pkgPrefix, bool flag)4165 int enablePackage(string pkgURI, string pkgPrefix, bool flag) { 4166 int ret = libsbmlPINVOKE.SBase_enablePackage(swigCPtr, pkgURI, pkgPrefix, flag); 4167 return ret; 4168 } 4169 4170 4171 /** 4172 * Disables the given SBML Level 3 package on this object. 4173 * 4174 * This method disables the specified package on this object 4175 * and other objects connected by child-parent links in the same 4176 * SBMLDocument object. 4177 * 4178 * An example of when this may be useful is during construction of model 4179 * components when mixing existing and new models. Suppose your 4180 * application read an SBML document containing a model that used the SBML 4181 * Hierarchical %Model Composition (“comp”) package, and 4182 * extracted parts of that model in order to construct a new model in 4183 * memory. The new, in-memory model will not accept a component drawn from 4184 * an other SBMLDocument with different package namespace declarations. 4185 * You could reconstruct the same namespaces in the in-memory model first, 4186 * but as a shortcut, you could also disable the package namespace on the 4187 * object being added. Here is a code example to help clarify this: 4188 * @if cpp 4189 @code{.cpp} 4190 // We read in an SBML L3V1 model that uses the 'comp' 4191 // package namespace. 4192 doc = readSBML('sbml-file-with-comp-elements.xml'); 4193 4194 // We extract one of the species from the model. 4195 Species s1 = doc->getModel()->getSpecies(0); 4196 4197 // We construct a new model. This model does not use the 4198 // 'comp' package. 4199 Model newModel = new Model(3,1); 4200 4201 // The following will fail with an error, because addSpecies() 4202 // will first check that the parent of the given object has 4203 // namespaces declared, and will discover that s1 does but 4204 // newModel does not. 4205 4206 // newModel->addSpecies(s1); 4207 4208 // However, if we disable the 'comp' package on s1, then 4209 // the call to addSpecies will work. 4210 4211 s1->disablePackage('http://www.sbml.org/sbml/level3/version1/comp/version1', 4212 'comp'); 4213 newModel->addSpecies(s1); 4214 @endcode 4215 @endif 4216 @if python 4217 @code{.py} 4218 import sys 4219 import os.path 4220 from libsbml import * 4221 4222 # We read an SBML L3V1 model that uses the 'comp' package. 4223 4224 doc = readSBML('sbml-file-with-comp-elements.xml'); 4225 if doc.getNumErrors() > 0: 4226 print('readSBML encountered errors while reading the file.') 4227 doc.printErrors() 4228 sys.exit(1) 4229 4230 # We extract one of the species from the model. 4231 4232 model = doc.getModel() 4233 if model == None: 4234 print('Unable to retrieve Model object') 4235 sys.exit(1) 4236 4237 s1 = model.getSpecies(0) 4238 if s1 == None: 4239 print('Unable to retrieve Species object') 4240 sys.exit(1) 4241 4242 # We construct a new model. 4243 # This model does not use the 'comp' package. 4244 4245 try: 4246 newDoc = SBMLDocument(3, 1) 4247 except ValueError: 4248 print('Could not create SBMLDocument object') 4249 sys.exit(1) 4250 4251 newModel = newDoc.createModel() 4252 if newModel == None: 4253 print('Unable to create new Model object') 4254 sys.exit(1) 4255 4256 # The following would normally fail with an error, because 4257 # addSpecies() would first check that the parent of the given 4258 # object has namespaces declared, and will discover that s1 4259 # does but newModel does not. 4260 4261 # newModel.addSpecies(s1) 4262 4263 # However, if we disable the 'comp' package on s1, then the 4264 # call to addSpecies will work. 4265 4266 compNS = 'http://www.sbml.org/sbml/level3/version1/comp/version1' 4267 status = s1.disablePackage(compNS, 'comp') 4268 if status != LIBSBML_OPERATION_SUCCESS: 4269 print('Unable to disable package.') 4270 sys.exit(1) 4271 4272 newSpecies = newModel.addSpecies(s1) # This will work now. 4273 if newSpecies == None: 4274 print('Could not add Species') # (This will not happen, 4275 sys.exit(1) # but always check errors.) 4276 @endcode 4277 @endif 4278 @if java 4279 @code{.java} 4280 // We read in an SBML L3V1 model that uses the 'comp' package namespace 4281 SBMLReader reader = new SBMLReader(); 4282 SBMLDocument doc = reader.readSBML('sbml-file-with-comp-elements.xml'); 4283 4284 // We extract one of the species from the model we just read in. 4285 Species s1 = doc.getModel().getSpecies(0); 4286 4287 // We construct a new model. This model does not use the 'comp' package. 4288 Model newModel = new Model(3,1); 4289 4290 // The following will fail with an error, because addSpecies() will 4291 // first check that the parent of the given object has namespaces 4292 // declared, and will discover that s1 does but newModel does not. 4293 4294 // newModel->addSpecies(s1); 4295 4296 // However, if we disable the 'comp' package on s1, then the call 4297 // to addSpecies will work. 4298 4299 s1->disablePackage('http://www.sbml.org/sbml/level3/version1/comp/version1', 4300 'comp'); 4301 newModel.addSpecies(s1); 4302 @endcode 4303 @endif 4304 * 4305 * @param pkgURI the URI of the package. 4306 * 4307 * @param pkgPrefix the XML prefix of the package. 4308 * 4309 * 4310 * @return integer value indicating success/failure of the 4311 * function. @if clike The value is drawn from the 4312 * enumeration #OperationReturnValues_t. @endif The possible values 4313 * returned by this function are: 4314 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 4315 * @li @link libsbml#LIBSBML_PKG_UNKNOWN LIBSBML_PKG_UNKNOWN@endlink 4316 * @li @link libsbml#LIBSBML_PKG_VERSION_MISMATCH LIBSBML_PKG_VERSION_MISMATCH@endlink 4317 * @li @link libsbml#LIBSBML_PKG_CONFLICTED_VERSION LIBSBML_PKG_CONFLICTED_VERSION@endlink 4318 * 4319 * @see enablePackage(string pkgURI, string pkgPrefix, bool flag) 4320 */ public disablePackage(string pkgURI, string pkgPrefix)4321 int disablePackage(string pkgURI, string pkgPrefix) { 4322 int ret = libsbmlPINVOKE.SBase_disablePackage(swigCPtr, pkgURI, pkgPrefix); 4323 return ret; 4324 } 4325 4326 4327 /** */ /* libsbml-internal */ public new enablePackageInternal(string pkgURI, string pkgPrefix, bool flag)4328 void enablePackageInternal(string pkgURI, string pkgPrefix, bool flag) { 4329 libsbmlPINVOKE.SBase_enablePackageInternal(swigCPtr, pkgURI, pkgPrefix, flag); 4330 } 4331 4332 4333 /** 4334 * Predicate returning @c true if an SBML Level 3 package with the 4335 * given URI is enabled with this object. 4336 * 4337 * @param pkgURI the URI of the package. 4338 * 4339 * @return @c true if the given package is enabled within this object, @c 4340 * false otherwise. 4341 * 4342 * @see isPackageEnabled(@if java String@endif) 4343 */ public isPackageURIEnabled(string pkgURI)4344 bool isPackageURIEnabled(string pkgURI) { 4345 bool ret = libsbmlPINVOKE.SBase_isPackageURIEnabled(swigCPtr, pkgURI); 4346 return ret; 4347 } 4348 4349 4350 /** 4351 * Predicate returning @c true if the given SBML Level 3 package is 4352 * enabled with this object. 4353 * 4354 * The search ignores the package version. 4355 * 4356 * @param pkgName the name of the package. 4357 * 4358 * @return @c true if the given package is enabled within this object, 4359 * @c false otherwise. 4360 * 4361 * @see isPackageURIEnabled(@if java String@endif) 4362 */ public isPackageEnabled(string pkgName)4363 bool isPackageEnabled(string pkgName) { 4364 bool ret = libsbmlPINVOKE.SBase_isPackageEnabled(swigCPtr, pkgName); 4365 return ret; 4366 } 4367 4368 4369 /** 4370 * Predicate returning @c true if an SBML Level 3 package with the 4371 * given URI is enabled with this object. 4372 * 4373 * @param pkgURI the URI of the package. 4374 * 4375 * @return @c true if the given package is enabled within this object, @c 4376 * false otherwise. 4377 * 4378 * @deprecated Replaced in libSBML 5.2.0 by 4379 * SBase::isPackageURIEnabled(@if java String@endif). 4380 * 4381 * @see isPkgEnabled(@if java String@endif) 4382 */ public isPkgURIEnabled(string pkgURI)4383 bool isPkgURIEnabled(string pkgURI) { 4384 bool ret = libsbmlPINVOKE.SBase_isPkgURIEnabled(swigCPtr, pkgURI); 4385 return ret; 4386 } 4387 4388 4389 /** 4390 * Predicate returning @c true if the given SBML Level 3 package is 4391 * enabled with this object. 4392 * 4393 * The search ignores the package version. 4394 * 4395 * @param pkgName the name of the package. 4396 * 4397 * @return @c true if the given package is enabled within this object, 4398 * @c false otherwise. 4399 * 4400 * @deprecated Replaced in libSBML 5.2.0 by 4401 * SBase::isPackageEnabled(@if java String@endif). 4402 * 4403 * @see isPkgURIEnabled(@if java String@endif) 4404 */ public isPkgEnabled(string pkgName)4405 bool isPkgEnabled(string pkgName) { 4406 bool ret = libsbmlPINVOKE.SBase_isPkgEnabled(swigCPtr, pkgName); 4407 return ret; 4408 } 4409 4410 4411 /** */ /* libsbml-internal */ public new writeExtensionElements(XMLOutputStream stream)4412 void writeExtensionElements(XMLOutputStream stream) { 4413 libsbmlPINVOKE.SBase_writeExtensionElements(swigCPtr, XMLOutputStream.getCPtr(stream)); 4414 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 4415 } 4416 4417 4418 /** */ /* libsbml-internal */ public read(XMLInputStream stream)4419 void read(XMLInputStream stream) { 4420 libsbmlPINVOKE.SBase_read__SWIG_2(swigCPtr, XMLInputStream.getCPtr(stream)); 4421 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 4422 } 4423 4424 4425 /** */ /* libsbml-internal */ public new write(XMLOutputStream stream)4426 void write(XMLOutputStream stream) { 4427 libsbmlPINVOKE.SBase_write(swigCPtr, XMLOutputStream.getCPtr(stream)); 4428 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 4429 } 4430 4431 4432 /** */ /* libsbml-internal */ public new hasRequiredAttributes()4433 bool hasRequiredAttributes() { 4434 bool ret = libsbmlPINVOKE.SBase_hasRequiredAttributes(swigCPtr); 4435 return ret; 4436 } 4437 4438 4439 /** */ /* libsbml-internal */ public new hasRequiredElements()4440 bool hasRequiredElements() { 4441 bool ret = libsbmlPINVOKE.SBase_hasRequiredElements(swigCPtr); 4442 return ret; 4443 } 4444 4445 4446 /** */ /* libsbml-internal */ public checkCompatibility(SBase object_)4447 int checkCompatibility(SBase object_) { 4448 int ret = libsbmlPINVOKE.SBase_checkCompatibility(swigCPtr, SBase.getCPtr(object_)); 4449 return ret; 4450 } 4451 4452 4453 /** */ /* libsbml-internal */ public setSBMLNamespacesAndOwn(SBMLNamespaces disownedNs)4454 void setSBMLNamespacesAndOwn(SBMLNamespaces disownedNs) { 4455 libsbmlPINVOKE.SBase_setSBMLNamespacesAndOwn(swigCPtr, SBMLNamespaces.getCPtrAndDisown(disownedNs)); 4456 } 4457 4458 4459 /** */ /* libsbml-internal */ public new getSBMLNamespaces()4460 SBMLNamespaces getSBMLNamespaces() { 4461 SBMLNamespaces ret 4462 = (SBMLNamespaces) libsbml.DowncastSBMLNamespaces(libsbmlPINVOKE.SBase_getSBMLNamespaces(swigCPtr), false); 4463 return ret; 4464 } 4465 4466 4467 /** */ /* libsbml-internal */ public removeDuplicateAnnotations()4468 void removeDuplicateAnnotations() { 4469 libsbmlPINVOKE.SBase_removeDuplicateAnnotations(swigCPtr); 4470 } 4471 4472 4473 /** */ /* libsbml-internal */ public checkMathMLNamespace(XMLToken elem)4474 string checkMathMLNamespace(XMLToken elem) { 4475 string ret = libsbmlPINVOKE.SBase_checkMathMLNamespace(swigCPtr, XMLToken.getCPtr(elem)); 4476 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 4477 return ret; 4478 } 4479 4480 4481 /** */ /* libsbml-internal */ public new getDerivedUnitDefinition()4482 UnitDefinition getDerivedUnitDefinition() { 4483 global::System.IntPtr cPtr = libsbmlPINVOKE.SBase_getDerivedUnitDefinition(swigCPtr); 4484 UnitDefinition ret = (cPtr == global::System.IntPtr.Zero) ? null : new UnitDefinition(cPtr, false); 4485 return ret; 4486 } 4487 4488 4489 /** */ /* libsbml-internal */ public new containsUndeclaredUnits()4490 bool containsUndeclaredUnits() { 4491 bool ret = libsbmlPINVOKE.SBase_containsUndeclaredUnits(swigCPtr); 4492 return ret; 4493 } 4494 4495 4496 /** 4497 * Removes this object from its parent. 4498 * 4499 * If the parent was storing this object as a pointer, it is deleted. If 4500 * not, it is simply cleared (as in ListOf objects). This is a pure 4501 * virtual method, as every SBase element has different parents, and 4502 * therefore different methods of removing itself. Will fail (and not 4503 * delete itself) if it has no parent object. This function is designed to 4504 * be overridden, but for all objects whose parent is of the class ListOf, 4505 * the default implementation will work. 4506 * 4507 * 4508 * @return integer value indicating success/failure of the 4509 * function. @if clike The value is drawn from the 4510 * enumeration #OperationReturnValues_t. @endif The possible values 4511 * returned by this function are: 4512 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 4513 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 4514 */ public new removeFromParentAndDelete()4515 int removeFromParentAndDelete() { 4516 int ret = libsbmlPINVOKE.SBase_removeFromParentAndDelete(swigCPtr); 4517 return ret; 4518 } 4519 4520 4521 /** 4522 * Returns @c true if this object's set of XML namespaces are the same 4523 * as the given object's XML namespaces. 4524 * 4525 * 4526 * 4527 * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces 4528 * information. It is used to communicate the SBML Level, Version, and (in 4529 * Level 3) packages used in addition to SBML Level 3 Core. A 4530 * common approach to using libSBML's SBMLNamespaces facilities is to create an 4531 * SBMLNamespaces object somewhere in a program once, then hand that object 4532 * as needed to object constructors that accept SBMLNamespaces as arguments. 4533 * 4534 * 4535 * 4536 * @param sb an object to compare with respect to namespaces. 4537 * 4538 * @return boolean, @c true if this object's collection of namespaces is 4539 * the same as @p sb's, @c false otherwise. 4540 */ public matchesSBMLNamespaces(SBase sb)4541 bool matchesSBMLNamespaces(SBase sb) { 4542 bool ret = libsbmlPINVOKE.SBase_matchesSBMLNamespaces__SWIG_0(swigCPtr, SBase.getCPtr(sb)); 4543 return ret; 4544 } 4545 4546 4547 /** 4548 * Returns @c true if this object's set of XML namespaces are a subset 4549 * of the given object's XML namespaces. 4550 * 4551 * 4552 * 4553 * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces 4554 * information. It is used to communicate the SBML Level, Version, and (in 4555 * Level 3) packages used in addition to SBML Level 3 Core. A 4556 * common approach to using libSBML's SBMLNamespaces facilities is to create an 4557 * SBMLNamespaces object somewhere in a program once, then hand that object 4558 * as needed to object constructors that accept SBMLNamespaces as arguments. 4559 * 4560 * 4561 * 4562 * @param sb an object to compare with respect to namespaces. 4563 * 4564 * @return boolean, @c true if this object's collection of namespaces is 4565 * a subset of @p sb's, @c false otherwise. 4566 */ public matchesRequiredSBMLNamespacesForAddition(SBase sb)4567 bool matchesRequiredSBMLNamespacesForAddition(SBase sb) { 4568 bool ret = libsbmlPINVOKE.SBase_matchesRequiredSBMLNamespacesForAddition__SWIG_0(swigCPtr, SBase.getCPtr(sb)); 4569 return ret; 4570 } 4571 4572 4573 /** 4574 * Predicate returning true or false depending on whether 4575 * the user data of this element has been set. 4576 * 4577 * 4578 * 4579 * The user data associated with an SBML object can be used by an application 4580 * developer to attach custom information to that object in the model. In case 4581 * of a deep copy, this data will passed as-is. The data attribute will never 4582 * be interpreted by libSBML. 4583 * 4584 * @return boolean, @c true if this object's user data has been set, 4585 * @c false otherwise. 4586 */ public isSetUserData()4587 bool isSetUserData() { 4588 bool ret = libsbmlPINVOKE.SBase_isSetUserData(swigCPtr); 4589 return ret; 4590 } 4591 4592 4593 /** 4594 * Unsets the user data of this element. 4595 * 4596 * 4597 * 4598 * The user data associated with an SBML object can be used by an application 4599 * developer to attach custom information to that object in the model. In case 4600 * of a deep copy, this data will passed as-is. The data attribute will never 4601 * be interpreted by libSBML. 4602 * 4603 * 4604 * @return integer value indicating success/failure of the 4605 * function. @if clike The value is drawn from the 4606 * enumeration #OperationReturnValues_t. @endif The possible values 4607 * returned by this function are: 4608 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 4609 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 4610 */ public unsetUserData()4611 int unsetUserData() { 4612 int ret = libsbmlPINVOKE.SBase_unsetUserData(swigCPtr); 4613 return ret; 4614 } 4615 4616 4617 /** 4618 * Returns the namespace URI to which this element belongs to. 4619 * 4620 * For example, all elements that belong to SBML Level 3 Version 1 Core 4621 * must would have the URI <code>'http://www.sbml.org/sbml/level3/version1/core'</code>; 4622 * all elements that belong to Layout Extension Version 1 for SBML Level 3 4623 * Version 1 Core must would have the URI 4624 * <code>'http://www.sbml.org/sbml/level3/version1/layout/version1'</code>. 4625 * 4626 * This function first returns the URI for this element by looking into the 4627 * SBMLNamespaces object of the document with the its package name. If not 4628 * found, it will then look for the namespace associated with the element 4629 * itself. 4630 * 4631 * @return the URI of this element, as a text string. 4632 * 4633 * @see getSBMLDocument() 4634 * @see getPackageName() 4635 */ public getURI()4636 string getURI() { 4637 string ret = libsbmlPINVOKE.SBase_getURI(swigCPtr); 4638 return ret; 4639 } 4640 4641 4642 /** 4643 * Returns the XML namespace prefix of this element. 4644 * 4645 * This reports the XML namespace prefix chosen for this class of object in 4646 * the current SBML document. This may be an empty string if the component 4647 * has no explicit prefix (for instance, if it is a core SBML object placed 4648 * in the default SBML namespace of the document). If it is not empty, then 4649 * it corresponds to the XML namespace prefix used set the object, whatever 4650 * that may be in a given SBML document. 4651 * 4652 * @return a text string representing the XML namespace prefix. 4653 */ public getPrefix()4654 string getPrefix() { 4655 string ret = libsbmlPINVOKE.SBase_getPrefix(swigCPtr); 4656 return ret; 4657 } 4658 4659 4660 /** */ /* libsbml-internal */ public new hasOptionalAttributes()4661 bool hasOptionalAttributes() { 4662 bool ret = libsbmlPINVOKE.SBase_hasOptionalAttributes(swigCPtr); 4663 return ret; 4664 } 4665 4666 4667 /** */ /* libsbml-internal */ public new hasOptionalElements()4668 bool hasOptionalElements() { 4669 bool ret = libsbmlPINVOKE.SBase_hasOptionalElements(swigCPtr); 4670 return ret; 4671 } 4672 4673 4674 /** */ /* libsbml-internal */ public new updateSBMLNamespace(string package, long level, long version)4675 void updateSBMLNamespace(string package, long level, long version) { 4676 libsbmlPINVOKE.SBase_updateSBMLNamespace(swigCPtr, package, level, version); 4677 } 4678 getListOfAllElements(ElementFilter filter)4679 public SBaseList getListOfAllElements(ElementFilter filter) { 4680 SBaseList ret = new SBaseList(libsbmlPINVOKE.SBase_getListOfAllElements__SWIG_0(swigCPtr, ElementFilter.getCPtr(filter)), true); 4681 return ret; 4682 } 4683 getListOfAllElements()4684 public SBaseList getListOfAllElements() { 4685 SBaseList ret = new SBaseList(libsbmlPINVOKE.SBase_getListOfAllElements__SWIG_1(swigCPtr), true); 4686 return ret; 4687 } 4688 getListOfAllElementsFromPlugins(ElementFilter filter)4689 public SBaseList getListOfAllElementsFromPlugins(ElementFilter filter) { 4690 SBaseList ret = new SBaseList(libsbmlPINVOKE.SBase_getListOfAllElementsFromPlugins__SWIG_0(swigCPtr, ElementFilter.getCPtr(filter)), true); 4691 return ret; 4692 } 4693 getListOfAllElementsFromPlugins()4694 public SBaseList getListOfAllElementsFromPlugins() { 4695 SBaseList ret = new SBaseList(libsbmlPINVOKE.SBase_getListOfAllElementsFromPlugins__SWIG_1(swigCPtr), true); 4696 return ret; 4697 } 4698 4699 } 4700 4701 } 4702