001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.0.11 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 * 013 * Implementation of SBase, the base class of most SBML objects. 014 * <p> 015 * Most components in SBML are derived from a single abstract base type, 016 * {@link SBase}. In addition to serving as the parent class for most other 017 * classes of objects in SBML, this base type is designed to allow a 018 * modeler or a software package to attach arbitrary information to each 019 * major element or list in an SBML model. 020 * <p> 021 * {@link SBase} has an optional subelement called 'notes'. It is intended to 022 * serve as a place for storing optional information intended to be seen by 023 * humans. An example use of the 'notes' element would be to contain 024 * formatted user comments about the model element in which the 'notes' 025 * element is enclosed. There are certain conditions on the XHTML content 026 * permitted inside the 'notes' element; please consult the <a 027 * target='_blank' href='http://sbml.org/Documents/Specifications'>SBML 028 * specification document</a> corresponding to the SBML Level and Version 029 * of your model for more information about the requirements for 'notes' 030 * content. 031 * <p> 032 * {@link SBase} has another optional subelement called 'annotation'. Whereas the 033 * 'notes' element described above is a container for content to be shown 034 * directly to humans, the 'annotation' element is a container for optional 035 * software-generated content <em>not</em> meant to be shown to humans. The 036 * element's content type is <a target='_blank' 037 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 038 * 'any'</a>, allowing essentially arbitrary data content. SBML places 039 * only a few restrictions on the organization of the content; these are 040 * intended to help software tools read and write the data as well as help 041 * reduce conflicts between annotations added by different tools. As is 042 * the case with 'notes', it is important to refer to the <a 043 * target='_blank' href='http://sbml.org/Documents/Specifications'>SBML 044 * specification document</a> corresponding to the SBML Level and Version 045 * of your model for more information about the requirements for 046 * 'annotation' content. 047 * <p> 048 * It is worth pointing out that the 'annotation' element in the definition 049 * of {@link SBase} exists in order that software developers may attach optional 050 * application-specific data to the elements in an SBML model. However, it 051 * is important that this facility not be misused. In particular, it is 052 * <em>critical</em> that data essential to a model definition or that can 053 * be encoded in existing SBML elements is <em>not</em> stored in 054 * 'annotation'. {@link Parameter} values, functional dependencies between model 055 * elements, etc., should not be recorded as annotations. It is crucial to 056 * keep in mind the fact that data placed in annotations can be freely 057 * ignored by software applications. If such data affects the 058 * interpretation of a model, then software interoperability is greatly 059 * impeded. 060 * <p> 061 * SBML Level 2 introduced an optional {@link SBase} attribute named 'metaid' for 062 * supporting metadata annotations using RDF (<a target='_blank' 063 * href='http://www.w3.org/RDF/'>Resource Description Format</a>). The 064 * attribute value has the data type <a 065 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML identifier 066 * type, which means each 'metaid' value must be globally unique within an 067 * SBML file. (Importantly, this uniqueness criterion applies across any 068 * attribute with type <a href='http://www.w3.org/TR/REC-xml/#id'>XML 069 * ID</a>, not just the 'metaid' attribute used by SBML—something to 070 * be aware of if your application-specific XML content inside the 071 * 'annotation' subelement happens to use <a 072 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) The 'metaid' value 073 * serves to identify a model component for purposes such as referencing 074 * that component from metadata placed within 'annotation' subelements. 075 * <p> 076 * Beginning with SBML Level 2 Version 3, {@link SBase} also has an optional 077 * attribute named 'sboTerm' for supporting the use of the Systems Biology 078 * Ontology. In SBML proper, the data type of the attribute is a string of 079 * the form 'SBO:NNNNNNN', where 'NNNNNNN' is a seven digit integer number; 080 * libSBML simplifies the representation by only storing the 'NNNNNNN' 081 * integer portion. Thus, in libSBML, the 'sboTerm' attribute on {@link SBase} has 082 * data type <code>int</code>, and {@link SBO} identifiers are stored simply as integers. 083 * (For convenience, {@link SBase} offers methods for returning both the integer 084 * form and a text-string form of the {@link SBO} identifier.) {@link SBO} terms are a 085 * type of optional annotation, and each different class of SBML object 086 * derived from {@link SBase} imposes its own requirements about the values 087 * permitted for 'sboTerm'. Please consult the SBML Level 2 088 * Version 4 specification for more information about the use of {@link SBO} 089 * and the 'sboTerm' attribute. 090 * <p> 091 * Finally, note that, in the list of methods on {@link SBase}, there is no public 092 * constructor because {@link SBase} is an abstract class. The constructors reside 093 * in the subclasses derived from {@link SBase}. 094 * <p> 095 * <p> 096 * <h2>Standard format for annotations linking data resources</h2> 097 * <p> 098 * SBML Level 2 Versions 2, 3 and 4, and Level 3, define a proposed 099 * regular format for encoding two particular categories of annotations: 100 * (a) references to controlled vocabulary terms and database identifiers 101 * which define and describe biological and biochemical entities in a 102 * model; and (b) descriptions of the provenance of a model, including its 103 * author(s) and modification history. 104 */ 105 106public class SBase { 107 private long swigCPtr; 108 protected boolean swigCMemOwn; 109 110 protected SBase(long cPtr, boolean cMemoryOwn) 111 { 112 swigCMemOwn = cMemoryOwn; 113 swigCPtr = cPtr; 114 } 115 116 protected static long getCPtr(SBase obj) 117 { 118 return (obj == null) ? 0 : obj.swigCPtr; 119 } 120 121 protected static long getCPtrAndDisown (SBase obj) 122 { 123 long ptr = 0; 124 125 if (obj != null) 126 { 127 ptr = obj.swigCPtr; 128 obj.swigCMemOwn = false; 129 } 130 131 return ptr; 132 } 133 134 protected void finalize() { 135 delete(); 136 } 137 138 public synchronized void delete() { 139 if (swigCPtr != 0) { 140 if (swigCMemOwn) { 141 swigCMemOwn = false; 142 libsbmlJNI.delete_SBase(swigCPtr); 143 } 144 swigCPtr = 0; 145 } 146 } 147 148 /** 149 * Equality comparison method for SBase. 150 * <p> 151 * Because the Java methods for libSBML are actually wrappers around code 152 * implemented in C++ and C, certain operations will not behave as 153 * expected. Equality comparison is one such case. An instance of a 154 * libSBML object class is actually a <em>proxy object</em> 155 * wrapping the real underlying C/C++ object. The normal <code>==</code> 156 * equality operator in Java will <em>only compare the Java proxy objects</em>, 157 * not the underlying native object. The result is almost never what you 158 * want in practical situations. Unfortunately, Java does not provide a 159 * way to override <code>==</code>. 160 * <p> 161 * The alternative that must be followed is to use the 162 * <code>equals()</code> method. The <code>equals</code> method on this 163 * class overrides the default java.lang.Object one, and performs an 164 * intelligent comparison of instances of objects of this class. The 165 * result is an assessment of whether two libSBML Java objects are truly 166 * the same underlying native-code objects. 167 * <p> 168 * The use of this method in practice is the same as the use of any other 169 * Java <code>equals</code> method. For example, 170 * <em>a</em><code>.equals(</code><em>b</em><code>)</code> returns 171 * <code>true</code> if <em>a</em> and <em>b</em> are references to the 172 * same underlying object. 173 * 174 * @param sb a reference to an object to which the current object 175 * instance will be compared 176 * 177 * @return <code>true</code> if <code>sb</code> refers to the same underlying 178 * native object as this one, <code>false</code> otherwise 179 */ 180 public boolean equals(Object sb) 181 { 182 if ( this == sb ) 183 { 184 return true; 185 } 186 return swigCPtr == getCPtr((SBase)(sb)); 187 } 188 189 /** 190 * Returns a hashcode for this SBase object. 191 * 192 * @return a hash code usable by Java methods that need them. 193 */ 194 public int hashCode() 195 { 196 return (int)(swigCPtr^(swigCPtr>>>32)); 197 } 198 199 200/** 201 * Creates and returns a deep copy of this {@link SBase} object. 202 * <p> 203 * @return a (deep) copy of this {@link SBase} object. 204 */ public 205 SBase cloneObject() { 206 return libsbml.DowncastSBase(libsbmlJNI.SBase_cloneObject(swigCPtr, this), true); 207} 208 209 210/** 211 * Returns the first child element found that has the given <code>id</code> in the 212 * model-wide <code>SId</code> namespace, or <code>null</code> if no such object is found. 213 * <p> 214 * @param id string representing the 'id' attribute value of the object 215 * to find. 216 * <p> 217 * @return pointer to the first element found with the given identifier. 218 */ public 219 SBase getElementBySId(String id) { 220 return libsbml.DowncastSBase(libsbmlJNI.SBase_getElementBySId(swigCPtr, this, id), false); 221} 222 223 224/** 225 * Returns the first child element it can find with a specific 'metaid' 226 * attribute value, or <code>null</code> if no such object is found. 227 * <p> 228 * @param metaid string representing the 'metaid' attribute value of the 229 * object to find. 230 * <p> 231 * @return pointer to the first element found with the given meta-identifier. 232 */ public 233 SBase getElementByMetaId(String metaid) { 234 return libsbml.DowncastSBase(libsbmlJNI.SBase_getElementByMetaId(swigCPtr, this, metaid), false); 235} 236 237 238/** 239 * Renames all the <code>SIdRef</code> attributes on this element, including any 240 * found in MathML content (if such exists). 241 * <p> 242 * This method works by looking at all attributes and (if appropriate) 243 * mathematical formulas, comparing the identifiers to the value of 244 * <code>oldid</code>. If any matches are found, the matching identifiers are replaced 245 * with <code>newid</code>. The method does <em>not</em> descend into child elements. 246 * <p> 247 * @param oldid the old identifier 248 * @param newid the new identifier 249 */ public 250 void renameSIdRefs(String oldid, String newid) { 251 libsbmlJNI.SBase_renameSIdRefs(swigCPtr, this, oldid, newid); 252 } 253 254 255/** 256 * Renames all the <code>MetaIdRef</code> attributes on this element. 257 * <p> 258 * This method works by looking at all meta-attribute values, comparing 259 * the identifiers to the value of <code>oldid</code>. If any matches are found, 260 * the matching identifiers are replaced with <code>newid</code>. The method does 261 * <em>not</em> descend into child elements. 262 * <p> 263 * @param oldid the old identifier 264 * @param newid the new identifier 265 */ public 266 void renameMetaIdRefs(String oldid, String newid) { 267 libsbmlJNI.SBase_renameMetaIdRefs(swigCPtr, this, oldid, newid); 268 } 269 270 271/** 272 * Renames all the <code>UnitSIdRef</code> attributes on this element. 273 * <p> 274 * This method works by looking at all unit identifier attribute values 275 * (including, if appropriate, inside mathematical formulas), comparing the 276 * unit identifiers to the value of <code>oldid</code>. If any matches are found, 277 * the matching identifiers are replaced with <code>newid</code>. The method does 278 * <em>not</em> descend into child elements. 279 * <p> 280 * @param oldid the old identifier 281 * @param newid the new identifier 282 */ public 283 void renameUnitSIdRefs(String oldid, String newid) { 284 libsbmlJNI.SBase_renameUnitSIdRefs(swigCPtr, this, oldid, newid); 285 } 286 287 288/** 289 * If this object has a child 'math' object (or anything with ASTNodes in 290 * general), replace all nodes with the name 'id' with the provided 291 * function. 292 * <p> 293 * @note This function does nothing itself—subclasses with {@link ASTNode} 294 * subelements must override this function. 295 * @internal 296 */ public 297 void replaceSIDWithFunction(String id, ASTNode function) { 298 libsbmlJNI.SBase_replaceSIDWithFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 299 } 300 301 302/** 303 * If the function of this object is to assign a value has a child 'math' 304 * object (or anything with ASTNodes in general), replace the 'math' 305 * object with the function (existing/function). 306 * <p> 307 * @note This function does nothing itself—subclasses with {@link ASTNode} 308 * subelements must override this function. 309 * @internal 310 */ public 311 void divideAssignmentsToSIdByFunction(String id, ASTNode function) { 312 libsbmlJNI.SBase_divideAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 313 } 314 315 316/** 317 * If this assignment assigns a value to the 'id' element, replace the 'math' object with the function (existing*function). 318 * @internal 319 */ public 320 void multiplyAssignmentsToSIdByFunction(String id, ASTNode function) { 321 libsbmlJNI.SBase_multiplyAssignmentsToSIdByFunction(swigCPtr, this, id, ASTNode.getCPtr(function), function); 322 } 323 324 325/** 326 * Returns the first child element found that has the given <code>id</code> in the 327 * model-wide SId namespace from all plug-ins associated with this 328 * element, or <code>null</code> if no such object is found. 329 * <p> 330 * @param id string representing the id of objects to find 331 * <p> 332 * @return pointer to the first element found with the given <code>id</code>. 333 * @internal 334 */ public 335 SBase getElementFromPluginsBySId(String id) { 336 return libsbml.DowncastSBase(libsbmlJNI.SBase_getElementFromPluginsBySId(swigCPtr, this, id), false); 337} 338 339 340/** 341 * Returns the first child element it can find with the given <code>metaid</code> from 342 * all plug-ins associated with this element, or <code>null</code> if no such object 343 * is found. 344 * <p> 345 * @param metaid string representing the metaid of objects to find 346 * <p> 347 * @return pointer to the first element found with the given <code>metaid</code>. 348 * @internal 349 */ public 350 SBase getElementFromPluginsByMetaId(String metaid) { 351 return libsbml.DowncastSBase(libsbmlJNI.SBase_getElementFromPluginsByMetaId(swigCPtr, this, metaid), false); 352} 353 354 355/** 356 * Check to see if the given prefix is used by any of the IDs defined by 357 * extension elements *excluding* 'id' and 'metaid' attributes (as, for 358 * example, the spatial id attributes 'spid'). 359 * @internal 360 */ public 361 boolean hasNonstandardIdentifierBeginningWith(String prefix) { 362 return libsbmlJNI.SBase_hasNonstandardIdentifierBeginningWith(swigCPtr, this, prefix); 363 } 364 365 366/** 367 * Add the given string to all identifiers in the object. If the string 368 * is added to anything other than an id or a metaid, this code is 369 * responsible for tracking down and renaming all *idRefs in the package 370 * extention that identifier comes from. 371 * @internal 372 */ public 373 int prependStringToAllIdentifiers(String prefix) { 374 return libsbmlJNI.SBase_prependStringToAllIdentifiers(swigCPtr, this, prefix); 375 } 376 377 378/** 379 * Returns the value of the 'metaid' attribute of this object. 380 * <p> 381 * The optional attribute named 'metaid', present on every major SBML 382 * component type, is for supporting metadata annotations using RDF 383 * (Resource Description Format). The attribute value has the data type 384 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 385 * identifier type, which means each 'metaid' value must be globally 386 * unique within an SBML file. (Importantly, this uniqueness criterion 387 * applies across any attribute with type <a 388 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 389 * 'metaid' attribute used by SBML—something to be aware of if your 390 * application-specific XML content inside the 'annotation' subelement 391 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 392 * The 'metaid' value serves to identify a model 393 * component for purposes such as referencing that component from 394 * metadata placed within 'annotation' subelements. 395 * <p> 396 * @return the meta-identifier of this SBML object. 397 * <p> 398 * @see #isSetMetaId() 399 * @see #setMetaId(String metaid) 400 */ public 401 String getMetaId() { 402 return libsbmlJNI.SBase_getMetaId(swigCPtr, this); 403 } 404 405 406/** 407 * Returns the value of the 'metaid' attribute of this object. 408 * <p> 409 * The optional attribute named 'metaid', present on every major SBML 410 * component type, is for supporting metadata annotations using RDF 411 * (Resource Description Format). The attribute value has the data type 412 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 413 * identifier type, which means each 'metaid' value must be globally 414 * unique within an SBML file. (Importantly, this uniqueness criterion 415 * applies across any attribute with type <a 416 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 417 * 'metaid' attribute used by SBML—something to be aware of if your 418 * application-specific XML content inside the 'annotation' subelement 419 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 420 * The 'metaid' value serves to identify a model 421 * component for purposes such as referencing that component from 422 * metadata placed within 'annotation' subelements. 423 * <p> 424 * @return the meta-identifier of this SBML object, as a string. 425 * <p> 426 * @see #isSetMetaId() 427 * @see #setMetaId(String metaid) 428 * @internal 429 */ public 430 String getId() { 431 return libsbmlJNI.SBase_getId(swigCPtr, this); 432 } 433 434 435/** 436 * Returns the value of the 'metaid' attribute of this object. 437 * <p> 438 * The optional attribute named 'metaid', present on every major SBML 439 * component type, is for supporting metadata annotations using RDF 440 * (Resource Description Format). The attribute value has the data type 441 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 442 * identifier type, which means each 'metaid' value must be globally 443 * unique within an SBML file. (Importantly, this uniqueness criterion 444 * applies across any attribute with type <a 445 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 446 * 'metaid' attribute used by SBML—something to be aware of if your 447 * application-specific XML content inside the 'annotation' subelement 448 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 449 * The 'metaid' value serves to identify a model 450 * component for purposes such as referencing that component from 451 * metadata placed within 'annotation' subelements. 452 * <p> 453 * @return the meta-identifier of this SBML object, as a string. 454 * <p> 455 * @see #isSetMetaId() 456 * @see #setMetaId(String metaid) 457 * @internal 458 */ public 459 String getName() { 460 return libsbmlJNI.SBase_getName(swigCPtr, this); 461 } 462 463 464/** 465 * Returns the content of the 'notes' subelement of this object as 466 * a tree of {@link XMLNode} objects. 467 * <p> 468 * The optional SBML element named 'notes', present on every major SBML 469 * component type, is intended as a place for storing optional 470 * information intended to be seen by humans. An example use of the 471 * 'notes' element would be to contain formatted user comments about the 472 * model element in which the 'notes' element is enclosed. Every object 473 * derived directly or indirectly from type {@link SBase} can have a separate 474 * value for 'notes', allowing users considerable freedom when adding 475 * comments to their models. 476 * <p> 477 * The format of 'notes' elements must be <a target='_blank' 478 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 479 * verify the formatting of 'notes' content, libSBML provides the static 480 * utility method {@link SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml)}; however, 481 * readers are urged to consult the appropriate <a target='_blank' 482 * href='http://sbml.org/Documents/Specifications'>SBML specification 483 * document</a> for the Level and Version of their model for more 484 * in-depth explanations. The SBML Level 2 and 3 485 * specifications have considerable detail about how 'notes' element 486 * content must be structured. 487 * <p> 488 * The 'notes' element content returned by this method will be in XML 489 * form, but libSBML does not provide an object model specifically for 490 * the content of notes. Callers will need to traverse the XML tree 491 * structure using the facilities available on {@link XMLNode} and related 492 * objects. For an alternative method of accessing the notes, see 493 * getNotesString(). 494 * <p> 495 * @return the content of the 'notes' subelement of this SBML object as a 496 * tree structure composed of {@link XMLNode} objects. 497 * <p> 498 * @see #getNotesString() 499 * @see #isSetNotes() 500 * @see #setNotes(XMLNode notes) 501 * @see #setNotes(String notes) 502 * @see #appendNotes(XMLNode notes) 503 * @see #appendNotes(String notes) 504 * @see #unsetNotes() 505 * @see SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml) 506 */ public 507 XMLNode getNotes() { 508 long cPtr = libsbmlJNI.SBase_getNotes__SWIG_0(swigCPtr, this); 509 return (cPtr == 0) ? null : new XMLNode(cPtr, false); 510 } 511 512 513/** 514 * Returns the content of the 'notes' subelement of this object as a 515 * string. 516 * <p> 517 * The optional SBML element named 'notes', present on every major SBML 518 * component type, is intended as a place for storing optional 519 * information intended to be seen by humans. An example use of the 520 * 'notes' element would be to contain formatted user comments about the 521 * model element in which the 'notes' element is enclosed. Every object 522 * derived directly or indirectly from type {@link SBase} can have a separate 523 * value for 'notes', allowing users considerable freedom when adding 524 * comments to their models. 525 * <p> 526 * The format of 'notes' elements must be <a target='_blank' 527 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 528 * verify the formatting of 'notes' content, libSBML provides the static 529 * utility method {@link SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml)}; however, 530 * readers are urged to consult the appropriate <a target='_blank' 531 * href='http://sbml.org/Documents/Specifications'>SBML specification 532 * document</a> for the Level and Version of their model for more 533 * in-depth explanations. The SBML Level 2 and 3 534 * specifications have considerable detail about how 'notes' element 535 * content must be structured. 536 * <p> 537 * For an alternative method of accessing the notes, see getNotes(), 538 * which returns the content as an {@link XMLNode} tree structure. Depending on 539 * an application's needs, one or the other method may be more 540 * convenient. 541 * <p> 542 * @return the content of the 'notes' subelement of this SBML object as a 543 * string. 544 * <p> 545 * @see #getNotes() 546 * @see #isSetNotes() 547 * @see #setNotes(XMLNode notes) 548 * @see #setNotes(String notes) 549 * @see #appendNotes(XMLNode notes) 550 * @see #appendNotes(String notes) 551 * @see #unsetNotes() 552 * @see SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml) 553 */ public 554 String getNotesString() { 555 return libsbmlJNI.SBase_getNotesString__SWIG_0(swigCPtr, this); 556 } 557 558 559/** 560 * Returns the content of the 'annotation' subelement of this object as 561 * a tree of {@link XMLNode} objects. 562 * <p> 563 * Whereas the SBML 'notes' subelement is a container for content to be 564 * shown directly to humans, the 'annotation' element is a container for 565 * optional software-generated content <em>not</em> meant to be shown to 566 * humans. Every object derived from {@link SBase} can have its own value for 567 * 'annotation'. The element's content type is <a target='_blank' 568 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 569 * 'any'</a>, allowing essentially arbitrary well-formed XML data 570 * content. 571 * <p> 572 * SBML places a few restrictions on the organization of the content of 573 * annotations; these are intended to help software tools read and write 574 * the data as well as help reduce conflicts between annotations added by 575 * different tools. Please see the SBML specifications for more details. 576 * <p> 577 * The annotations returned by this method will be in XML form. LibSBML 578 * provides an object model and related interfaces for certain specific 579 * kinds of annotations, namely model history information and RDF 580 * content. See the {@link ModelHistory}, {@link CVTerm} and {@link RDFAnnotationParser} classes 581 * for more information about the facilities available. 582 * <p> 583 * @return the annotation of this SBML object as a tree of {@link XMLNode} objects. 584 * <p> 585 * @see #getAnnotationString() 586 * @see #isSetAnnotation() 587 * @see #setAnnotation(XMLNode annotation) 588 * @see #setAnnotation(String annotation) 589 * @see #appendAnnotation(XMLNode annotation) 590 * @see #appendAnnotation(String annotation) 591 * @see #unsetAnnotation() 592 */ public 593 XMLNode getAnnotation() { 594 long cPtr = libsbmlJNI.SBase_getAnnotation__SWIG_0(swigCPtr, this); 595 return (cPtr == 0) ? null : new XMLNode(cPtr, false); 596 } 597 598 599/** 600 * Returns the content of the 'annotation' subelement of this object as a 601 * character string. 602 * <p> 603 * Whereas the SBML 'notes' subelement is a container for content to be 604 * shown directly to humans, the 'annotation' element is a container for 605 * optional software-generated content <em>not</em> meant to be shown to 606 * humans. Every object derived from {@link SBase} can have its own value for 607 * 'annotation'. The element's content type is <a target='_blank' 608 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 609 * 'any'</a>, allowing essentially arbitrary well-formed XML data 610 * content. 611 * <p> 612 * SBML places a few restrictions on the organization of the content of 613 * annotations; these are intended to help software tools read and write 614 * the data as well as help reduce conflicts between annotations added by 615 * different tools. Please see the SBML specifications for more details. 616 * <p> 617 * The annotations returned by this method will be in string form. 618 * <p> 619 * @return the annotation of this SBML object as a character string. 620 * <p> 621 * @see #getAnnotation() 622 * @see #isSetAnnotation() 623 * @see #setAnnotation(XMLNode annotation) 624 * @see #setAnnotation(String annotation) 625 * @see #appendAnnotation(XMLNode annotation) 626 * @see #appendAnnotation(String annotation) 627 * @see #unsetAnnotation() 628 */ public 629 String getAnnotationString() { 630 return libsbmlJNI.SBase_getAnnotationString__SWIG_0(swigCPtr, this); 631 } 632 633 634/** 635 * Returns a list of the XML Namespaces declared on this SBML document. 636 * <p> 637 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 638 * information. It is used to communicate the SBML Level, Version, and 639 * (in SBML Level 3) packages used in addition to SBML Level 3 640 * Core. 641 * <p> 642 * @return the XML Namespaces associated with this SBML object 643 * <p> 644 * @see #getLevel() 645 * @see #getVersion() 646 */ public 647 XMLNamespaces getNamespaces() { 648 long cPtr = libsbmlJNI.SBase_getNamespaces(swigCPtr, this); 649 return (cPtr == 0) ? null : new XMLNamespaces(cPtr, false); 650 } 651 652 653/** 654 * Returns the {@link SBMLDocument} object containing <em>this</em> object instance. 655 * <p> 656 * LibSBML uses the class {@link SBMLDocument} as a top-level container for 657 * storing SBML content and data associated with it (such as warnings and 658 * error messages). An SBML model in libSBML is contained inside an 659 * {@link SBMLDocument} object. {@link SBMLDocument} corresponds roughly to the class 660 * <i>SBML</i> defined in the SBML Level 3 and Level 2 661 * specifications, but it does not have a direct correspondence in SBML 662 * Level 1. (But, it is created by libSBML no matter whether the 663 * model is Level 1, Level 2 or Level 3.) 664 * <p> 665 * This method allows the caller to obtain the {@link SBMLDocument} for the 666 * current object. 667 * <p> 668 * @return the parent {@link SBMLDocument} object of this SBML object. 669 * <p> 670 * @see #getParentSBMLObject() 671 * @see #getModel() 672 */ public 673 SBMLDocument getSBMLDocument() { 674 long cPtr = libsbmlJNI.SBase_getSBMLDocument__SWIG_0(swigCPtr, this); 675 return (cPtr == 0) ? null : new SBMLDocument(cPtr, false); 676 } 677 678 679/** 680 * Returns the parent SBML object containing this object. 681 * <p> 682 * This returns the immediately-containing object. This method is 683 * convenient when holding an object nested inside other objects in an 684 * SBML model. 685 * <p> 686 * @return the parent SBML object of this SBML object. 687 * <p> 688 * @see #getSBMLDocument() 689 * @see #getModel() 690 */ public 691 SBase getParentSBMLObject() { 692 return libsbml.DowncastSBase(libsbmlJNI.SBase_getParentSBMLObject__SWIG_0(swigCPtr, this), false); 693} 694 695 696/** 697 * Returns the first ancestor object that has the given SBML type code. 698 * <p> 699 * LibSBML attaches an identifying code to every 700 * kind of SBML object. These are known as <em>SBML type codes</em>. In 701 * other languages, the set of type codes is stored in an enumeration; in 702 * the Java language interface for libSBML, the type codes are defined as 703 * static integer constants in the interface class {@link 704 * libsbmlConstants}. The names of the type codes all begin with the 705 * characters <code>SBML_.</code> 706 * <p> 707 * This method searches the tree of objects that are parents of this 708 * object, and returns the first one that has the given SBML type code. 709 * If the optional argument <code>pkgName</code> is given, it will cause the search 710 * to be limited to the SBML Level 3 package given. 711 * <p> 712 * @param type the SBML type code of the object sought 713 * <p> 714 * @param pkgName (optional) the short name of an SBML Level 3 715 * package to which the sought-after object must belong 716 * <p> 717 * @return the ancestor SBML object of this SBML object that corresponds 718 * to the given SBML object type 719 * code, or <code>null</code> if no ancestor exists. 720 * <p> 721 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 722</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 723The native C++ implementation of this method defines a default argument 724value. In the documentation generated for different libSBML language 725bindings, you may or may not see corresponding arguments in the method 726declarations. For example, in Java and C#, a default argument is handled by 727declaring two separate methods, with one of them having the argument and 728the other one lacking the argument. However, the libSBML documentation will 729be <em>identical</em> for both methods. Consequently, if you are reading 730this and do not see an argument even though one is described, please look 731for descriptions of other variants of this method near where this one 732appears in the documentation. 733</dd></dl> 734 735 */ public 736 SBase getAncestorOfType(int type, String pkgName) { 737 return libsbml.DowncastSBase(libsbmlJNI.SBase_getAncestorOfType__SWIG_0(swigCPtr, this, type, pkgName), false); 738} 739 740 741/** 742 * Returns the first ancestor object that has the given SBML type code. 743 * <p> 744 * LibSBML attaches an identifying code to every 745 * kind of SBML object. These are known as <em>SBML type codes</em>. In 746 * other languages, the set of type codes is stored in an enumeration; in 747 * the Java language interface for libSBML, the type codes are defined as 748 * static integer constants in the interface class {@link 749 * libsbmlConstants}. The names of the type codes all begin with the 750 * characters <code>SBML_.</code> 751 * <p> 752 * This method searches the tree of objects that are parents of this 753 * object, and returns the first one that has the given SBML type code. 754 * If the optional argument <code>pkgName</code> is given, it will cause the search 755 * to be limited to the SBML Level 3 package given. 756 * <p> 757 * @param type the SBML type code of the object sought 758 * <p> 759 * @param pkgName (optional) the short name of an SBML Level 3 760 * package to which the sought-after object must belong 761 * <p> 762 * @return the ancestor SBML object of this SBML object that corresponds 763 * to the given SBML object type 764 * code, or <code>null</code> if no ancestor exists. 765 * <p> 766 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 767</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 768The native C++ implementation of this method defines a default argument 769value. In the documentation generated for different libSBML language 770bindings, you may or may not see corresponding arguments in the method 771declarations. For example, in Java and C#, a default argument is handled by 772declaring two separate methods, with one of them having the argument and 773the other one lacking the argument. However, the libSBML documentation will 774be <em>identical</em> for both methods. Consequently, if you are reading 775this and do not see an argument even though one is described, please look 776for descriptions of other variants of this method near where this one 777appears in the documentation. 778</dd></dl> 779 780 */ public 781 SBase getAncestorOfType(int type) { 782 return libsbml.DowncastSBase(libsbmlJNI.SBase_getAncestorOfType__SWIG_1(swigCPtr, this, type), false); 783} 784 785 786/** 787 * Returns the integer portion of the value of the 'sboTerm' attribute of 788 * this object. 789 * <p> 790 * Beginning with SBML Level 2 Version 3, objects derived from {@link SBase} have 791 * an optional attribute named 'sboTerm' for supporting the use of the 792 * Systems Biology Ontology. In SBML proper, the data type of the 793 * attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a 794 * seven digit integer number; libSBML simplifies the representation by 795 * only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 796 * 'sboTerm' attribute on {@link SBase} has data type <code>int</code>, and {@link SBO} identifiers 797 * are stored simply as integers. (For convenience, libSBML offers 798 * methods for returning both the integer form and a text-string form of 799 * the {@link SBO} identifier.) 800 * <p> 801 * {@link SBO} terms are a type of optional annotation, and each different class 802 * of SBML object derived from {@link SBase} imposes its own requirements about 803 * the values permitted for 'sboTerm'. Please consult the SBML 804 * Level 2 Version 4 specification for more information about 805 * the use of {@link SBO} and the 'sboTerm' attribute. 806 * <p> 807 * @return the value of the 'sboTerm' attribute as an integer, or <code>-1</code> 808 * if the value is not set. 809 */ public 810 int getSBOTerm() { 811 return libsbmlJNI.SBase_getSBOTerm(swigCPtr, this); 812 } 813 814 815/** 816 * Returns the string representation of the 'sboTerm' attribute of 817 * this object. 818 * <p> 819 * Beginning with SBML Level 2 Version 3, objects derived from {@link SBase} have 820 * an optional attribute named 'sboTerm' for supporting the use of the 821 * Systems Biology Ontology. In SBML proper, the data type of the 822 * attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a 823 * seven digit integer number; libSBML simplifies the representation by 824 * only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 825 * 'sboTerm' attribute on {@link SBase} has data type <code>int</code>, and {@link SBO} identifiers 826 * are stored simply as integers. This method returns the entire {@link SBO} 827 * identifier as a text string in the form 'SBO:NNNNNNN'. 828 * <p> 829 * {@link SBO} terms are a type of optional annotation, and each different class 830 * of SBML object derived from {@link SBase} imposes its own requirements about 831 * the values permitted for 'sboTerm'. Please consult the SBML 832 * Level 2 Version 4 specification for more information about 833 * the use of {@link SBO} and the 'sboTerm' attribute. 834 * <p> 835 * @return the value of the 'sboTerm' attribute as a string (its value 836 * will be of the form 'SBO:NNNNNNN'), or an empty string if 837 * the value is not set. 838 */ public 839 String getSBOTermID() { 840 return libsbmlJNI.SBase_getSBOTermID(swigCPtr, this); 841 } 842 843 844/** 845 * Returns the identifiers.org URL representation of the 'sboTerm' attribute of 846 * this object. 847 * <p> 848 * This method returns the entire {@link SBO} 849 * identifier as a text string in the form 850 * 'http://identifiers.org/biomodels.sbo/SBO:NNNNNNN'. 851 * <p> 852 * {@link SBO} terms are a type of optional annotation, and each different class 853 * of SBML object derived from {@link SBase} imposes its own requirements about 854 * the values permitted for 'sboTerm'. Please consult the SBML 855 * Level 2 Version 4 specification for more information about 856 * the use of {@link SBO} and the 'sboTerm' attribute. 857 * <p> 858 * @return the value of the 'sboTerm' attribute as an identifiers.org URL 859 * (its value will be of the form 860 * 'http://identifiers.org/biomodels.sbo/SBO:NNNNNNN'), or an empty string if 861 * the value is not set. 862 */ public 863 String getSBOTermAsURL() { 864 return libsbmlJNI.SBase_getSBOTermAsURL(swigCPtr, this); 865 } 866 867 868/** 869 * Returns the line number on which this object first appears in the XML 870 * representation of the SBML document. 871 * <p> 872 * @return the line number of this SBML object. 873 * <p> 874 * @note The line number for each construct in an SBML model is set upon 875 * reading the model. The accuracy of the line number depends on the 876 * correctness of the XML representation of the model, and on the 877 * particular XML parser library being used. The former limitation 878 * relates to the following problem: if the model is actually invalid 879 * XML, then the parser may not be able to interpret the data correctly 880 * and consequently may not be able to establish the real line number. 881 * The latter limitation is simply that different parsers seem to have 882 * their own accuracy limitations, and out of all the parsers supported 883 * by libSBML, none have been 100% accurate in all situations. (At this 884 * time, libSBML supports the use of <a target='_blank' 885 * href='http://xmlsoft.org'>libxml2</a>, <a target='_blank' 886 * href='http://expat.sourceforge.net/'>Expat</a> and <a target='_blank' 887 * href='http://xerces.apache.org/xerces-c/'>Xerces</a>.) 888 * <p> 889 * @see #getColumn() 890 */ public 891 long getLine() { 892 return libsbmlJNI.SBase_getLine(swigCPtr, this); 893 } 894 895 896/** 897 * Returns the column number on which this object first appears in the XML 898 * representation of the SBML document. 899 * <p> 900 * @return the column number of this SBML object. 901 * <p> 902 * @note The column number for each construct in an SBML model is set 903 * upon reading the model. The accuracy of the column number depends on 904 * the correctness of the XML representation of the model, and on the 905 * particular XML parser library being used. The former limitation 906 * relates to the following problem: if the model is actually invalid 907 * XML, then the parser may not be able to interpret the data correctly 908 * and consequently may not be able to establish the real column number. 909 * The latter limitation is simply that different parsers seem to have 910 * their own accuracy limitations, and out of all the parsers supported 911 * by libSBML, none have been 100% accurate in all situations. (At this 912 * time, libSBML supports the use of <a target='_blank' 913 * href='http://xmlsoft.org'>libxml2</a>, <a target='_blank' 914 * href='http://expat.sourceforge.net/'>Expat</a> and <a target='_blank' 915 * href='http://xerces.apache.org/xerces-c/'>Xerces</a>.) 916 * <p> 917 * @see #getLine() 918 */ public 919 long getColumn() { 920 return libsbmlJNI.SBase_getColumn(swigCPtr, this); 921 } 922 923 924/** 925 * Returns the {@link ModelHistory} object, if any, attached to this object. 926 * <p> 927 * @return the {@link ModelHistory} object attached to this object, or <code>null</code> if 928 * none exist. 929 * <p> 930 * @note In SBML Level 2, model history annotations were only 931 * permitted on the {@link Model} element. In SBML Level 3, they are 932 * permitted on all SBML components derived from {@link SBase}. 933 */ public 934 ModelHistory getModelHistory() { 935 long cPtr = libsbmlJNI.SBase_getModelHistory__SWIG_0(swigCPtr, this); 936 return (cPtr == 0) ? null : new ModelHistory(cPtr, false); 937 } 938 939 940/** 941 * Predicate returning <code>true</code> if this object's 'metaid' attribute is set. 942 * <p> 943 * The optional attribute named 'metaid', present on every major SBML 944 * component type, is for supporting metadata annotations using RDF 945 * (Resource Description Format). The attribute value has the data type 946 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 947 * identifier type, which means each 'metaid' value must be globally 948 * unique within an SBML file. (Importantly, this uniqueness criterion 949 * applies across any attribute with type <a 950 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 951 * 'metaid' attribute used by SBML—something to be aware of if your 952 * application-specific XML content inside the 'annotation' subelement 953 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 954 * The 'metaid' value serves to identify a model component for purposes 955 * such as referencing that component from metadata placed within 956 * 'annotation' subelements. 957 * <p> 958 * @return <code>true</code> if the 'metaid' attribute of this SBML object is 959 * set, <code>false</code> otherwise. 960 * <p> 961 * @see #getMetaId() 962 * @see #setMetaId(String metaid) 963 */ public 964 boolean isSetMetaId() { 965 return libsbmlJNI.SBase_isSetMetaId(swigCPtr, this); 966 } 967 968 969/** 970 * Predicate returning <code>true</code> if this object's 'metaid' attribute is set. 971 * <p> 972 * The optional attribute named 'metaid', present on every major SBML 973 * component type, is for supporting metadata annotations using RDF 974 * (Resource Description Format). The attribute value has the data type 975 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 976 * identifier type, which means each 'metaid' value must be globally 977 * unique within an SBML file. (Importantly, this uniqueness criterion 978 * applies across any attribute with type <a 979 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 980 * 'metaid' attribute used by SBML—something to be aware of if your 981 * application-specific XML content inside the 'annotation' subelement 982 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 983 * The 'metaid' value serves to identify a model component for purposes 984 * such as referencing that component from metadata placed within 985 * 'annotation' subelements. 986 * <p> 987 * @return <code>true</code> if the 'metaid' attribute of this SBML object is 988 * set, <code>false</code> otherwise. 989 * <p> 990 * @see #getMetaId() 991 * @see #setMetaId(String metaid) 992 * @internal 993 */ public 994 boolean isSetId() { 995 return libsbmlJNI.SBase_isSetId(swigCPtr, this); 996 } 997 998 999/** 1000 * Predicate returning <code>true</code> if this object's 'metaid' attribute is set. 1001 * <p> 1002 * The optional attribute named 'metaid', present on every major SBML 1003 * component type, is for supporting metadata annotations using RDF 1004 * (Resource Description Format). The attribute value has the data type 1005 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 1006 * identifier type, which means each 'metaid' value must be globally 1007 * unique within an SBML file. (Importantly, this uniqueness criterion 1008 * applies across any attribute with type <a 1009 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 1010 * 'metaid' attribute used by SBML—something to be aware of if your 1011 * application-specific XML content inside the 'annotation' subelement 1012 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 1013 * The 'metaid' value serves to identify a model component for purposes 1014 * such as referencing that component from metadata placed within 1015 * 'annotation' subelements. 1016 * <p> 1017 * @return <code>true</code> if the 'metaid' attribute of this SBML object is 1018 * set, <code>false</code> otherwise. 1019 * <p> 1020 * @see #getMetaId() 1021 * @see #setMetaId(String metaid) 1022 * @internal 1023 */ public 1024 boolean isSetName() { 1025 return libsbmlJNI.SBase_isSetName(swigCPtr, this); 1026 } 1027 1028 1029/** 1030 * Predicate returning <code>true</code> if this 1031 * object's 'notes' subelement exists and has content. 1032 * <p> 1033 * The optional SBML element named 'notes', present on every major SBML 1034 * component type, is intended as a place for storing optional 1035 * information intended to be seen by humans. An example use of the 1036 * 'notes' element would be to contain formatted user comments about the 1037 * model element in which the 'notes' element is enclosed. Every object 1038 * derived directly or indirectly from type {@link SBase} can have a separate 1039 * value for 'notes', allowing users considerable freedom when adding 1040 * comments to their models. 1041 * <p> 1042 * The format of 'notes' elements must be <a target='_blank' 1043 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 1044 * verify the formatting of 'notes' content, libSBML provides the static 1045 * utility method {@link SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml)}; however, 1046 * readers are urged to consult the appropriate <a target='_blank' 1047 * href='http://sbml.org/Documents/Specifications'>SBML specification 1048 * document</a> for the Level and Version of their model for more 1049 * in-depth explanations. The SBML Level 2 and 3 1050 * specifications have considerable detail about how 'notes' element 1051 * content must be structured. 1052 * <p> 1053 * @return <code>true</code> if a 'notes' subelement exists, <code>false</code> otherwise. 1054 * <p> 1055 * @see #getNotes() 1056 * @see #getNotesString() 1057 * @see #setNotes(XMLNode notes) 1058 * @see #setNotes(String notes) 1059 * @see #appendNotes(XMLNode notes) 1060 * @see #appendNotes(String notes) 1061 * @see #unsetNotes() 1062 * @see SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml) 1063 */ public 1064 boolean isSetNotes() { 1065 return libsbmlJNI.SBase_isSetNotes(swigCPtr, this); 1066 } 1067 1068 1069/** 1070 * Predicate returning <code>true</code> if this 1071 * object's 'annotation' subelement exists and has content. 1072 * <p> 1073 * Whereas the {@link SBase} 'notes' subelement is a container for content to be 1074 * shown directly to humans, the 'annotation' element is a container for 1075 * optional software-generated content <em>not</em> meant to be shown to 1076 * humans. Every object derived from {@link SBase} can have its own value for 1077 * 'annotation'. The element's content type is <a target='_blank' 1078 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 1079 * 'any'</a>, allowing essentially arbitrary well-formed XML data 1080 * content. 1081 * <p> 1082 * SBML places a few restrictions on the organization of the content of 1083 * annotations; these are intended to help software tools read and write 1084 * the data as well as help reduce conflicts between annotations added by 1085 * different tools. Please see the SBML specifications for more details. 1086 * <p> 1087 * @return <code>true</code> if a 'annotation' subelement exists, <code>false</code> 1088 * otherwise. 1089 * <p> 1090 * @see #getAnnotation() 1091 * @see #getAnnotationString() 1092 * @see #setAnnotation(XMLNode annotation) 1093 * @see #setAnnotation(String annotation) 1094 * @see #appendAnnotation(XMLNode annotation) 1095 * @see #appendAnnotation(String annotation) 1096 * @see #unsetAnnotation() 1097 */ public 1098 boolean isSetAnnotation() { 1099 return libsbmlJNI.SBase_isSetAnnotation(swigCPtr, this); 1100 } 1101 1102 1103/** 1104 * Predicate returning <code>true</code> if this 1105 * object's 'sboTerm' attribute is set. 1106 * <p> 1107 * @return <code>true</code> if the 'sboTerm' attribute of this SBML object is 1108 * set, <code>false</code> otherwise. 1109 */ public 1110 boolean isSetSBOTerm() { 1111 return libsbmlJNI.SBase_isSetSBOTerm(swigCPtr, this); 1112 } 1113 1114 1115/** 1116 * Sets the value of the 'metaid' attribute of this object. 1117 * <p> 1118 * The string <code>metaid</code> is copied. The value of <code>metaid</code> must be an 1119 * identifier conforming to the syntax defined by the XML 1.0 data type 1120 * <a href='http://www.w3.org/TR/REC-xml/#id'>ID</a>. Among other 1121 * things, this type requires that a value is unique among all the values 1122 * of type XML ID in an {@link SBMLDocument}. Although SBML only uses <a 1123 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a> for the 'metaid' 1124 * attribute, callers should be careful if they use 1125 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>'s in XML 1126 * portions of a model that are not defined by SBML, such as in the 1127 * application-specific content of the 'annotation' subelement. 1128 * <p> 1129 * @param metaid the identifier string to use as the value of the 1130 * 'metaid' attribute 1131 * <p> 1132 * @return integer value indicating success/failure of the 1133 * function. The possible values returned by this function are: 1134 * <ul> 1135 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1136 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 1137 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 1138 * </ul> 1139 * <p> 1140 * @see #getMetaId() 1141 * @see #isSetMetaId() 1142 */ public 1143 int setMetaId(String metaid) { 1144 return libsbmlJNI.SBase_setMetaId(swigCPtr, this, metaid); 1145 } 1146 1147 1148/** 1149 * Predicate returning <code>true</code> if this 1150 * object has a {@link ModelHistory} object attached to it. 1151 * <p> 1152 * @return <code>true</code> if the {@link ModelHistory} of this object is set, 1153 * <code>false</code> otherwise. 1154 * <p> 1155 * @note In SBML Level 2, model history annotations were only 1156 * permitted on the {@link Model} element. In SBML Level 3, they are 1157 * permitted on all SBML components derived from {@link SBase}. 1158 */ public 1159 boolean isSetModelHistory() { 1160 return libsbmlJNI.SBase_isSetModelHistory(swigCPtr, this); 1161 } 1162 1163 1164/** 1165 * Predicate returning <code>true</code> if this 1166 * object has a {@link ModelHistory} object attached to it. 1167 * <p> 1168 * @return <code>true</code> if the {@link ModelHistory} of this object is set, 1169 * <code>false</code> otherwise. 1170 * <p> 1171 * @note In SBML Level 2, model history annotations were only 1172 * permitted on the {@link Model} element. In SBML Level 3, they are 1173 * permitted on all SBML components derived from {@link SBase}. 1174 * @internal 1175 */ public 1176 int setId(String sid) { 1177 return libsbmlJNI.SBase_setId(swigCPtr, this, sid); 1178 } 1179 1180 1181/** 1182 * Predicate returning <code>true</code> if this 1183 * object has a {@link ModelHistory} object attached to it. 1184 * <p> 1185 * @return <code>true</code> if the {@link ModelHistory} of this object is set, 1186 * <code>false</code> otherwise. 1187 * <p> 1188 * @note In SBML Level 2, model history annotations were only 1189 * permitted on the {@link Model} element. In SBML Level 3, they are 1190 * permitted on all SBML components derived from {@link SBase}. 1191 * @internal 1192 */ public 1193 int setName(String name) { 1194 return libsbmlJNI.SBase_setName(swigCPtr, this, name); 1195 } 1196 1197 1198/** 1199 * Sets the value of the 'annotation' subelement of this SBML object. 1200 * <p> 1201 * The content of <code>annotation</code> is copied, and any previous content of 1202 * this object's 'annotation' subelement is deleted. 1203 * <p> 1204 * Whereas the {@link SBase} 'notes' subelement is a container for content to be 1205 * shown directly to humans, the 'annotation' element is a container for 1206 * optional software-generated content <em>not</em> meant to be shown to 1207 * humans. Every object derived from {@link SBase} can have its own value for 1208 * 'annotation'. The element's content type is <a target='_blank' 1209 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 1210 * 'any'</a>, allowing essentially arbitrary well-formed XML data 1211 * content. 1212 * <p> 1213 * SBML places a few restrictions on the organization of the content of 1214 * annotations; these are intended to help software tools read and write 1215 * the data as well as help reduce conflicts between annotations added by 1216 * different tools. Please see the SBML specifications for more details. 1217 * <p> 1218 * Call this method will result in any existing content of the 1219 * 'annotation' subelement to be discarded. Unless you have taken steps 1220 * to first copy and reconstitute any existing annotations into the 1221 * <code>annotation</code> that is about to be assigned, it is likely that performing 1222 * such wholesale replacement is unfriendly towards other software 1223 * applications whose annotations are discarded. An alternative may be 1224 * to use {@link SBase#appendAnnotation(XMLNode annotation)} or 1225 * {@link SBase#appendAnnotation(String annotation)}. 1226 * <p> 1227 * @param annotation an XML structure that is to be used as the new content 1228 * of the 'annotation' subelement of this object 1229 * <p> 1230 * @return integer value indicating success/failure of the 1231 * function. The possible values returned by this function are: 1232 * <ul> 1233 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1234 * </ul> 1235 * <p> 1236 * @see #getAnnotationString() 1237 * @see #isSetAnnotation() 1238 * @see #setAnnotation(String annotation) 1239 * @see #appendAnnotation(XMLNode annotation) 1240 * @see #appendAnnotation(String annotation) 1241 * @see #unsetAnnotation() 1242 */ public 1243 int setAnnotation(XMLNode annotation) { 1244 return libsbmlJNI.SBase_setAnnotation__SWIG_0(swigCPtr, this, XMLNode.getCPtr(annotation), annotation); 1245 } 1246 1247 1248/** 1249 * Sets the value of the 'annotation' subelement of this SBML object. 1250 * <p> 1251 * The content of <code>annotation</code> is copied, and any previous content of 1252 * this object's 'annotation' subelement is deleted. 1253 * <p> 1254 * Whereas the {@link SBase} 'notes' subelement is a container for content to be 1255 * shown directly to humans, the 'annotation' element is a container for 1256 * optional software-generated content <em>not</em> meant to be shown to 1257 * humans. Every object derived from {@link SBase} can have its own value for 1258 * 'annotation'. The element's content type is <a target='_blank' 1259 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 1260 * 'any'</a>, allowing essentially arbitrary well-formed XML data 1261 * content. 1262 * <p> 1263 * SBML places a few restrictions on the organization of the content of 1264 * annotations; these are intended to help software tools read and write 1265 * the data as well as help reduce conflicts between annotations added by 1266 * different tools. Please see the SBML specifications for more details. 1267 * <p> 1268 * Call this method will result in any existing content of the 1269 * 'annotation' subelement to be discarded. Unless you have taken steps 1270 * to first copy and reconstitute any existing annotations into the 1271 * <code>annotation</code> that is about to be assigned, it is likely that performing 1272 * such wholesale replacement is unfriendly towards other software 1273 * applications whose annotations are discarded. An alternative may be 1274 * to use {@link SBase#appendAnnotation(XMLNode annotation)} or 1275 * {@link SBase#appendAnnotation(String annotation)}. 1276 * <p> 1277 * @param annotation an XML string that is to be used as the content 1278 * of the 'annotation' subelement of this object 1279 * <p> 1280 * @return integer value indicating success/failure of the 1281 * function. The possible values returned by this function are: 1282 * <ul> 1283 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1284 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1285 * </ul> 1286 * <p> 1287 * @see #getAnnotationString() 1288 * @see #isSetAnnotation() 1289 * @see #setAnnotation(XMLNode annotation) 1290 * @see #appendAnnotation(XMLNode annotation) 1291 * @see #appendAnnotation(String annotation) 1292 * @see #unsetAnnotation() 1293 */ public 1294 int setAnnotation(String annotation) { 1295 return libsbmlJNI.SBase_setAnnotation__SWIG_1(swigCPtr, this, annotation); 1296 } 1297 1298 1299/** 1300 * Appends the given <code>annotation</code> to the 'annotation' subelement of this 1301 * object. 1302 * <p> 1303 * Whereas the {@link SBase} 'notes' subelement is a container for content to be 1304 * shown directly to humans, the 'annotation' element is a container for 1305 * optional software-generated content <em>not</em> meant to be shown to 1306 * humans. Every object derived from {@link SBase} can have its own value for 1307 * 'annotation'. The element's content type is <a 1308 * target='_blank' 1309 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 'any'</a>, 1310 * allowing essentially arbitrary well-formed XML data content. 1311 * <p> 1312 * SBML places a few restrictions on the organization of the content of 1313 * annotations; these are intended to help software tools read and write 1314 * the data as well as help reduce conflicts between annotations added by 1315 * different tools. Please see the SBML specifications for more details. 1316 * <p> 1317 * Unlike {@link SBase#setAnnotation(XMLNode annotation)} or 1318 * {@link SBase#setAnnotation(String annotation)}, this method 1319 * allows other annotations to be preserved when an application adds its 1320 * own data. 1321 * <p> 1322 * @param annotation an XML structure that is to be copied and appended 1323 * to the content of the 'annotation' subelement of this object 1324 * <p> 1325 * @return integer value indicating success/failure of the 1326 * function. The possible values returned by this function are: 1327 * <ul> 1328 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1329 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1330 * </ul> 1331 * <p> 1332 * @see #getAnnotationString() 1333 * @see #isSetAnnotation() 1334 * @see #setAnnotation(XMLNode annotation) 1335 * @see #setAnnotation(String annotation) 1336 * @see #appendAnnotation(String annotation) 1337 * @see #unsetAnnotation() 1338 */ public 1339 int appendAnnotation(XMLNode annotation) { 1340 return libsbmlJNI.SBase_appendAnnotation__SWIG_0(swigCPtr, this, XMLNode.getCPtr(annotation), annotation); 1341 } 1342 1343 1344/** 1345 * Appends the given <code>annotation</code> to the 'annotation' subelement of this 1346 * object. 1347 * <p> 1348 * Whereas the {@link SBase} 'notes' subelement is a container for content to be 1349 * shown directly to humans, the 'annotation' element is a container for 1350 * optional software-generated content <em>not</em> meant to be shown to 1351 * humans. Every object derived from {@link SBase} can have its own value for 1352 * 'annotation'. The element's content type is <a 1353 * target='_blank' 1354 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 'any'</a>, 1355 * allowing essentially arbitrary well-formed XML data content. 1356 * <p> 1357 * SBML places a few restrictions on the organization of the content of 1358 * annotations; these are intended to help software tools read and write 1359 * the data as well as help reduce conflicts between annotations added by 1360 * different tools. Please see the SBML specifications for more details. 1361 * <p> 1362 * Unlike {@link SBase#setAnnotation(XMLNode annotation)} or 1363 * {@link SBase#setAnnotation(String annotation)}, this method 1364 * allows other annotations to be preserved when an application adds its 1365 * own data. 1366 * <p> 1367 * @param annotation an XML string that is to be copied and appended 1368 * to the content of the 'annotation' subelement of this object 1369 * <p> 1370 * @return integer value indicating success/failure of the 1371 * function. The possible values returned by this function are: 1372 * <ul> 1373 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1374 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1375 * </ul> 1376 * <p> 1377 * @see #getAnnotationString() 1378 * @see #isSetAnnotation() 1379 * @see #setAnnotation(XMLNode annotation) 1380 * @see #setAnnotation(String annotation) 1381 * @see #appendAnnotation(XMLNode annotation) 1382 * @see #unsetAnnotation() 1383 */ public 1384 int appendAnnotation(String annotation) { 1385 return libsbmlJNI.SBase_appendAnnotation__SWIG_1(swigCPtr, this, annotation); 1386 } 1387 1388 1389/** 1390 * Removes the top-level element within the 'annotation' subelement of this 1391 * SBML object with the given name and optional URI. 1392 * <p> 1393 * SBML places a few restrictions on the organization of the content of 1394 * annotations; these are intended to help software tools read and write 1395 * the data as well as help reduce conflicts between annotations added by 1396 * different tools. Please see the SBML specifications for more details. 1397 * <p> 1398 * Calling this method allows a particular annotation element to be removed 1399 * whilst the remaining annotations remain intact. 1400 * <p> 1401 * @param elementName a string representing the name of the top level 1402 * annotation element that is to be removed 1403 * @param elementURI an optional string that is used to check both the name 1404 * and URI of the top level element to be removed 1405 * <p> 1406 * @return integer value indicating success/failure of the 1407 * function. The possible values returned by this function are: 1408 * <ul> 1409 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1410 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1411 * <li> {@link libsbmlConstants#LIBSBML_ANNOTATION_NAME_NOT_FOUND LIBSBML_ANNOTATION_NAME_NOT_FOUND } 1412 * <li> {@link libsbmlConstants#LIBSBML_ANNOTATION_NS_NOT_FOUND LIBSBML_ANNOTATION_NS_NOT_FOUND } 1413 * </ul> 1414 * <p> 1415 * @see #replaceTopLevelAnnotationElement(XMLNode ) 1416 * @see #replaceTopLevelAnnotationElement(String) 1417 */ public 1418 int removeTopLevelAnnotationElement(String elementName, String elementURI) { 1419 return libsbmlJNI.SBase_removeTopLevelAnnotationElement__SWIG_0(swigCPtr, this, elementName, elementURI); 1420 } 1421 1422 1423/** 1424 * Removes the top-level element within the 'annotation' subelement of this 1425 * SBML object with the given name and optional URI. 1426 * <p> 1427 * SBML places a few restrictions on the organization of the content of 1428 * annotations; these are intended to help software tools read and write 1429 * the data as well as help reduce conflicts between annotations added by 1430 * different tools. Please see the SBML specifications for more details. 1431 * <p> 1432 * Calling this method allows a particular annotation element to be removed 1433 * whilst the remaining annotations remain intact. 1434 * <p> 1435 * @param elementName a string representing the name of the top level 1436 * annotation element that is to be removed 1437 * @param elementURI an optional string that is used to check both the name 1438 * and URI of the top level element to be removed 1439 * <p> 1440 * @return integer value indicating success/failure of the 1441 * function. The possible values returned by this function are: 1442 * <ul> 1443 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1444 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1445 * <li> {@link libsbmlConstants#LIBSBML_ANNOTATION_NAME_NOT_FOUND LIBSBML_ANNOTATION_NAME_NOT_FOUND } 1446 * <li> {@link libsbmlConstants#LIBSBML_ANNOTATION_NS_NOT_FOUND LIBSBML_ANNOTATION_NS_NOT_FOUND } 1447 * </ul> 1448 * <p> 1449 * @see #replaceTopLevelAnnotationElement(XMLNode ) 1450 * @see #replaceTopLevelAnnotationElement(String) 1451 */ public 1452 int removeTopLevelAnnotationElement(String elementName) { 1453 return libsbmlJNI.SBase_removeTopLevelAnnotationElement__SWIG_1(swigCPtr, this, elementName); 1454 } 1455 1456 1457/** 1458 * Replaces the given top-level element within the 'annotation' 1459 * subelement of this SBML object and with the annotation element supplied. 1460 * <p> 1461 * SBML places a few restrictions on the organization of the content of 1462 * annotations; these are intended to help software tools read and write 1463 * the data as well as help reduce conflicts between annotations added by 1464 * different tools. Please see the SBML specifications for more details. 1465 * <p> 1466 * This method determines the name of the element to be replaced from the 1467 * annotation argument. Functionally it is equivalent to calling 1468 * <code> removeTopLevelAnnotationElement(name); appendAnnotation(annotation_with_name); 1469 * </code> with the exception that the placement of the annotation element remains 1470 * the same. 1471 * <p> 1472 * @param annotation {@link XMLNode} representing the replacement top level annotation 1473 * <p> 1474 * @return integer value indicating success/failure of the 1475 * function. The possible values returned by this function are: 1476 * <ul> 1477 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1478 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1479 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 1480 * </ul> 1481 * <p> 1482 * @see #removeTopLevelAnnotationElement(String elementName, String elementURI) 1483 * @see #replaceTopLevelAnnotationElement(String) 1484 */ public 1485 int replaceTopLevelAnnotationElement(XMLNode annotation) { 1486 return libsbmlJNI.SBase_replaceTopLevelAnnotationElement__SWIG_0(swigCPtr, this, XMLNode.getCPtr(annotation), annotation); 1487 } 1488 1489 1490/** 1491 * Replaces the given top-level element within the 'annotation' 1492 * subelement of this SBML object and with the annotation element supplied. 1493 * <p> 1494 * SBML places a few restrictions on the organization of the content of 1495 * annotations; these are intended to help software tools read and write 1496 * the data as well as help reduce conflicts between annotations added by 1497 * different tools. Please see the SBML specifications for more details. 1498 * <p> 1499 * This method determines the name of the element to be replaced from the 1500 * annotation argument. Functionally it is equivalent to calling 1501 * <code> removeTopLevelAnnotationElement(name); appendAnnotation(annotation_with_name); 1502 * </code> with the exception that the placement of the annotation element remains 1503 * the same. 1504 * <p> 1505 * @param annotation string representing the replacement top level annotation 1506 * <p> 1507 * @return integer value indicating success/failure of the 1508 * function. The possible values returned by this function are: 1509 * <ul> 1510 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1511 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1512 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 1513 * </ul> 1514 * <p> 1515 * @see #removeTopLevelAnnotationElement(String elementName, String elementURI) 1516 * @see #replaceTopLevelAnnotationElement(XMLNode) 1517 */ public 1518 int replaceTopLevelAnnotationElement(String annotation) { 1519 return libsbmlJNI.SBase_replaceTopLevelAnnotationElement__SWIG_1(swigCPtr, this, annotation); 1520 } 1521 1522 1523/** 1524 * Sets the value of the 'notes' subelement of this SBML object. 1525 * <p> 1526 * The content of <code>notes</code> is copied, and any existing content of this 1527 * object's 'notes' subelement is deleted. 1528 * <p> 1529 * The optional SBML element named 'notes', present on every major SBML 1530 * component type, is intended as a place for storing optional 1531 * information intended to be seen by humans. An example use of the 1532 * 'notes' element would be to contain formatted user comments about the 1533 * model element in which the 'notes' element is enclosed. Every object 1534 * derived directly or indirectly from type {@link SBase} can have a separate 1535 * value for 'notes', allowing users considerable freedom when adding 1536 * comments to their models. 1537 * <p> 1538 * The format of 'notes' elements must be <a target='_blank' 1539 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 1540 * verify the formatting of 'notes' content, libSBML provides the static 1541 * utility method {@link SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml)}; however, 1542 * readers are urged to consult the appropriate <a target='_blank' 1543 * href='http://sbml.org/Documents/Specifications'>SBML specification 1544 * document</a> for the Level and Version of their model for more 1545 * in-depth explanations. The SBML Level 2 and 3 1546 * specifications have considerable detail about how 'notes' element 1547 * content must be structured. 1548 * <p> 1549 * @param notes an XML structure that is to be used as the content of the 1550 * 'notes' subelement of this object 1551 * <p> 1552 * @return integer value indicating success/failure of the 1553 * function. The possible values returned by this function are: 1554 * <ul> 1555 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1556 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 1557 * </ul> 1558 * <p> 1559 * @see #getNotesString() 1560 * @see #isSetNotes() 1561 * @see #setNotes(String notes) 1562 * @see #appendNotes(XMLNode notes) 1563 * @see #appendNotes(String notes) 1564 * @see #unsetNotes() 1565 * @see SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml) 1566 */ public 1567 int setNotes(XMLNode notes) { 1568 return libsbmlJNI.SBase_setNotes__SWIG_0(swigCPtr, this, XMLNode.getCPtr(notes), notes); 1569 } 1570 1571 1572/** 1573 * Sets the value of the 'notes' subelement of this SBML object to a copy 1574 * of the string <code>notes</code>. 1575 * <p> 1576 * The content of <code>notes</code> is copied, and any existing content of this 1577 * object's 'notes' subelement is deleted. 1578 * <p> 1579 * The optional SBML element named 'notes', present on every major SBML 1580 * component type, is intended as a place for storing optional 1581 * information intended to be seen by humans. An example use of the 1582 * 'notes' element would be to contain formatted user comments about the 1583 * model element in which the 'notes' element is enclosed. Every object 1584 * derived directly or indirectly from type {@link SBase} can have a separate 1585 * value for 'notes', allowing users considerable freedom when adding 1586 * comments to their models. 1587 * <p> 1588 * The format of 'notes' elements must be <a target='_blank' 1589 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 1590 * verify the formatting of 'notes' content, libSBML provides the static 1591 * utility method {@link SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml)}; however, 1592 * readers are urged to consult the appropriate <a target='_blank' 1593 * href='http://sbml.org/Documents/Specifications'>SBML specification 1594 * document</a> for the Level and Version of their model for more 1595 * in-depth explanations. The SBML Level 2 and 3 1596 * specifications have considerable detail about how 'notes' element 1597 * content must be structured. 1598 * <p> 1599 * The following code illustrates a very simple way of setting the notes 1600 * using this method. Here, the object being annotated is the whole SBML 1601 * document, but that is for illustration purposes only; you could of 1602 * course use this same approach to annotate any other SBML component. 1603 * <div class='fragment'><pre> 1604{@link SBMLDocument} s = new {@link SBMLDocument}(3, 1); 1605s.setNotes('<body xmlns='http://www.w3.org/1999/xhtml'>here is my note</p></body>'); 1606</pre></div> 1607 * <p> 1608 * <p> 1609 * @param notes an XML string that is to be used as the content of the 1610 * 'notes' subelement of this object 1611 * <p> 1612 * @param addXHTMLMarkup a boolean indicating whether to wrap the contents 1613 * of the <code>notes</code> argument with XHTML paragraph (<code><p></code>) 1614 * tags. This is appropriate when the string in <code>notes</code> does not already 1615 * containg the appropriate XHTML markup. 1616 * <p> 1617 * @return integer value indicating success/failure of the 1618 * function. The possible values returned by this function are: 1619 * <ul> 1620 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1621 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 1622 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1623 * </ul> 1624 * <p> 1625 * @see #getNotesString() 1626 * @see #isSetNotes() 1627 * @see #setNotes(XMLNode notes) 1628 * @see #appendNotes(XMLNode notes) 1629 * @see #appendNotes(String notes) 1630 * @see #unsetNotes() 1631 * @see SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml) 1632 */ public 1633 int setNotes(String notes, boolean addXHTMLMarkup) { 1634 return libsbmlJNI.SBase_setNotes__SWIG_1(swigCPtr, this, notes, addXHTMLMarkup); 1635 } 1636 1637 1638/** 1639 * Sets the value of the 'notes' subelement of this SBML object to a copy 1640 * of the string <code>notes</code>. 1641 * <p> 1642 * The content of <code>notes</code> is copied, and any existing content of this 1643 * object's 'notes' subelement is deleted. 1644 * <p> 1645 * The optional SBML element named 'notes', present on every major SBML 1646 * component type, is intended as a place for storing optional 1647 * information intended to be seen by humans. An example use of the 1648 * 'notes' element would be to contain formatted user comments about the 1649 * model element in which the 'notes' element is enclosed. Every object 1650 * derived directly or indirectly from type {@link SBase} can have a separate 1651 * value for 'notes', allowing users considerable freedom when adding 1652 * comments to their models. 1653 * <p> 1654 * The format of 'notes' elements must be <a target='_blank' 1655 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 1656 * verify the formatting of 'notes' content, libSBML provides the static 1657 * utility method {@link SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml)}; however, 1658 * readers are urged to consult the appropriate <a target='_blank' 1659 * href='http://sbml.org/Documents/Specifications'>SBML specification 1660 * document</a> for the Level and Version of their model for more 1661 * in-depth explanations. The SBML Level 2 and 3 1662 * specifications have considerable detail about how 'notes' element 1663 * content must be structured. 1664 * <p> 1665 * The following code illustrates a very simple way of setting the notes 1666 * using this method. Here, the object being annotated is the whole SBML 1667 * document, but that is for illustration purposes only; you could of 1668 * course use this same approach to annotate any other SBML component. 1669 * <div class='fragment'><pre> 1670{@link SBMLDocument} s = new {@link SBMLDocument}(3, 1); 1671s.setNotes('<body xmlns='http://www.w3.org/1999/xhtml'>here is my note</p></body>'); 1672</pre></div> 1673 * <p> 1674 * <p> 1675 * @param notes an XML string that is to be used as the content of the 1676 * 'notes' subelement of this object 1677 * <p> 1678 * @param addXHTMLMarkup a boolean indicating whether to wrap the contents 1679 * of the <code>notes</code> argument with XHTML paragraph (<code><p></code>) 1680 * tags. This is appropriate when the string in <code>notes</code> does not already 1681 * containg the appropriate XHTML markup. 1682 * <p> 1683 * @return integer value indicating success/failure of the 1684 * function. The possible values returned by this function are: 1685 * <ul> 1686 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1687 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 1688 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1689 * </ul> 1690 * <p> 1691 * @see #getNotesString() 1692 * @see #isSetNotes() 1693 * @see #setNotes(XMLNode notes) 1694 * @see #appendNotes(XMLNode notes) 1695 * @see #appendNotes(String notes) 1696 * @see #unsetNotes() 1697 * @see SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml) 1698 */ public 1699 int setNotes(String notes) { 1700 return libsbmlJNI.SBase_setNotes__SWIG_2(swigCPtr, this, notes); 1701 } 1702 1703 1704/** 1705 * Appends the given <code>notes</code> to the 'notes' subelement of this object. 1706 * <p> 1707 * The content of <code>notes</code> is copied. 1708 * <p> 1709 * The optional SBML element named 'notes', present on every major SBML 1710 * component type, is intended as a place for storing optional 1711 * information intended to be seen by humans. An example use of the 1712 * 'notes' element would be to contain formatted user comments about the 1713 * model element in which the 'notes' element is enclosed. Every object 1714 * derived directly or indirectly from type {@link SBase} can have a separate 1715 * value for 'notes', allowing users considerable freedom when adding 1716 * comments to their models. 1717 * <p> 1718 * The format of 'notes' elements must be <a target='_blank' 1719 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 1720 * verify the formatting of 'notes' content, libSBML provides the static 1721 * utility method {@link SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml)}; however, 1722 * readers are urged to consult the appropriate <a target='_blank' 1723 * href='http://sbml.org/Documents/Specifications'>SBML specification 1724 * document</a> for the Level and Version of their model for more 1725 * in-depth explanations. The SBML Level 2 and 3 1726 * specifications have considerable detail about how 'notes' element 1727 * content must be structured. 1728 * <p> 1729 * @param notes an XML node structure that is to appended to the content 1730 * of the 'notes' subelement of this object 1731 * <p> 1732 * @return integer value indicating success/failure of the 1733 * function. The possible values returned by this function are: 1734 * <ul> 1735 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1736 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 1737 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1738 * </ul> 1739 * <p> 1740 * @see #getNotesString() 1741 * @see #isSetNotes() 1742 * @see #setNotes(XMLNode notes) 1743 * @see #setNotes(String notes) 1744 * @see #appendNotes(String notes) 1745 * @see #unsetNotes() 1746 * @see SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml) 1747 */ public 1748 int appendNotes(XMLNode notes) { 1749 return libsbmlJNI.SBase_appendNotes__SWIG_0(swigCPtr, this, XMLNode.getCPtr(notes), notes); 1750 } 1751 1752 1753/** 1754 * Appends the given <code>notes</code> to the 'notes' subelement of this object. 1755 * <p> 1756 * The content of the parameter <code>notes</code> is copied. 1757 * <p> 1758 * The optional SBML element named 'notes', present on every major SBML 1759 * component type, is intended as a place for storing optional 1760 * information intended to be seen by humans. An example use of the 1761 * 'notes' element would be to contain formatted user comments about the 1762 * model element in which the 'notes' element is enclosed. Every object 1763 * derived directly or indirectly from type {@link SBase} can have a separate 1764 * value for 'notes', allowing users considerable freedom when adding 1765 * comments to their models. 1766 * <p> 1767 * The format of 'notes' elements must be <a target='_blank' 1768 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 1769 * verify the formatting of 'notes' content, libSBML provides the static 1770 * utility method {@link SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml)}; however, 1771 * readers are urged to consult the appropriate <a target='_blank' 1772 * href='http://sbml.org/Documents/Specifications'>SBML specification 1773 * document</a> for the Level and Version of their model for more 1774 * in-depth explanations. The SBML Level 2 and 3 1775 * specifications have considerable detail about how 'notes' element 1776 * content must be structured. 1777 * <p> 1778 * @param notes an XML string that is to appended to the content of 1779 * the 'notes' subelement of this object 1780 * <p> 1781 * @return integer value indicating success/failure of the 1782 * function. The possible values returned by this function are: 1783 * <ul> 1784 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1785 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 1786 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1787 * </ul> 1788 * <p> 1789 * @see #getNotesString() 1790 * @see #isSetNotes() 1791 * @see #setNotes(XMLNode notes) 1792 * @see #setNotes(String notes) 1793 * @see #appendNotes(XMLNode notes) 1794 * @see #unsetNotes() 1795 * @see SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml) 1796 */ public 1797 int appendNotes(String notes) { 1798 return libsbmlJNI.SBase_appendNotes__SWIG_1(swigCPtr, this, notes); 1799 } 1800 1801 1802/** 1803 * Sets the {@link ModelHistory} of this object. 1804 * <p> 1805 * The content of <code>history</code> is copied, and this object's existing model 1806 * history content is deleted. 1807 * <p> 1808 * @param history {@link ModelHistory} of this object. 1809 * <p> 1810 * @return integer value indicating success/failure of the 1811 * function. The possible values returned by this function are: 1812 * <ul> 1813 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1814 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 1815 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 1816 * </ul> 1817 * <p> 1818 * @note In SBML Level 2, model history annotations were only 1819 * permitted on the {@link Model} element. In SBML Level 3, they are 1820 * permitted on all SBML components derived from {@link SBase}. 1821 */ public 1822 int setModelHistory(ModelHistory history) { 1823 return libsbmlJNI.SBase_setModelHistory(swigCPtr, this, ModelHistory.getCPtr(history), history); 1824 } 1825 1826 1827/** 1828 * Sets the parent SBML object of this SBML object. 1829 * (Creates a child-parent relationship by the child) 1830 * This function is called when a child element is 1831 * set/added/created by its parent element (e.g. by setXXX, 1832 * addXXX, createXXX, and connectToChild functions of the 1833 * parent element). 1834 * <p> 1835 * @param parent the SBML object to use 1836 * @internal 1837 */ public 1838 void connectToParent(SBase parent) { 1839 libsbmlJNI.SBase_connectToParent(swigCPtr, this, SBase.getCPtr(parent), parent); 1840 } 1841 1842 1843/** 1844 * Sets this SBML object to child SBML objects (if any). 1845 * (Creates a child-parent relationship by the parent) 1846 * <p> 1847 * Subclasses must override this function if they define 1848 * one ore more child elements. 1849 * Basically, this function needs to be called in 1850 * constructor, copy constructor, assignment operator. 1851 * <p> 1852 * <p> 1853 * @internal 1854 */ public 1855 void connectToChild() { 1856 libsbmlJNI.SBase_connectToChild(swigCPtr, this); 1857 } 1858 1859 1860/** 1861 * Sets the value of the 'sboTerm' attribute. 1862 * <p> 1863 * Beginning with SBML Level 2 Version 3, objects derived from {@link SBase} have 1864 * an optional attribute named 'sboTerm' for supporting the use of the 1865 * Systems Biology Ontology. In SBML proper, the data type of the 1866 * attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a 1867 * seven digit integer number; libSBML simplifies the representation by 1868 * only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 1869 * 'sboTerm' attribute on {@link SBase} has data type <code>int</code>, and {@link SBO} identifiers 1870 * are stored simply as integers. 1871 * <p> 1872 * {@link SBO} terms are a type of optional annotation, and each different class 1873 * of SBML object derived from {@link SBase} imposes its own requirements about 1874 * the values permitted for 'sboTerm'. Please consult the SBML 1875 * Level 2 Version 4 specification for more information about 1876 * the use of {@link SBO} and the 'sboTerm' attribute. 1877 * <p> 1878 * @param value the NNNNNNN integer portion of the {@link SBO} identifier 1879 * <p> 1880 * @return integer value indicating success/failure of the 1881 * function. The possible values returned by this function are: 1882 * <ul> 1883 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1884 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 1885 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 1886 * </ul> 1887 * <p> 1888 * @see #setSBOTerm(String sbo_id) 1889 */ public 1890 int setSBOTerm(int value) { 1891 return libsbmlJNI.SBase_setSBOTerm__SWIG_0(swigCPtr, this, value); 1892 } 1893 1894 1895/** 1896 * Sets the value of the 'sboTerm' attribute by string. 1897 * <p> 1898 * Beginning with SBML Level 2 Version 3, objects derived from {@link SBase} have 1899 * an optional attribute named 'sboTerm' for supporting the use of the 1900 * Systems Biology Ontology. In SBML proper, the data type of the 1901 * attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a 1902 * seven digit integer number; libSBML simplifies the representation by 1903 * only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 1904 * 'sboTerm' attribute on {@link SBase} has data type <code>int</code>, and {@link SBO} identifiers 1905 * are stored simply as integers. This method lets you set the value of 1906 * 'sboTerm' as a complete string of the form 'SBO:NNNNNNN', whereas 1907 * setSBOTerm(int value) allows you to set it using the integer form. 1908 * <p> 1909 * {@link SBO} terms are a type of optional annotation, and each different class 1910 * of SBML object derived from {@link SBase} imposes its own requirements about 1911 * the values permitted for 'sboTerm'. Please consult the SBML 1912 * Level 2 Version 4 specification for more information about 1913 * the use of {@link SBO} and the 'sboTerm' attribute. 1914 * <p> 1915 * @param sboid the {@link SBO} identifier string of the form 'SBO:NNNNNNN' 1916 * <p> 1917 * @return integer value indicating success/failure of the 1918 * function. The possible values returned by this function are: 1919 * <ul> 1920 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1921 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 1922 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 1923 * </ul> 1924 * <p> 1925 * @see #setSBOTerm(int value) 1926 */ public 1927 int setSBOTerm(String sboid) { 1928 return libsbmlJNI.SBase_setSBOTerm__SWIG_1(swigCPtr, this, sboid); 1929 } 1930 1931 1932/** 1933 * Sets the namespaces relevant of this SBML object. 1934 * <p> 1935 * The content of <code>xmlns</code> is copied, and this object's existing 1936 * namespace content is deleted. 1937 * <p> 1938 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 1939 * information. It is used to communicate the SBML Level, Version, and 1940 * (in Level 3) packages used in addition to SBML Level 3 Core. 1941 * <p> 1942 * @param xmlns the namespaces to set 1943 * <p> 1944 * @return integer value indicating success/failure of the 1945 * function. The possible values returned by this function are: 1946 * <ul> 1947 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1948 * </ul> 1949 */ public 1950 int setNamespaces(XMLNamespaces xmlns) { 1951 return libsbmlJNI.SBase_setNamespaces(swigCPtr, this, XMLNamespaces.getCPtr(xmlns), xmlns); 1952 } 1953 1954 1955/** 1956 * Unsets the value of the 'metaid' attribute of this SBML object. 1957 * <p> 1958 * The optional attribute named 'metaid', present on every major SBML 1959 * component type, is for supporting metadata annotations using RDF 1960 * (Resource Description Format). The attribute value has the data type 1961 * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML 1962 * identifier type, which means each 'metaid' value must be globally 1963 * unique within an SBML file. (Importantly, this uniqueness criterion 1964 * applies across any attribute with type <a 1965 * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the 1966 * 'metaid' attribute used by SBML—something to be aware of if your 1967 * application-specific XML content inside the 'annotation' subelement 1968 * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.) 1969 * The 'metaid' value serves to identify a model component for purposes 1970 * such as referencing that component from metadata placed within 1971 * 'annotation' subelements. 1972 * <p> 1973 * @return integer value indicating success/failure of the 1974 * function. The possible values returned by this function are: 1975 * <ul> 1976 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1977 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 1978 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1979 * </ul> 1980 */ public 1981 int unsetMetaId() { 1982 return libsbmlJNI.SBase_unsetMetaId(swigCPtr, this); 1983 } 1984 1985 1986/** 1987 * Unsets the value of the 'id' attribute of this SBML object. 1988 * <p> 1989 * Most (but not all) objects in SBML include two common attributes: 'id' 1990 * and 'name'. The identifier given by an object's 'id' attribute value 1991 * is used to identify the object within the SBML model definition. 1992 * Other objects can refer to the component using this identifier. The 1993 * data type of 'id' is always either <code>Sid</code> or 1994 * <code>UnitSId</code>, depending on the object in question. Both 1995 * data types are defined as follows: 1996 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 1997 * letter .= 'a'..'z','A'..'Z' 1998 * digit .= '0'..'9' 1999 * idChar .= letter | digit | '_' 2000 * SId .= ( letter | '_' ) idChar* 2001 * </pre> 2002 * <p> 2003 * The equality of <code>SId</code> and <code>UnitSId</code> type values 2004 * in SBML is determined by an exact character sequence match; i.e., 2005 * comparisons of these identifiers must be performed in a case-sensitive 2006 * manner. This applies to all uses of <code>SId</code> and 2007 * <code>UnitSId</code>. 2008 * <p> 2009 * @return integer value indicating success/failure of the 2010 * function. The possible values returned by this function are: 2011 * <ul> 2012 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2013 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 2014 * </ul> 2015 */ public 2016 int unsetId() { 2017 return libsbmlJNI.SBase_unsetId(swigCPtr, this); 2018 } 2019 2020 2021/** 2022 * Unsets the value of the 'name' attribute of this SBML object. 2023 * <p> 2024 * Most (but not all) objects in SBML include two common attributes: 'id' 2025 * and 'name'. In contrast to the 'id' attribute, the 'name' attribute is 2026 * optional and is not intended to be used for cross-referencing purposes 2027 * within a model. Its purpose instead is to provide a human-readable 2028 * label for the component. The data type of 'name' is the type 2029 * <code>string</code> defined in XML Schema. SBML imposes no 2030 * restrictions as to the content of 'name' attributes beyond those 2031 * restrictions defined by the <code>string</code> type in XML Schema. 2032 * <p> 2033 * The recommended practice for handling 'name' is as follows. If a 2034 * software tool has the capability for displaying the content of 'name' 2035 * attributes, it should display this content to the user as a 2036 * component's label instead of the component's 'id'. If the user 2037 * interface does not have this capability (e.g., because it cannot 2038 * display or use special characters in symbol names), or if the 'name' 2039 * attribute is missing on a given component, then the user interface 2040 * should display the value of the 'id' attribute instead. (Script 2041 * language interpreters are especially likely to display 'id' instead of 2042 * 'name'.) 2043 * <p> 2044 * As a consequence of the above, authors of systems that automatically 2045 * generate the values of 'id' attributes should be aware some systems 2046 * may display the 'id''s to the user. Authors therefore may wish to 2047 * take some care to have their software create 'id' values that are: (a) 2048 * reasonably easy for humans to type and read; and (b) likely to be 2049 * meaningful, for example by making the 'id' attribute be an abbreviated 2050 * form of the name attribute value. 2051 * <p> 2052 * An additional point worth mentioning is although there are 2053 * restrictions on the uniqueness of 'id' values, there are no 2054 * restrictions on the uniqueness of 'name' values in a model. This 2055 * allows software applications leeway in assigning component identifiers. 2056 * <p> 2057 * @return integer value indicating success/failure of the 2058 * function. The possible values returned by this function are: 2059 * <ul> 2060 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2061 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 2062 * </ul> 2063 */ public 2064 int unsetName() { 2065 return libsbmlJNI.SBase_unsetName(swigCPtr, this); 2066 } 2067 2068 2069/** 2070 * Unsets the value of the 'notes' subelement of this SBML object. 2071 * <p> 2072 * The optional SBML element named 'notes', present on every major SBML 2073 * component type, is intended as a place for storing optional 2074 * information intended to be seen by humans. An example use of the 2075 * 'notes' element would be to contain formatted user comments about the 2076 * model element in which the 'notes' element is enclosed. Every object 2077 * derived directly or indirectly from type {@link SBase} can have a separate 2078 * value for 'notes', allowing users considerable freedom when adding 2079 * comments to their models. 2080 * <p> 2081 * The format of 'notes' elements must be <a target='_blank' 2082 * href='http://www.w3.org/TR/xhtml1/'>XHTML 1.0</a>. To help 2083 * verify the formatting of 'notes' content, libSBML provides the static 2084 * utility method {@link SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml)}; however, 2085 * readers are urged to consult the appropriate <a target='_blank' 2086 * href='http://sbml.org/Documents/Specifications'>SBML specification 2087 * document</a> for the Level and Version of their model for more 2088 * in-depth explanations. The SBML Level 2 and 3 2089 * specifications have considerable detail about how 'notes' element 2090 * content must be structured. 2091 * <p> 2092 * @return integer value indicating success/failure of the 2093 * function. The possible values returned by this function are: 2094 * <ul> 2095 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2096 * </ul> 2097 * <p> 2098 * @see #getNotesString() 2099 * @see #isSetNotes() 2100 * @see #setNotes(XMLNode notes) 2101 * @see #setNotes(String notes) 2102 * @see #appendNotes(XMLNode notes) 2103 * @see #appendNotes(String notes) 2104 * @see SyntaxChecker#hasExpectedXHTMLSyntax(XMLNode xhtml) 2105 */ public 2106 int unsetNotes() { 2107 return libsbmlJNI.SBase_unsetNotes(swigCPtr, this); 2108 } 2109 2110 2111/** 2112 * Unsets the value of the 'annotation' subelement of this SBML object. 2113 * <p> 2114 * Whereas the {@link SBase} 'notes' subelement is a container for content to be 2115 * shown directly to humans, the 'annotation' element is a container for 2116 * optional software-generated content <em>not</em> meant to be shown to 2117 * humans. Every object derived from {@link SBase} can have its own value for 2118 * 'annotation'. The element's content type is <a target='_blank' 2119 * href='http://www.w3.org/TR/2004/REC-xml-20040204/#elemdecls'>XML type 2120 * 'any'</a>, allowing essentially arbitrary well-formed XML data 2121 * content. 2122 * <p> 2123 * SBML places a few restrictions on the organization of the content of 2124 * annotations; these are intended to help software tools read and write 2125 * the data as well as help reduce conflicts between annotations added by 2126 * different tools. Please see the SBML specifications for more details. 2127 * <p> 2128 * @return integer value indicating success/failure of the 2129 * function. The possible values returned by this function are: 2130 * <ul> 2131 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2132 * </ul> 2133 * <p> 2134 * @see #getAnnotation() 2135 * @see #getAnnotationString() 2136 * @see #isSetAnnotation() 2137 * @see #setAnnotation(XMLNode annotation) 2138 * @see #setAnnotation(String annotation) 2139 * @see #appendAnnotation(XMLNode annotation) 2140 * @see #appendAnnotation(String annotation) 2141 */ public 2142 int unsetAnnotation() { 2143 return libsbmlJNI.SBase_unsetAnnotation(swigCPtr, this); 2144 } 2145 2146 2147/** 2148 * Unsets the value of the 'sboTerm' attribute of this SBML object. 2149 * <p> 2150 * @return integer value indicating success/failure of the 2151 * function. The possible values returned by this function are: 2152 * <ul> 2153 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2154 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 2155 * </ul> 2156 */ public 2157 int unsetSBOTerm() { 2158 return libsbmlJNI.SBase_unsetSBOTerm(swigCPtr, this); 2159 } 2160 2161 2162/** 2163 * Adds a copy of the given {@link CVTerm} object to this SBML object. 2164 * <p> 2165 * @param term the {@link CVTerm} to assign. 2166 * <p> 2167 * @param newBag if <code>true</code>, creates a new RDF bag with the same identifier 2168 * as a previous bag, and if <code>false</code>, adds the term to an existing 2169 * RDF bag with the same type of qualifier as the term being added. 2170 * <p> 2171 * @return integer value indicating success/failure of the 2172 * function. The possible values returned by this function are: 2173 * <ul> 2174 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2175 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 2176 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE }, if 2177 * this object lacks a 'metaid' attribute 2178 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 2179 * </ul> 2180 * <p> 2181 * @note Since the CV Term uses the 'metaid' attribute of the object as a 2182 * reference, if the object has no 'metaid' attribute value set, then the 2183 * {@link CVTerm} will not be added. 2184 * <p> 2185 * @warning The fact that this method <em>copies</em> the object passed to it 2186 * means that the caller will be left holding a physically different 2187 * object instance than the one contained in <em>this</em> object. Changes 2188 * made to the original object instance (such as resetting attribute 2189 * values) will <em>not affect the instance added here</em>. In 2190 * addition, the caller should make sure to free the original object if 2191 * it is no longer being used, or else a memory leak will result. 2192 * <p> 2193 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 2194</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 2195The native C++ implementation of this method defines a default argument 2196value. In the documentation generated for different libSBML language 2197bindings, you may or may not see corresponding arguments in the method 2198declarations. For example, in Java and C#, a default argument is handled by 2199declaring two separate methods, with one of them having the argument and 2200the other one lacking the argument. However, the libSBML documentation will 2201be <em>identical</em> for both methods. Consequently, if you are reading 2202this and do not see an argument even though one is described, please look 2203for descriptions of other variants of this method near where this one 2204appears in the documentation. 2205</dd></dl> 2206 2207 */ public 2208 int addCVTerm(CVTerm term, boolean newBag) { 2209 return libsbmlJNI.SBase_addCVTerm__SWIG_0(swigCPtr, this, CVTerm.getCPtr(term), term, newBag); 2210 } 2211 2212 2213/** 2214 * Adds a copy of the given {@link CVTerm} object to this SBML object. 2215 * <p> 2216 * @param term the {@link CVTerm} to assign. 2217 * <p> 2218 * @param newBag if <code>true</code>, creates a new RDF bag with the same identifier 2219 * as a previous bag, and if <code>false</code>, adds the term to an existing 2220 * RDF bag with the same type of qualifier as the term being added. 2221 * <p> 2222 * @return integer value indicating success/failure of the 2223 * function. The possible values returned by this function are: 2224 * <ul> 2225 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2226 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 2227 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE }, if 2228 * this object lacks a 'metaid' attribute 2229 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 2230 * </ul> 2231 * <p> 2232 * @note Since the CV Term uses the 'metaid' attribute of the object as a 2233 * reference, if the object has no 'metaid' attribute value set, then the 2234 * {@link CVTerm} will not be added. 2235 * <p> 2236 * @warning The fact that this method <em>copies</em> the object passed to it 2237 * means that the caller will be left holding a physically different 2238 * object instance than the one contained in <em>this</em> object. Changes 2239 * made to the original object instance (such as resetting attribute 2240 * values) will <em>not affect the instance added here</em>. In 2241 * addition, the caller should make sure to free the original object if 2242 * it is no longer being used, or else a memory leak will result. 2243 * <p> 2244 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 2245</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 2246The native C++ implementation of this method defines a default argument 2247value. In the documentation generated for different libSBML language 2248bindings, you may or may not see corresponding arguments in the method 2249declarations. For example, in Java and C#, a default argument is handled by 2250declaring two separate methods, with one of them having the argument and 2251the other one lacking the argument. However, the libSBML documentation will 2252be <em>identical</em> for both methods. Consequently, if you are reading 2253this and do not see an argument even though one is described, please look 2254for descriptions of other variants of this method near where this one 2255appears in the documentation. 2256</dd></dl> 2257 2258 */ public 2259 int addCVTerm(CVTerm term) { 2260 return libsbmlJNI.SBase_addCVTerm__SWIG_1(swigCPtr, this, CVTerm.getCPtr(term), term); 2261 } 2262 2263 2264/** 2265 * Returns a list of {@link CVTerm} objects in the annotations of this SBML 2266 * object. 2267 * <p> 2268 * @return the list of CVTerms for this SBML object. 2269 */ public 2270 CVTermList getCVTerms() { 2271 long cPtr = libsbmlJNI.SBase_getCVTerms__SWIG_0(swigCPtr, this); 2272 return (cPtr == 0) ? null : new CVTermList(cPtr, true); 2273} 2274 2275 2276/** 2277 * Returns the number of {@link CVTerm} objects in the annotations of this SBML 2278 * object. 2279 * <p> 2280 * @return the number of CVTerms for this SBML object. 2281 */ public 2282 long getNumCVTerms() { 2283 return libsbmlJNI.SBase_getNumCVTerms(swigCPtr, this); 2284 } 2285 2286 2287/** 2288 * Returns the nth {@link CVTerm} in the list of CVTerms of this SBML 2289 * object. 2290 * <p> 2291 * @param n long the index of the {@link CVTerm} to retrieve 2292 * <p> 2293 * @return the nth {@link CVTerm} in the list of CVTerms for this SBML object. 2294 */ public 2295 CVTerm getCVTerm(long n) { 2296 long cPtr = libsbmlJNI.SBase_getCVTerm(swigCPtr, this, n); 2297 return (cPtr == 0) ? null : new CVTerm(cPtr, false); 2298 } 2299 2300 2301/** 2302 * Clears the list of {@link CVTerm} objects attached to this SBML object. 2303 * <p> 2304 * @return integer value indicating success/failure of the 2305 * function. The possible values returned by this function are: 2306 * <ul> 2307 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2308 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 2309 * </ul> 2310 */ public 2311 int unsetCVTerms() { 2312 return libsbmlJNI.SBase_unsetCVTerms(swigCPtr, this); 2313 } 2314 2315 2316/** 2317 * Unsets the {@link ModelHistory} object attached to this object. 2318 * <p> 2319 * @return integer value indicating success/failure of the 2320 * function. The possible values returned by this function are: 2321 * <ul> 2322 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2323 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 2324 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 2325 * </ul> 2326 * <p> 2327 * @note In SBML Level 2, model history annotations were only 2328 * permitted on the {@link Model} element. In SBML Level 3, they are 2329 * permitted on all SBML components derived from {@link SBase}. 2330 */ public 2331 int unsetModelHistory() { 2332 return libsbmlJNI.SBase_unsetModelHistory(swigCPtr, this); 2333 } 2334 2335 2336/** 2337 * Returns the MIRIAM <em>biological qualifier</em> associated with the 2338 * given resource. 2339 * <p> 2340 * In <a target='_blank' href='http://biomodels.net/miriam'>MIRIAM</a>, 2341 * qualifiers are an optional means of indicating the relationship 2342 * between a model component and its annotations. There are two broad 2343 * kinds of annotations: <em>model</em> and <em>biological</em>. The 2344 * latter kind is used to qualify the relationship between a model 2345 * component and a biological entity which it represents. Examples of 2346 * relationships include 'is' and 'has part', but many others are 2347 * possible. MIRIAM defines <a target='_blank' 2348 * href='http://www.ebi.ac.uk/miriam/main/qualifiers/'>numerous 2349 * relationship qualifiers</a> to enable different software tools to 2350 * qualify biological annotations in the same standardized way. In 2351 * libSBML, the MIRIAM controlled-vocabulary annotations on an SBML model 2352 * element are represented using lists of {@link CVTerm} objects, and the 2353 * the MIRIAM biological qualifiers are represented using 2354 * values whose 2355 * names begin with <code>BQB_</code> in the interface class 2356 * {@link libsbmlConstants}. 2357 * <p> 2358 * This method searches the controlled-vocabulary annotations 2359 * (i.e., the list of {@link CVTerm} objects) on the present object, then out of 2360 * those that have biological qualifiers, looks for an annotation to the 2361 * given <code>resource</code>. If such an annotation is found, it returns the 2362 * type of biological qualifier associated with that resource as a 2363 * value whose name 2364 * begins with <code>BQB_</code> from the interface 2365 * class {@link libsbmlConstants}. 2366 * <p> 2367 * @param resource string representing the resource; e.g., 2368 * <code>'http://www.geneontology.org/#GO:0005892'</code>. 2369 * <p> 2370 * @return the qualifier associated with the resource, 2371 * or {@link libsbmlConstants#BQB_UNKNOWN BQB_UNKNOWN} if the 2372 * resource does not exist. 2373 * <p> 2374 * @note The set of MIRIAM biological qualifiers grows over 2375 * time, although relatively slowly. The values are up to date with 2376 * MIRIAM at the time of a given libSBML release. The set of values in 2377 * list of <code>BQB_</code> constants defined in {@link libsbmlConstants} 2378 * may be expanded in later libSBML releases, to match 2379 * the values defined by MIRIAM at that later time. 2380 * <p> 2381 */ public 2382 int getResourceBiologicalQualifier(String resource) { 2383 return libsbmlJNI.SBase_getResourceBiologicalQualifier(swigCPtr, this, resource); 2384 } 2385 2386 2387/** 2388 * Returns the MIRIAM <em>model qualifier</em> associated with the 2389 * given resource. 2390 * <p> 2391 * In <a target='_blank' href='http://biomodels.net/miriam'>MIRIAM</a>, 2392 * qualifiers are an optional means of indicating the relationship 2393 * between a model component and its annotations. There are two broad 2394 * kinds of annotations: <em>model</em> and <em>biological</em>. The 2395 * former kind is used to qualify the relationship between a model 2396 * component and another modeling object. An example qualifier is 2397 * 'isDerivedFrom', to indicate that a given component of the model is 2398 * derived from the modeling object represented by the referenced 2399 * resource. MIRIAM defines <a target='_blank' 2400 * href='http://www.ebi.ac.uk/miriam/main/qualifiers/'>numerous 2401 * relationship qualifiers</a> to enable different software tools to 2402 * qualify model annotations in the same standardized way. In libSBML, 2403 * the MIRIAM controlled-vocabulary annotations on an SBML model element 2404 * are represented using lists of {@link CVTerm} objects, and the 2405 * the MIRIAM model qualifiers are represented using 2406 * values whose 2407 * names begin with <code>BQM_</code> in the interface class 2408 * {@link libsbmlConstants}. 2409 * <p> 2410 * This method method searches the controlled-vocabulary annotations 2411 * (i.e., the list of {@link CVTerm} objects) on the present object, then out of 2412 * those that have model qualifiers, looks for an annotation to the given 2413 * <code>resource</code>. If such an annotation is found, it returns the type of 2414 * type of model qualifier associated with that resource as a 2415 * value whose name 2416 * begins with <code>BQM_</code> from the interface 2417 * class {@link libsbmlConstants}. 2418 * <p> 2419 * @param resource string representing the resource; e.g., 2420 * <code>'http://www.geneontology.org/#GO:0005892'</code>. 2421 * <p> 2422 * @return the model qualifier 2423 * type associated with the resource, or {@link 2424 * libsbmlConstants#BQM_UNKNOWN BQM_UNKNOWN} if the resource 2425 * does not exist. 2426 * <p> 2427 * @note The set of MIRIAM model qualifiers grows over 2428 * time, although relatively slowly. The values are up to date with 2429 * MIRIAM at the time of a given libSBML release. The set of values in 2430 * list of <code>BQM_</code> constants defined in {@link libsbmlConstants} 2431 * may be expanded in later libSBML releases, to match 2432 * the values defined by MIRIAM at that later time. 2433 * <p> 2434 */ public 2435 int getResourceModelQualifier(String resource) { 2436 return libsbmlJNI.SBase_getResourceModelQualifier(swigCPtr, this, resource); 2437 } 2438 2439 2440/** 2441 * Returns the {@link Model} object in which the current object is located. 2442 * <p> 2443 * @return the parent {@link Model} of this SBML object. 2444 * <p> 2445 * @see #getParentSBMLObject() 2446 * @see #getSBMLDocument() 2447 */ public 2448 Model getModel() { 2449 long cPtr = libsbmlJNI.SBase_getModel(swigCPtr, this); 2450 return (cPtr == 0) ? null : new Model(cPtr, false); 2451 } 2452 2453 2454/** 2455 * Returns the SBML Level of the {@link SBMLDocument} object containing this 2456 * object. 2457 * <p> 2458 * @return the SBML level of this SBML object. 2459 * <p> 2460 * @see #getVersion() 2461 * @see #getNamespaces() 2462 * @see #getPackageVersion() 2463 */ public 2464 long getLevel() { 2465 return libsbmlJNI.SBase_getLevel(swigCPtr, this); 2466 } 2467 2468 2469/** 2470 * Returns the Version within the SBML Level of the {@link SBMLDocument} object 2471 * containing this object. 2472 * <p> 2473 * @return the SBML version of this SBML object. 2474 * <p> 2475 * @see #getLevel() 2476 * @see #getNamespaces() 2477 */ public 2478 long getVersion() { 2479 return libsbmlJNI.SBase_getVersion(swigCPtr, this); 2480 } 2481 2482 2483/** 2484 * Returns the Version of the SBML Level 3 package to which this 2485 * element belongs to. 2486 * <p> 2487 * @return the version of the SBML Level 3 package to which this 2488 * element belongs. The value <code>0</code> will be returned if this element 2489 * belongs to the SBML Level 3 Core package. 2490 * <p> 2491 * @see #getLevel() 2492 * @see #getVersion() 2493 */ public 2494 long getPackageVersion() { 2495 return libsbmlJNI.SBase_getPackageVersion(swigCPtr, this); 2496 } 2497 2498 2499/** 2500 * Returns the name of the SBML Level 3 package in which this 2501 * element is defined. 2502 * <p> 2503 * @return the name of the SBML package in which this element is defined. 2504 * The string <code>"core"</code> will be returned if this 2505 * element is defined in SBML Level 3 Core. The string 2506 * <code>"unknown"</code> will be returned if this element is 2507 * not defined in any SBML package. 2508 */ public 2509 String getPackageName() { 2510 return libsbmlJNI.SBase_getPackageName(swigCPtr, this); 2511 } 2512 2513 2514/** 2515 * Returns the libSBML type code for this object. 2516 * <p> 2517 * This method may return the type code of this SBML object, or it may 2518 * return {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}. This 2519 * is because subclasses of {@link SBase} are not required to implement this 2520 * method to return a type code. This method is meant primarily for the 2521 * LibSBML C interface, in which class and subclass information is not 2522 * readily available. 2523 * <p> 2524 * @return the SBML object type code 2525 * of this SBML object or 2526 * {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default). 2527 * <p> 2528 * @see #getElementName() 2529 * @see #getPackageName() 2530 */ public 2531 int getTypeCode() { 2532 return libsbmlJNI.SBase_getTypeCode(swigCPtr, this); 2533 } 2534 2535 2536/** 2537 * Predicate returning <code>true</code> if this 2538 * object's level/version and namespace values correspond to a valid 2539 * SBML specification. 2540 * <p> 2541 * The valid combinations of SBML Level, Version and Namespace as of this 2542 * release of libSBML are the following: 2543 * <ul> 2544 * <li> Level 1 Version 2: <code>'http://www.sbml.org/sbml/level1'</code> 2545 * <li> Level 2 Version 1: <code>'http://www.sbml.org/sbml/level2'</code> 2546 * <li> Level 2 Version 2: <code>'http://www.sbml.org/sbml/level2/version2'</code> 2547 * <li> Level 2 Version 3: <code>'http://www.sbml.org/sbml/level2/version3'</code> 2548 * <li> Level 2 Version 4: <code>'http://www.sbml.org/sbml/level2/version4'</code> 2549 * <li> Level 3 Version 1 Core: <code>'http://www.sbml.org/sbml/level3/version1/core'</code> 2550 * </ul> 2551 * <p> 2552 * @return <code>true</code> if the level, version and namespace values of this 2553 * SBML object correspond to a valid set of values, <code>false</code> otherwise. 2554 */ public 2555 boolean hasValidLevelVersionNamespaceCombination() { 2556 return libsbmlJNI.SBase_hasValidLevelVersionNamespaceCombination(swigCPtr, this); 2557 } 2558 2559 2560/** 2561 * Returns the XML element name of this object. 2562 * <p> 2563 * This is overridden by subclasses to return a string appropriate to the 2564 * SBML component. For example, {@link Model} defines it as returning 2565 * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>, 2566 * and so on. 2567 */ public 2568 String getElementName() { 2569 return libsbmlJNI.SBase_getElementName(swigCPtr, this); 2570 } 2571 2572 2573/** 2574 * Returns a string consisting of a partial SBML corresponding to just 2575 * this object. 2576 * <p> 2577 * @return the partial SBML that describes this SBML object. 2578 * <p> 2579 * @warning This is primarily provided for testing and debugging 2580 * purposes. It may be removed in a future version of libSBML. 2581 */ public 2582 String toSBML() { 2583 return libsbmlJNI.SBase_toSBML(swigCPtr, this); 2584 } 2585 2586 2587/** 2588 * Returns a plug-in object (extension interface) for an SBML Level 3 2589 * package extension with the given package name or URI. 2590 * <p> 2591 * @param package the name or URI of the package 2592 * <p> 2593 * @return the plug-in object (the libSBML extension interface) of 2594 * a package extension with the given package name or URI. 2595 */ public 2596 SBasePlugin getPlugin(String arg0) { 2597 return libsbml.DowncastSBasePlugin(libsbmlJNI.SBase_getPlugin__SWIG_0(swigCPtr, this, arg0), false); 2598} 2599 2600 2601/** 2602 * Returns the nth plug-in object (extension interface) for an SBML Level 3 2603 * package extension. 2604 * <p> 2605 * @param n the index of the plug-in to return 2606 * <p> 2607 * @return the plug-in object (the libSBML extension interface) of 2608 * a package extension with the given package name or URI. 2609 */ public 2610 SBasePlugin getPlugin(long n) { 2611 return libsbml.DowncastSBasePlugin(libsbmlJNI.SBase_getPlugin__SWIG_2(swigCPtr, this, n), false); 2612} 2613 2614 2615/** 2616 * Returns the number of plug-in objects (extenstion interfaces) for SBML 2617 * Level 3 package extensions known. 2618 * <p> 2619 * @return the number of plug-in objects (extension interfaces) of 2620 * package extensions known by this instance of libSBML. 2621 */ public 2622 long getNumPlugins() { 2623 return libsbmlJNI.SBase_getNumPlugins(swigCPtr, this); 2624 } 2625 2626 2627/** 2628 * Enables or disables the given SBML Level 3 package 2629 * <p> 2630 * This method enables or disables the specified package on this object 2631 * and other objects connected by child-parent links in the same 2632 * {@link SBMLDocument} object. 2633 * <p> 2634 * @param pkgURI the URI of the package 2635 * <p> 2636 * @param pkgPrefix the XML prefix of the package 2637 * <p> 2638 * @param flag whether to enable (<code>true</code>) or disable (<code>false</code>) the package 2639 * <p> 2640 * @return integer value indicating success/failure of the 2641 * function. The possible values 2642 * returned by this function are: 2643 * <ul> 2644 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2645 * <li> {@link libsbmlConstants#LIBSBML_PKG_UNKNOWN LIBSBML_PKG_UNKNOWN } 2646 * <li> {@link libsbmlConstants#LIBSBML_PKG_VERSION_MISMATCH LIBSBML_PKG_VERSION_MISMATCH } 2647 * <li> {@link libsbmlConstants#LIBSBML_PKG_CONFLICTED_VERSION LIBSBML_PKG_CONFLICTED_VERSION } 2648 * </ul> 2649 */ public 2650 int enablePackage(String pkgURI, String pkgPrefix, boolean flag) { 2651 return libsbmlJNI.SBase_enablePackage(swigCPtr, this, pkgURI, pkgPrefix, flag); 2652 } 2653 2654 2655/** 2656 * Disables the given SBML Level 3 package 2657 * <p> 2658 * This method enables or disables the specified package on this object 2659 * and other objects connected by child-parent links in the same 2660 * {@link SBMLDocument} object. 2661 * <p> 2662 * @param pkgURI the URI of the package 2663 * <p> 2664 * @param pkgPrefix the XML prefix of the package 2665 * <p> 2666 * @return integer value indicating success/failure of the 2667 * function. The possible values 2668 * returned by this function are: 2669 * <ul> 2670 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2671 * <li> {@link libsbmlConstants#LIBSBML_PKG_UNKNOWN LIBSBML_PKG_UNKNOWN } 2672 * <li> {@link libsbmlConstants#LIBSBML_PKG_VERSION_MISMATCH LIBSBML_PKG_VERSION_MISMATCH } 2673 * <li> {@link libsbmlConstants#LIBSBML_PKG_CONFLICTED_VERSION LIBSBML_PKG_CONFLICTED_VERSION } 2674 * </ul> 2675 */ public 2676 int disablePackage(String pkgURI, String pkgPrefix) { 2677 return libsbmlJNI.SBase_disablePackage(swigCPtr, this, pkgURI, pkgPrefix); 2678 } 2679 2680 2681/** 2682 * Enables/Disables the given package with this element and child 2683 * elements (if any). 2684 * (This is an internal implementation for enablePackage function) 2685 * <p> 2686 * @note Subclasses in which one or more child elements are defined 2687 * must override this function. 2688 * <p> 2689 * <p> 2690 * @see #connectToChild() 2691 * @internal 2692 */ public 2693 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 2694 libsbmlJNI.SBase_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 2695 } 2696 2697 2698/** 2699 * Predicate returning <code>true</code> if an SBML Level 3 package with the 2700 * given URI is enabled with this object. 2701 * <p> 2702 * @param pkgURI the URI of the package 2703 * <p> 2704 * @return <code>true</code> if the given package is enabled within this object, @c 2705 * false otherwise. 2706 * <p> 2707 * @see #isPackageEnabled(String pkgName) 2708 */ public 2709 boolean isPackageURIEnabled(String pkgURI) { 2710 return libsbmlJNI.SBase_isPackageURIEnabled(swigCPtr, this, pkgURI); 2711 } 2712 2713 2714/** 2715 * Predicate returning <code>true</code> if the given SBML Level 3 package is 2716 * enabled with this object. 2717 * <p> 2718 * The search ignores the package version. 2719 * <p> 2720 * @param pkgName the name of the package 2721 * <p> 2722 * @return <code>true</code> if the given package is enabled within this object, 2723 * <code>false</code> otherwise. 2724 * <p> 2725 * @see #isPackageURIEnabled(String pkgURI) 2726 */ public 2727 boolean isPackageEnabled(String pkgName) { 2728 return libsbmlJNI.SBase_isPackageEnabled(swigCPtr, this, pkgName); 2729 } 2730 2731 2732/** 2733 * Predicate returning <code>true</code> if an SBML Level 3 package with the 2734 * given URI is enabled with this object. 2735 * <p> 2736 * @param pkgURI the URI of the package 2737 * <p> 2738 * @return <code>true</code> if the given package is enabled within this object, @c 2739 * false otherwise. 2740 * <p> 2741 * @see #isPkgEnabled(String pkgName) 2742 * <p> 2743 * @deprecated <div class='deprecated'>Replaced in libSBML 5.2.0 by 2744 * isPackageURIEnabled(String pkgURI) 2745 </div> 2746 * */ public 2747 boolean isPkgURIEnabled(String pkgURI) { 2748 return libsbmlJNI.SBase_isPkgURIEnabled(swigCPtr, this, pkgURI); 2749 } 2750 2751 2752/** 2753 * Predicate returning <code>true</code> if the given SBML Level 3 package is 2754 * enabled with this object. 2755 * <p> 2756 * The search ignores the package version. 2757 * <p> 2758 * @param pkgName the name of the package 2759 * <p> 2760 * @return <code>true</code> if the given package is enabled within this object, 2761 * <code>false</code> otherwise. 2762 * <p> 2763 * @see #isPkgURIEnabled(String pkgURI) 2764 * <p> 2765 * @deprecated <div class='deprecated'>Replaced in libSBML 5.2.0 by 2766 * isPackageEnabled(String pkgName) 2767 </div> 2768 * */ public 2769 boolean isPkgEnabled(String pkgName) { 2770 return libsbmlJNI.SBase_isPkgEnabled(swigCPtr, this, pkgName); 2771 } 2772 2773 2774/** 2775 * Writes out contained SBML objects of package extensions (if any) 2776 * as XML elements. 2777 * <p> 2778 * @internal 2779 */ public 2780 void writeExtensionElements(XMLOutputStream stream) { 2781 libsbmlJNI.SBase_writeExtensionElements(swigCPtr, this, XMLOutputStream.getCPtr(stream), stream); 2782 } 2783 2784 2785/** 2786 * Subclasses should override this method to write out their contained 2787 * SBML objects as XML elements. Be sure to call your parents 2788 * implementation of this method as well. For example: 2789 * @internal 2790 */ public 2791 boolean hasRequiredAttributes() { 2792 return libsbmlJNI.SBase_hasRequiredAttributes(swigCPtr, this); 2793 } 2794 2795 2796/** 2797 * Subclasses should override this method to write out their contained 2798 * SBML objects as XML elements. Be sure to call your parents 2799 * implementation of this method as well. For example: 2800 * @internal 2801 */ public 2802 boolean hasRequiredElements() { 2803 return libsbmlJNI.SBase_hasRequiredElements(swigCPtr, this); 2804 } 2805 2806 2807/** 2808 * Subclasses should override this method to write out their contained 2809 * SBML objects as XML elements. Be sure to call your parents 2810 * implementation of this method as well. For example: 2811 * @internal 2812 */ public 2813 int checkCompatibility(SBase object) { 2814 return libsbmlJNI.SBase_checkCompatibility(swigCPtr, this, SBase.getCPtr(object), object); 2815 } 2816 2817 2818/** 2819 * Subclasses should override this method to write out their contained 2820 * SBML objects as XML elements. Be sure to call your parents 2821 * implementation of this method as well. For example: 2822 * @internal 2823 */ public 2824 void setSBMLNamespacesAndOwn(SBMLNamespaces sbmlns) { 2825 libsbmlJNI.SBase_setSBMLNamespacesAndOwn(swigCPtr, this, SBMLNamespaces.getCPtr(sbmlns), sbmlns); 2826 } 2827 2828 2829/** 2830 * Subclasses should override this method to write out their contained 2831 * SBML objects as XML elements. Be sure to call your parents 2832 * implementation of this method as well. For example: 2833 * @internal 2834 */ public 2835 SBMLNamespaces getSBMLNamespaces() { 2836 return libsbml.DowncastSBMLNamespaces(libsbmlJNI.SBase_getSBMLNamespaces(swigCPtr, this), false); 2837} 2838 2839 2840/** 2841 * Subclasses should override this method to write out their contained 2842 * SBML objects as XML elements. Be sure to call your parents 2843 * implementation of this method as well. For example: 2844 * @internal 2845 */ public 2846 String checkMathMLNamespace(XMLToken elem) { 2847 return libsbmlJNI.SBase_checkMathMLNamespace(swigCPtr, this, XMLToken.getCPtr(elem), elem); 2848 } 2849 2850 2851/** 2852 * Removes itself from its parent. If the parent was storing it as a 2853 * pointer, it is deleted. If not, it is simply cleared (as in {@link ListOf} 2854 * objects). Pure virutal, as every {@link SBase} element has different parents, 2855 * and therefore different methods of removing itself. Will fail (and 2856 * not delete itself) if it has no parent object. This function is 2857 * designed to be overridden, but for all objects whose parent is of the 2858 * class {@link ListOf}, the default implementation will work. 2859 * <p> 2860 * @return integer value indicating success/failure of the 2861 * function. The possible values 2862 * returned by this function are: 2863 * <ul> 2864 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 2865 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 2866 * </ul> 2867 */ public 2868 int removeFromParentAndDelete() { 2869 return libsbmlJNI.SBase_removeFromParentAndDelete(swigCPtr, this); 2870 } 2871 2872 2873/** 2874 * Returns <code>true</code> if this object's set of XML namespaces are the same 2875 * as the given object's XML namespaces. 2876 * <p> 2877 * @param sb an object to compare with respect to namespaces 2878 * <p> 2879 * @return boolean, <code>true</code> if this object's collection of namespaces is 2880 * the same as <code>sb's</code>, <code>false</code> otherwise. 2881 */ public 2882 boolean matchesSBMLNamespaces(SBase sb) { 2883 return libsbmlJNI.SBase_matchesSBMLNamespaces__SWIG_0(swigCPtr, this, SBase.getCPtr(sb), sb); 2884 } 2885 2886 2887/** 2888 * Returns <code>true</code> if this object's set of XML namespaces are a subset 2889 * of the given object's XML namespaces. 2890 * <p> 2891 * @param sb an object to compare with respect to namespaces 2892 * <p> 2893 * @return boolean, <code>true</code> if this object's collection of namespaces is 2894 * a subset of <code>sb's</code>, <code>false</code> otherwise. 2895 */ public 2896 boolean matchesRequiredSBMLNamespacesForAddition(SBase sb) { 2897 return libsbmlJNI.SBase_matchesRequiredSBMLNamespacesForAddition__SWIG_0(swigCPtr, this, SBase.getCPtr(sb), sb); 2898 } 2899 2900 public SBaseList getListOfAllElements() { 2901 long cPtr = libsbmlJNI.SBase_getListOfAllElements(swigCPtr, this); 2902 return (cPtr == 0) ? null : new SBaseList(cPtr, false); 2903 } 2904 2905 public SBaseList getListOfAllElementsFromPlugins() { 2906 long cPtr = libsbmlJNI.SBase_getListOfAllElementsFromPlugins(swigCPtr, this); 2907 return (cPtr == 0) ? null : new SBaseList(cPtr, false); 2908 } 2909 2910}