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