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