001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.10 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * A token in an XML stream. 013 <p> 014 * <p style='color: #777; font-style: italic'> 015This class of objects is defined by libSBML only and has no direct 016equivalent in terms of SBML components. This class is not prescribed by 017the SBML specifications, although it is used to implement features 018defined in SBML. 019</p> 020 021 <p> 022 * The libSBML XML parser interface can read an XML file or data stream and 023 * convert the contents into tokens. The tokens represent items in the XML 024 * stream, either XML elements (start or end tags) or text that appears as 025 * content inside an element. The {@link XMLToken} class is libSBML's low-level 026 * representation of these entities. 027 <p> 028 * Each {@link XMLToken} has the following information associated with it: 029 * <ol> 030 * <li> <em>Qualified name</em>: every XML element or XML attribute has a 031 * name (e.g., for the element <code><mytag></code>, the name is 032 * <code>'mytag'</code>), but this name may be qualified with a namespace 033 * (e.g., it may appear as <code><someNamespace:mytag></code> in the 034 * input). An {@link XMLToken} stores the name of a token, along with any namespace 035 * qualification present, through the use of an {@link XMLTriple} object. This 036 * object stores the bare name of the element, its XML namespace prefix (if 037 * any), and the XML namespace with which that prefix is associated. 038 * <li> <em>Namespaces</em>: An XML token can have one or more XML namespaces 039 * associated with it. These namespaces may be specified explicitly on the 040 * element or inherited from parent elements. In libSBML, a list of 041 * namespaces is stored in an {@link XMLNamespaces} object. An {@link XMLToken} possesses a 042 * field for storing an {@link XMLNamespaces} object. 043 * <li> <em>Attributes</em>: XML elements can have attributes associated with 044 * them, and these attributes can have values assigned to them. The set of 045 * attribute-value pairs is stored in an {@link XMLAttributes} object stored in an 046 * {@link XMLToken} object. (Note: only elements can have attributes—text 047 * blocks cannot have them in XML.) 048 * <li> <em>Line</em> number: the line number in the input where the token appears. 049 * <li> <em>Column</em> number: the column number in the input where the token appears. 050 * </ol> 051 <p> 052 * The {@link XMLToken} class serves as base class for {@link XMLNode}. XML lends itself to 053 * a tree-structured representation, and in libSBML, the nodes in an XML 054 * document tree are {@link XMLNode} objects. Most higher-level libSBML classes and 055 * methods that offer XML-level functionality (such as the methods on {@link SBase} 056 * for interacting with annotations) work with {@link XMLNode} objects rather than 057 * {@link XMLToken} objects directly. 058 <p> 059 * @see XMLNode 060 * @see XMLTriple 061 * @see XMLAttributes 062 * @see XMLNamespaces 063 */ 064 065public class XMLToken { 066 private long swigCPtr; 067 protected boolean swigCMemOwn; 068 069 protected XMLToken(long cPtr, boolean cMemoryOwn) 070 { 071 swigCMemOwn = cMemoryOwn; 072 swigCPtr = cPtr; 073 } 074 075 protected static long getCPtr(XMLToken obj) 076 { 077 return (obj == null) ? 0 : obj.swigCPtr; 078 } 079 080 protected static long getCPtrAndDisown (XMLToken obj) 081 { 082 long ptr = 0; 083 084 if (obj != null) 085 { 086 ptr = obj.swigCPtr; 087 obj.swigCMemOwn = false; 088 } 089 090 return ptr; 091 } 092 093 protected void finalize() { 094 delete(); 095 } 096 097 public synchronized void delete() { 098 if (swigCPtr != 0) { 099 if (swigCMemOwn) { 100 swigCMemOwn = false; 101 libsbmlJNI.delete_XMLToken(swigCPtr); 102 } 103 swigCPtr = 0; 104 } 105 } 106 107 /** 108 * Equality comparison method for XMLToken. 109 * <p> 110 * Because the Java methods for libSBML are actually wrappers around code 111 * implemented in C++ and C, certain operations will not behave as 112 * expected. Equality comparison is one such case. An instance of a 113 * libSBML object class is actually a <em>proxy object</em> 114 * wrapping the real underlying C/C++ object. The normal <code>==</code> 115 * equality operator in Java will <em>only compare the Java proxy objects</em>, 116 * not the underlying native object. The result is almost never what you 117 * want in practical situations. Unfortunately, Java does not provide a 118 * way to override <code>==</code>. 119 * <p> 120 * The alternative that must be followed is to use the 121 * <code>equals()</code> method. The <code>equals</code> method on this 122 * class overrides the default java.lang.Object one, and performs an 123 * intelligent comparison of instances of objects of this class. The 124 * result is an assessment of whether two libSBML Java objects are truly 125 * the same underlying native-code objects. 126 * <p> 127 * The use of this method in practice is the same as the use of any other 128 * Java <code>equals</code> method. For example, 129 * <em>a</em><code>.equals(</code><em>b</em><code>)</code> returns 130 * <code>true</code> if <em>a</em> and <em>b</em> are references to the 131 * same underlying object. 132 * 133 * @param sb a reference to an object to which the current object 134 * instance will be compared 135 * 136 * @return <code>true</code> if <code>sb</code> refers to the same underlying 137 * native object as this one, <code>false</code> otherwise 138 */ 139 public boolean equals(Object sb) 140 { 141 if ( this == sb ) 142 { 143 return true; 144 } 145 return swigCPtr == getCPtr((XMLToken)(sb)); 146 } 147 148 /** 149 * Returns a hashcode for this XMLToken object. 150 * 151 * @return a hash code usable by Java methods that need them. 152 */ 153 public int hashCode() 154 { 155 return (int)(swigCPtr^(swigCPtr>>>32)); 156 } 157 158 159/** 160 * Creates a new empty {@link XMLToken} object. 161 */ public 162 XMLToken() throws org.sbml.libsbml.XMLConstructorException { 163 this(libsbmlJNI.new_XMLToken__SWIG_0(), true); 164 } 165 166 167/** 168 * Creates an XML start element with attributes and namespace declarations. 169 <p> 170 * @param triple an {@link XMLTriple} object describing the start tag. 171 <p> 172 * @param attributes {@link XMLAttributes}, the attributes to set on the element to 173 * be created. 174 <p> 175 * @param namespaces {@link XMLNamespaces}, the namespaces to set on the element to 176 * be created. 177 <p> 178 * @param line a long integer, the line number to associate with the 179 * token (default = 0). 180 <p> 181 * @param column a long integer, the column number to associate with the 182 * token (default = 0). 183 <p> 184 * 185</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 186The native C++ implementation of this method defines a default argument 187value. In the documentation generated for different libSBML language 188bindings, you may or may not see corresponding arguments in the method 189declarations. For example, in Java and C#, a default argument is handled by 190declaring two separate methods, with one of them having the argument and 191the other one lacking the argument. However, the libSBML documentation will 192be <em>identical</em> for both methods. Consequently, if you are reading 193this and do not see an argument even though one is described, please look 194for descriptions of other variants of this method near where this one 195appears in the documentation. 196</dd></dl> 197 198 */ public 199 XMLToken(XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line, long column) throws org.sbml.libsbml.XMLConstructorException { 200 this(libsbmlJNI.new_XMLToken__SWIG_1(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes, XMLNamespaces.getCPtr(namespaces), namespaces, line, column), true); 201 } 202 203 204/** 205 * Creates an XML start element with attributes and namespace declarations. 206 <p> 207 * @param triple an {@link XMLTriple} object describing the start tag. 208 <p> 209 * @param attributes {@link XMLAttributes}, the attributes to set on the element to 210 * be created. 211 <p> 212 * @param namespaces {@link XMLNamespaces}, the namespaces to set on the element to 213 * be created. 214 <p> 215 * @param line a long integer, the line number to associate with the 216 * token (default = 0). 217 <p> 218 * @param column a long integer, the column number to associate with the 219 * token (default = 0). 220 <p> 221 * 222</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 223The native C++ implementation of this method defines a default argument 224value. In the documentation generated for different libSBML language 225bindings, you may or may not see corresponding arguments in the method 226declarations. For example, in Java and C#, a default argument is handled by 227declaring two separate methods, with one of them having the argument and 228the other one lacking the argument. However, the libSBML documentation will 229be <em>identical</em> for both methods. Consequently, if you are reading 230this and do not see an argument even though one is described, please look 231for descriptions of other variants of this method near where this one 232appears in the documentation. 233</dd></dl> 234 235 */ public 236 XMLToken(XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line) throws org.sbml.libsbml.XMLConstructorException { 237 this(libsbmlJNI.new_XMLToken__SWIG_2(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes, XMLNamespaces.getCPtr(namespaces), namespaces, line), true); 238 } 239 240 241/** 242 * Creates an XML start element with attributes and namespace declarations. 243 <p> 244 * @param triple an {@link XMLTriple} object describing the start tag. 245 <p> 246 * @param attributes {@link XMLAttributes}, the attributes to set on the element to 247 * be created. 248 <p> 249 * @param namespaces {@link XMLNamespaces}, the namespaces to set on the element to 250 * be created. 251 <p> 252 * @param line a long integer, the line number to associate with the 253 * token (default = 0). 254 <p> 255 * @param column a long integer, the column number to associate with the 256 * token (default = 0). 257 <p> 258 * 259</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 260The native C++ implementation of this method defines a default argument 261value. In the documentation generated for different libSBML language 262bindings, you may or may not see corresponding arguments in the method 263declarations. For example, in Java and C#, a default argument is handled by 264declaring two separate methods, with one of them having the argument and 265the other one lacking the argument. However, the libSBML documentation will 266be <em>identical</em> for both methods. Consequently, if you are reading 267this and do not see an argument even though one is described, please look 268for descriptions of other variants of this method near where this one 269appears in the documentation. 270</dd></dl> 271 272 */ public 273 XMLToken(XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces) throws org.sbml.libsbml.XMLConstructorException { 274 this(libsbmlJNI.new_XMLToken__SWIG_3(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes, XMLNamespaces.getCPtr(namespaces), namespaces), true); 275 } 276 277 278/** 279 * Creates an XML start element with attributes. 280 <p> 281 * @param triple an {@link XMLTriple} object describing the start tag. 282 <p> 283 * @param attributes {@link XMLAttributes}, the attributes to set on the element to 284 * be created. 285 <p> 286 * @param line a long integer, the line number to associate with the 287 * token (default = 0). 288 <p> 289 * @param column a long integer, the column number to associate with the 290 * token (default = 0). 291 <p> 292 * The XML namespace component of this {@link XMLToken} object will be left empty. 293 * See the other variants of the {@link XMLToken} constructors for versions that 294 * take namespace arguments. 295 <p> 296 * 297</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 298The native C++ implementation of this method defines a default argument 299value. In the documentation generated for different libSBML language 300bindings, you may or may not see corresponding arguments in the method 301declarations. For example, in Java and C#, a default argument is handled by 302declaring two separate methods, with one of them having the argument and 303the other one lacking the argument. However, the libSBML documentation will 304be <em>identical</em> for both methods. Consequently, if you are reading 305this and do not see an argument even though one is described, please look 306for descriptions of other variants of this method near where this one 307appears in the documentation. 308</dd></dl> 309 310 */ public 311 XMLToken(XMLTriple triple, XMLAttributes attributes, long line, long column) throws org.sbml.libsbml.XMLConstructorException { 312 this(libsbmlJNI.new_XMLToken__SWIG_4(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes, line, column), true); 313 } 314 315 316/** 317 * Creates an XML start element with attributes. 318 <p> 319 * @param triple an {@link XMLTriple} object describing the start tag. 320 <p> 321 * @param attributes {@link XMLAttributes}, the attributes to set on the element to 322 * be created. 323 <p> 324 * @param line a long integer, the line number to associate with the 325 * token (default = 0). 326 <p> 327 * @param column a long integer, the column number to associate with the 328 * token (default = 0). 329 <p> 330 * The XML namespace component of this {@link XMLToken} object will be left empty. 331 * See the other variants of the {@link XMLToken} constructors for versions that 332 * take namespace arguments. 333 <p> 334 * 335</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 336The native C++ implementation of this method defines a default argument 337value. In the documentation generated for different libSBML language 338bindings, you may or may not see corresponding arguments in the method 339declarations. For example, in Java and C#, a default argument is handled by 340declaring two separate methods, with one of them having the argument and 341the other one lacking the argument. However, the libSBML documentation will 342be <em>identical</em> for both methods. Consequently, if you are reading 343this and do not see an argument even though one is described, please look 344for descriptions of other variants of this method near where this one 345appears in the documentation. 346</dd></dl> 347 348 */ public 349 XMLToken(XMLTriple triple, XMLAttributes attributes, long line) throws org.sbml.libsbml.XMLConstructorException { 350 this(libsbmlJNI.new_XMLToken__SWIG_5(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes, line), true); 351 } 352 353 354/** 355 * Creates an XML start element with attributes. 356 <p> 357 * @param triple an {@link XMLTriple} object describing the start tag. 358 <p> 359 * @param attributes {@link XMLAttributes}, the attributes to set on the element to 360 * be created. 361 <p> 362 * @param line a long integer, the line number to associate with the 363 * token (default = 0). 364 <p> 365 * @param column a long integer, the column number to associate with the 366 * token (default = 0). 367 <p> 368 * The XML namespace component of this {@link XMLToken} object will be left empty. 369 * See the other variants of the {@link XMLToken} constructors for versions that 370 * take namespace arguments. 371 <p> 372 * 373</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 374The native C++ implementation of this method defines a default argument 375value. In the documentation generated for different libSBML language 376bindings, you may or may not see corresponding arguments in the method 377declarations. For example, in Java and C#, a default argument is handled by 378declaring two separate methods, with one of them having the argument and 379the other one lacking the argument. However, the libSBML documentation will 380be <em>identical</em> for both methods. Consequently, if you are reading 381this and do not see an argument even though one is described, please look 382for descriptions of other variants of this method near where this one 383appears in the documentation. 384</dd></dl> 385 386 */ public 387 XMLToken(XMLTriple triple, XMLAttributes attributes) throws org.sbml.libsbml.XMLConstructorException { 388 this(libsbmlJNI.new_XMLToken__SWIG_6(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes), true); 389 } 390 391 392/** 393 * Creates an XML end element. 394 <p> 395 * @param triple an {@link XMLTriple} object describing the end tag. 396 <p> 397 * @param line a long integer, the line number to associate with the 398 * token (default = 0). 399 <p> 400 * @param column a long integer, the column number to associate with the 401 * token (default = 0). 402 <p> 403 * 404</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 405The native C++ implementation of this method defines a default argument 406value. In the documentation generated for different libSBML language 407bindings, you may or may not see corresponding arguments in the method 408declarations. For example, in Java and C#, a default argument is handled by 409declaring two separate methods, with one of them having the argument and 410the other one lacking the argument. However, the libSBML documentation will 411be <em>identical</em> for both methods. Consequently, if you are reading 412this and do not see an argument even though one is described, please look 413for descriptions of other variants of this method near where this one 414appears in the documentation. 415</dd></dl> 416 417 */ public 418 XMLToken(XMLTriple triple, long line, long column) throws org.sbml.libsbml.XMLConstructorException { 419 this(libsbmlJNI.new_XMLToken__SWIG_7(XMLTriple.getCPtr(triple), triple, line, column), true); 420 } 421 422 423/** 424 * Creates an XML end element. 425 <p> 426 * @param triple an {@link XMLTriple} object describing the end tag. 427 <p> 428 * @param line a long integer, the line number to associate with the 429 * token (default = 0). 430 <p> 431 * @param column a long integer, the column number to associate with the 432 * token (default = 0). 433 <p> 434 * 435</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 436The native C++ implementation of this method defines a default argument 437value. In the documentation generated for different libSBML language 438bindings, you may or may not see corresponding arguments in the method 439declarations. For example, in Java and C#, a default argument is handled by 440declaring two separate methods, with one of them having the argument and 441the other one lacking the argument. However, the libSBML documentation will 442be <em>identical</em> for both methods. Consequently, if you are reading 443this and do not see an argument even though one is described, please look 444for descriptions of other variants of this method near where this one 445appears in the documentation. 446</dd></dl> 447 448 */ public 449 XMLToken(XMLTriple triple, long line) throws org.sbml.libsbml.XMLConstructorException { 450 this(libsbmlJNI.new_XMLToken__SWIG_8(XMLTriple.getCPtr(triple), triple, line), true); 451 } 452 453 454/** 455 * Creates an XML end element. 456 <p> 457 * @param triple an {@link XMLTriple} object describing the end tag. 458 <p> 459 * @param line a long integer, the line number to associate with the 460 * token (default = 0). 461 <p> 462 * @param column a long integer, the column number to associate with the 463 * token (default = 0). 464 <p> 465 * 466</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 467The native C++ implementation of this method defines a default argument 468value. In the documentation generated for different libSBML language 469bindings, you may or may not see corresponding arguments in the method 470declarations. For example, in Java and C#, a default argument is handled by 471declaring two separate methods, with one of them having the argument and 472the other one lacking the argument. However, the libSBML documentation will 473be <em>identical</em> for both methods. Consequently, if you are reading 474this and do not see an argument even though one is described, please look 475for descriptions of other variants of this method near where this one 476appears in the documentation. 477</dd></dl> 478 479 */ public 480 XMLToken(XMLTriple triple) throws org.sbml.libsbml.XMLConstructorException { 481 this(libsbmlJNI.new_XMLToken__SWIG_9(XMLTriple.getCPtr(triple), triple), true); 482 } 483 484 485/** 486 * Creates a text object. 487 <p> 488 * @param chars a string, the text to be added to the {@link XMLToken} object. 489 <p> 490 * @param line a long integer, the line number to associate with the 491 * token (default = 0). 492 <p> 493 * @param column a long integer, the column number to associate with the 494 * token (default = 0). 495 <p> 496 * 497</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 498The native C++ implementation of this method defines a default argument 499value. In the documentation generated for different libSBML language 500bindings, you may or may not see corresponding arguments in the method 501declarations. For example, in Java and C#, a default argument is handled by 502declaring two separate methods, with one of them having the argument and 503the other one lacking the argument. However, the libSBML documentation will 504be <em>identical</em> for both methods. Consequently, if you are reading 505this and do not see an argument even though one is described, please look 506for descriptions of other variants of this method near where this one 507appears in the documentation. 508</dd></dl> 509 510 */ public 511 XMLToken(String chars, long line, long column) throws org.sbml.libsbml.XMLConstructorException { 512 this(libsbmlJNI.new_XMLToken__SWIG_10(chars, line, column), true); 513 } 514 515 516/** 517 * Creates a text object. 518 <p> 519 * @param chars a string, the text to be added to the {@link XMLToken} object. 520 <p> 521 * @param line a long integer, the line number to associate with the 522 * token (default = 0). 523 <p> 524 * @param column a long integer, the column number to associate with the 525 * token (default = 0). 526 <p> 527 * 528</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 529The native C++ implementation of this method defines a default argument 530value. In the documentation generated for different libSBML language 531bindings, you may or may not see corresponding arguments in the method 532declarations. For example, in Java and C#, a default argument is handled by 533declaring two separate methods, with one of them having the argument and 534the other one lacking the argument. However, the libSBML documentation will 535be <em>identical</em> for both methods. Consequently, if you are reading 536this and do not see an argument even though one is described, please look 537for descriptions of other variants of this method near where this one 538appears in the documentation. 539</dd></dl> 540 541 */ public 542 XMLToken(String chars, long line) throws org.sbml.libsbml.XMLConstructorException { 543 this(libsbmlJNI.new_XMLToken__SWIG_11(chars, line), true); 544 } 545 546 547/** 548 * Creates a text object. 549 <p> 550 * @param chars a string, the text to be added to the {@link XMLToken} object. 551 <p> 552 * @param line a long integer, the line number to associate with the 553 * token (default = 0). 554 <p> 555 * @param column a long integer, the column number to associate with the 556 * token (default = 0). 557 <p> 558 * 559</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 560The native C++ implementation of this method defines a default argument 561value. In the documentation generated for different libSBML language 562bindings, you may or may not see corresponding arguments in the method 563declarations. For example, in Java and C#, a default argument is handled by 564declaring two separate methods, with one of them having the argument and 565the other one lacking the argument. However, the libSBML documentation will 566be <em>identical</em> for both methods. Consequently, if you are reading 567this and do not see an argument even though one is described, please look 568for descriptions of other variants of this method near where this one 569appears in the documentation. 570</dd></dl> 571 572 */ public 573 XMLToken(String chars) throws org.sbml.libsbml.XMLConstructorException { 574 this(libsbmlJNI.new_XMLToken__SWIG_12(chars), true); 575 } 576 577 578/** 579 * Copy constructor; creates a copy of this {@link XMLToken} object. 580 <p> 581 * @param orig the {@link XMLToken} object to copy. 582 */ public 583 XMLToken(XMLToken orig) throws org.sbml.libsbml.XMLConstructorException { 584 this(libsbmlJNI.new_XMLToken__SWIG_13(XMLToken.getCPtr(orig), orig), true); 585 } 586 587 588/** 589 * Creates and returns a deep copy of this {@link XMLToken} object. 590 <p> 591 * @return the (deep) copy of this {@link XMLToken} object. 592 */ public 593 XMLToken cloneObject() { 594 long cPtr = libsbmlJNI.XMLToken_cloneObject(swigCPtr, this); 595 return (cPtr == 0) ? null : new XMLToken(cPtr, true); 596 } 597 598 599/** 600 * Returns the attributes of the XML element represented by this token. 601 <p> 602 * @return the attributes of this XML element, stored in an {@link XMLAttributes} 603 * object. 604 */ public 605 XMLAttributes getAttributes() { 606 return new XMLAttributes(libsbmlJNI.XMLToken_getAttributes(swigCPtr, this), false); 607 } 608 609 610/** 611 * Sets the attributes on the XML element represented by this token. 612 <p> 613 * <p> 614 * This operation only makes sense for XML start elements. This 615 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 616 * element. 617 <p> 618 * @param attributes an {@link XMLAttributes} object to be assigned to this 619 * {@link XMLToken} object, thereby setting the XML attributes associated with this 620 * token. 621 <p> 622 * <p> 623 * @return integer value indicating success/failure of the 624 * function. The possible values 625 * returned by this function are: 626 * <ul> 627 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 628 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 629 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 630 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 631 * 632 * </ul> <p> 633 * @note This function replaces any existing {@link XMLAttributes} object 634 * on this {@link XMLToken} object with the one given by <code>attributes</code>. 635 */ public 636 int setAttributes(XMLAttributes attributes) { 637 return libsbmlJNI.XMLToken_setAttributes(swigCPtr, this, XMLAttributes.getCPtr(attributes), attributes); 638 } 639 640 641/** 642 * Adds an attribute to the XML element represented by this token. 643 <p> 644 * <p> 645 * This operation only makes sense for XML start elements. This 646 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 647 * element. 648 <p> 649 * @param name a string, the so-called 'local part' of the attribute name; 650 * that is, the attribute name without any namespace qualifier or prefix. 651 <p> 652 * @param value a string, the value assigned to the attribute. 653 <p> 654 * @param namespaceURI a string, the XML namespace URI of the attribute. 655 <p> 656 * @param prefix a string, the prefix for the XML namespace. 657 <p> 658 * Recall that in XML, the complete form of an attribute on an XML element 659 * is the following: 660 * <center> 661 * <code>prefix:name='value'</code> 662 * </center> 663 * The <code>name</code> part is the name of the attribute, the 664 * <code>'value'</code> part is the value assigned to the attribute (and 665 * it is always a quoted string), and the <code>prefix</code> part is 666 * an optional XML namespace prefix. Internally in libSBML, this data 667 * is stored in an {@link XMLAttributes} object associated with this {@link XMLToken}. 668 <p> 669 * <p> 670 * @return integer value indicating success/failure of the 671 * function. The possible values 672 * returned by this function are: 673 * <ul> 674 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 675 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 676 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 677 * 678 * </ul> <p> 679 * <p> 680 * @note If an attribute with the same name and XML namespace URI already 681 * exists on this {@link XMLToken} object, then the previous value will be replaced 682 * with the new value provided to this method. 683 <p> 684 * 685</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 686The native C++ implementation of this method defines a default argument 687value. In the documentation generated for different libSBML language 688bindings, you may or may not see corresponding arguments in the method 689declarations. For example, in Java and C#, a default argument is handled by 690declaring two separate methods, with one of them having the argument and 691the other one lacking the argument. However, the libSBML documentation will 692be <em>identical</em> for both methods. Consequently, if you are reading 693this and do not see an argument even though one is described, please look 694for descriptions of other variants of this method near where this one 695appears in the documentation. 696</dd></dl> 697 698 */ public 699 int addAttr(String name, String value, String namespaceURI, String prefix) { 700 return libsbmlJNI.XMLToken_addAttr__SWIG_0(swigCPtr, this, name, value, namespaceURI, prefix); 701 } 702 703 704/** 705 * Adds an attribute to the XML element represented by this token. 706 <p> 707 * <p> 708 * This operation only makes sense for XML start elements. This 709 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 710 * element. 711 <p> 712 * @param name a string, the so-called 'local part' of the attribute name; 713 * that is, the attribute name without any namespace qualifier or prefix. 714 <p> 715 * @param value a string, the value assigned to the attribute. 716 <p> 717 * @param namespaceURI a string, the XML namespace URI of the attribute. 718 <p> 719 * @param prefix a string, the prefix for the XML namespace. 720 <p> 721 * Recall that in XML, the complete form of an attribute on an XML element 722 * is the following: 723 * <center> 724 * <code>prefix:name='value'</code> 725 * </center> 726 * The <code>name</code> part is the name of the attribute, the 727 * <code>'value'</code> part is the value assigned to the attribute (and 728 * it is always a quoted string), and the <code>prefix</code> part is 729 * an optional XML namespace prefix. Internally in libSBML, this data 730 * is stored in an {@link XMLAttributes} object associated with this {@link XMLToken}. 731 <p> 732 * <p> 733 * @return integer value indicating success/failure of the 734 * function. The possible values 735 * returned by this function are: 736 * <ul> 737 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 738 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 739 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 740 * 741 * </ul> <p> 742 * <p> 743 * @note If an attribute with the same name and XML namespace URI already 744 * exists on this {@link XMLToken} object, then the previous value will be replaced 745 * with the new value provided to this method. 746 <p> 747 * 748</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 749The native C++ implementation of this method defines a default argument 750value. In the documentation generated for different libSBML language 751bindings, you may or may not see corresponding arguments in the method 752declarations. For example, in Java and C#, a default argument is handled by 753declaring two separate methods, with one of them having the argument and 754the other one lacking the argument. However, the libSBML documentation will 755be <em>identical</em> for both methods. Consequently, if you are reading 756this and do not see an argument even though one is described, please look 757for descriptions of other variants of this method near where this one 758appears in the documentation. 759</dd></dl> 760 761 */ public 762 int addAttr(String name, String value, String namespaceURI) { 763 return libsbmlJNI.XMLToken_addAttr__SWIG_1(swigCPtr, this, name, value, namespaceURI); 764 } 765 766 767/** 768 * Adds an attribute to the XML element represented by this token. 769 <p> 770 * <p> 771 * This operation only makes sense for XML start elements. This 772 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 773 * element. 774 <p> 775 * @param name a string, the so-called 'local part' of the attribute name; 776 * that is, the attribute name without any namespace qualifier or prefix. 777 <p> 778 * @param value a string, the value assigned to the attribute. 779 <p> 780 * @param namespaceURI a string, the XML namespace URI of the attribute. 781 <p> 782 * @param prefix a string, the prefix for the XML namespace. 783 <p> 784 * Recall that in XML, the complete form of an attribute on an XML element 785 * is the following: 786 * <center> 787 * <code>prefix:name='value'</code> 788 * </center> 789 * The <code>name</code> part is the name of the attribute, the 790 * <code>'value'</code> part is the value assigned to the attribute (and 791 * it is always a quoted string), and the <code>prefix</code> part is 792 * an optional XML namespace prefix. Internally in libSBML, this data 793 * is stored in an {@link XMLAttributes} object associated with this {@link XMLToken}. 794 <p> 795 * <p> 796 * @return integer value indicating success/failure of the 797 * function. The possible values 798 * returned by this function are: 799 * <ul> 800 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 801 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 802 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 803 * 804 * </ul> <p> 805 * <p> 806 * @note If an attribute with the same name and XML namespace URI already 807 * exists on this {@link XMLToken} object, then the previous value will be replaced 808 * with the new value provided to this method. 809 <p> 810 * 811</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 812The native C++ implementation of this method defines a default argument 813value. In the documentation generated for different libSBML language 814bindings, you may or may not see corresponding arguments in the method 815declarations. For example, in Java and C#, a default argument is handled by 816declaring two separate methods, with one of them having the argument and 817the other one lacking the argument. However, the libSBML documentation will 818be <em>identical</em> for both methods. Consequently, if you are reading 819this and do not see an argument even though one is described, please look 820for descriptions of other variants of this method near where this one 821appears in the documentation. 822</dd></dl> 823 824 */ public 825 int addAttr(String name, String value) { 826 return libsbmlJNI.XMLToken_addAttr__SWIG_2(swigCPtr, this, name, value); 827 } 828 829 830/** 831 * Adds an attribute to the XML element represented by this token. 832 <p> 833 * <p> 834 * This operation only makes sense for XML start elements. This 835 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 836 * element. 837 <p> 838 * @param triple an {@link XMLTriple} object defining the attribute, its value, 839 * and optionally its XML namespace (if any is provided). 840 <p> 841 * @param value a string, the value assigned to the attribute. 842 <p> 843 * <p> 844 * @return integer value indicating success/failure of the 845 * function. The possible values 846 * returned by this function are: 847 * <ul> 848 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 849 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 850 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 851 * 852 * </ul> <p> 853 * <p> 854 * @note If an attribute with the same name and XML namespace URI already 855 * exists on this {@link XMLToken} object, then the previous value will be replaced 856 * with the new value provided to this method. 857 */ public 858 int addAttr(XMLTriple triple, String value) { 859 return libsbmlJNI.XMLToken_addAttr__SWIG_3(swigCPtr, this, XMLTriple.getCPtr(triple), triple, value); 860 } 861 862 863/** 864 * Removes the <em>n</em>th attribute from the XML element represented by 865 * this token. 866 <p> 867 * <p> 868 * This operation only makes sense for XML start elements. This 869 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 870 * element. 871 <p> 872 * @param n an integer the index of the resource to be deleted 873 <p> 874 * <p> 875 * @return integer value indicating success/failure of the 876 * function. The possible values 877 * returned by this function are: 878 * <ul> 879 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 880 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 881 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE} 882 * 883 * </ul> <p> 884 * The value {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE} is returned if there is no attribute on this 885 * element at the given index <code>n</code>. 886 <p> 887 * @see #getAttrIndex(XMLTriple triple) 888 * @see #getAttrIndex(String name, String uri) 889 * @see #getAttributesLength() 890 */ public 891 int removeAttr(int n) { 892 return libsbmlJNI.XMLToken_removeAttr__SWIG_0(swigCPtr, this, n); 893 } 894 895 896/** 897 * Removes an attribute from the XML element represented by this token. 898 <p> 899 * <p> 900 * This operation only makes sense for XML start elements. This 901 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 902 * element. 903 <p> 904 * @param name a string, the name of the attribute to be removed. 905 * @param uri a string, the XML namespace URI of the attribute to be removed. 906 <p> 907 * <p> 908 * @return integer value indicating success/failure of the 909 * function. The possible values 910 * returned by this function are: 911 * <ul> 912 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 913 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 914 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE} 915 * 916 * </ul> <p> 917 * The value {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE} is returned if there is no attribute on this 918 * element with the given <code>name</code> (and <code>uri</code> if specified). 919 <p> 920 * @see #hasAttr(String name, String uri) 921 */ public 922 int removeAttr(String name, String uri) { 923 return libsbmlJNI.XMLToken_removeAttr__SWIG_1(swigCPtr, this, name, uri); 924 } 925 926 927/** 928 * Removes an attribute from the XML element represented by this token. 929 <p> 930 * <p> 931 * This operation only makes sense for XML start elements. This 932 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 933 * element. 934 <p> 935 * @param name a string, the name of the attribute to be removed. 936 * @param uri a string, the XML namespace URI of the attribute to be removed. 937 <p> 938 * <p> 939 * @return integer value indicating success/failure of the 940 * function. The possible values 941 * returned by this function are: 942 * <ul> 943 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 944 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 945 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE} 946 * 947 * </ul> <p> 948 * The value {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE} is returned if there is no attribute on this 949 * element with the given <code>name</code> (and <code>uri</code> if specified). 950 <p> 951 * @see #hasAttr(String name, String uri) 952 */ public 953 int removeAttr(String name) { 954 return libsbmlJNI.XMLToken_removeAttr__SWIG_2(swigCPtr, this, name); 955 } 956 957 958/** 959 * Removes an attribute from the XML element represented by this token. 960 <p> 961 * <p> 962 * This operation only makes sense for XML start elements. This 963 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 964 * element. 965 <p> 966 * @param triple an {@link XMLTriple} describing the attribute to be removed. 967 <p> 968 * <p> 969 * @return integer value indicating success/failure of the 970 * function. The possible values 971 * returned by this function are: 972 * <ul> 973 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 974 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 975 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE} 976 * 977 * </ul> <p> 978 * The value {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE} is returned if there is no attribute on this 979 * element matching the properties of the given <code>triple</code>. 980 <p> 981 * @see #hasAttr(XMLTriple triple) 982 */ public 983 int removeAttr(XMLTriple triple) { 984 return libsbmlJNI.XMLToken_removeAttr__SWIG_3(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 985 } 986 987 988/** 989 * Removes all attributes of this {@link XMLToken} object. 990 <p> 991 * <p> 992 * This operation only makes sense for XML start elements. This 993 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 994 * element. 995 <p> 996 * <p> 997 * @return integer value indicating success/failure of the 998 * function. The possible values 999 * returned by this function are: 1000 * <ul> 1001 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1002 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 1003 * </ul> 1004 */ public 1005 int clearAttributes() { 1006 return libsbmlJNI.XMLToken_clearAttributes(swigCPtr, this); 1007 } 1008 1009 1010/** 1011 * Returns the index of the attribute with the given name and namespace 1012 * URI. 1013 <p> 1014 * @param name a string, the name of the attribute. 1015 * @param uri a string, the namespace URI of the attribute. 1016 <p> 1017 * @return the index of an attribute with the given local name and 1018 * namespace URI, or <code>-1</code> if it is not present on this token. 1019 <p> 1020 * 1021</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1022The native C++ implementation of this method defines a default argument 1023value. In the documentation generated for different libSBML language 1024bindings, you may or may not see corresponding arguments in the method 1025declarations. For example, in Java and C#, a default argument is handled by 1026declaring two separate methods, with one of them having the argument and 1027the other one lacking the argument. However, the libSBML documentation will 1028be <em>identical</em> for both methods. Consequently, if you are reading 1029this and do not see an argument even though one is described, please look 1030for descriptions of other variants of this method near where this one 1031appears in the documentation. 1032</dd></dl> 1033 1034 */ public 1035 int getAttrIndex(String name, String uri) { 1036 return libsbmlJNI.XMLToken_getAttrIndex__SWIG_0(swigCPtr, this, name, uri); 1037 } 1038 1039 1040/** 1041 * Returns the index of the attribute with the given name and namespace 1042 * URI. 1043 <p> 1044 * @param name a string, the name of the attribute. 1045 * @param uri a string, the namespace URI of the attribute. 1046 <p> 1047 * @return the index of an attribute with the given local name and 1048 * namespace URI, or <code>-1</code> if it is not present on this token. 1049 <p> 1050 * 1051</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1052The native C++ implementation of this method defines a default argument 1053value. In the documentation generated for different libSBML language 1054bindings, you may or may not see corresponding arguments in the method 1055declarations. For example, in Java and C#, a default argument is handled by 1056declaring two separate methods, with one of them having the argument and 1057the other one lacking the argument. However, the libSBML documentation will 1058be <em>identical</em> for both methods. Consequently, if you are reading 1059this and do not see an argument even though one is described, please look 1060for descriptions of other variants of this method near where this one 1061appears in the documentation. 1062</dd></dl> 1063 1064 */ public 1065 int getAttrIndex(String name) { 1066 return libsbmlJNI.XMLToken_getAttrIndex__SWIG_1(swigCPtr, this, name); 1067 } 1068 1069 1070/** 1071 * Returns the index of the attribute defined by the given {@link XMLTriple} 1072 * object. 1073 <p> 1074 * @param triple the {@link XMLTriple} object that defines the attribute whose 1075 * index is being sought. 1076 <p> 1077 * @return the index of an attribute with the given {@link XMLTriple} object, or 1078 * <code>-1</code> if no such attribute is present on this token. 1079 */ public 1080 int getAttrIndex(XMLTriple triple) { 1081 return libsbmlJNI.XMLToken_getAttrIndex__SWIG_2(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 1082 } 1083 1084 1085/** 1086 * Returns the number of attributes on this {@link XMLToken} object. 1087 <p> 1088 * @return the number of attributes possessed by this token. 1089 <p> 1090 * @see #hasAttr(int) 1091 */ public 1092 int getAttributesLength() { 1093 return libsbmlJNI.XMLToken_getAttributesLength(swigCPtr, this); 1094 } 1095 1096 1097/** 1098 * Returns the name of the <em>n</em>th attribute in this token's list of 1099 * attributes. 1100 <p> 1101 * @param index an integer, the position of the attribute whose name 1102 * is being sought. 1103 <p> 1104 * @return the name of the attribute located at position <code>n</code> in the list 1105 * of attributes possessed by this {@link XMLToken} object. 1106 <p> 1107 * <p> 1108 * @note If <code>index</code> is out of range, this method will return an empty 1109 * string. {@link XMLToken#hasAttr(int)} can be used to test for an 1110 * attribute's existence explicitly, and {@link XMLToken#getAttributesLength()} can 1111 * be used to find out the number of attributes possessed by this token. 1112 <p> 1113 * @see #hasAttr(int) 1114 * @see #getAttributesLength() 1115 */ public 1116 String getAttrName(int index) { 1117 return libsbmlJNI.XMLToken_getAttrName(swigCPtr, this, index); 1118 } 1119 1120 1121/** 1122 * Returns the prefix of the <em>n</em>th attribute in this token's list of 1123 * attributes. 1124 <p> 1125 * @param index an integer, the position of the attribute whose prefix is 1126 * being sought. 1127 <p> 1128 * @return the XML namespace prefix of the attribute located at position 1129 * <code>n</code> in the list of attributes possessed by this {@link XMLToken} object. 1130 <p> 1131 * <p> 1132 * @note If <code>index</code> is out of range, this method will return an empty 1133 * string. {@link XMLToken#hasAttr(int)} can be used to test for an 1134 * attribute's existence explicitly, and {@link XMLToken#getAttributesLength()} can 1135 * be used to find out the number of attributes possessed by this token. 1136 <p> 1137 * @see #hasAttr(int) 1138 * @see #getAttributesLength() 1139 */ public 1140 String getAttrPrefix(int index) { 1141 return libsbmlJNI.XMLToken_getAttrPrefix(swigCPtr, this, index); 1142 } 1143 1144 1145/** 1146 * Returns the prefixed name of the <em>n</em>th attribute in this token's 1147 * list of attributes. 1148 <p> 1149 * In this context, <em>prefixed name</em> means the name of the attribute 1150 * prefixed with the XML namespace prefix assigned to the attribute. This 1151 * will be a string of the form <code>prefix:name</code>. 1152 <p> 1153 * @param index an integer, the position of the attribute whose prefixed 1154 * name is being sought. 1155 <p> 1156 * @return the prefixed name of the attribute located at position 1157 * <code>n</code> in the list of attributes possessed by this {@link XMLToken} object. 1158 <p> 1159 * <p> 1160 * @note If <code>index</code> is out of range, this method will return an empty 1161 * string. {@link XMLToken#hasAttr(int)} can be used to test for an 1162 * attribute's existence explicitly, and {@link XMLToken#getAttributesLength()} can 1163 * be used to find out the number of attributes possessed by this token. 1164 */ public 1165 String getAttrPrefixedName(int index) { 1166 return libsbmlJNI.XMLToken_getAttrPrefixedName(swigCPtr, this, index); 1167 } 1168 1169 1170/** 1171 * Returns the XML namespace URI of the <em>n</em>th attribute in this 1172 * token's list of attributes. 1173 <p> 1174 * @param index an integer, the position of the attribute whose namespace 1175 * URI is being sought. 1176 <p> 1177 * @return the XML namespace URI of the attribute located at position <code>n</code> 1178 * in the list of attributes possessed by this {@link XMLToken} object. 1179 <p> 1180 * <p> 1181 * @note If <code>index</code> is out of range, this method will return an empty 1182 * string. {@link XMLToken#hasAttr(int)} can be used to test for an 1183 * attribute's existence explicitly, and {@link XMLToken#getAttributesLength()} can 1184 * be used to find out the number of attributes possessed by this token. 1185 */ public 1186 String getAttrURI(int index) { 1187 return libsbmlJNI.XMLToken_getAttrURI(swigCPtr, this, index); 1188 } 1189 1190 1191/** 1192 * Returns the value of the <em>n</em>th attribute in this token's list of 1193 * attributes. 1194 <p> 1195 * @param index an integer, the position of the attribute whose value is 1196 * required. 1197 <p> 1198 * @return the value of the attribute located at position <code>n</code> in the list 1199 * of attributes possessed by this {@link XMLToken} object. 1200 <p> 1201 * <p> 1202 * @note If <code>index</code> is out of range, this method will return an empty 1203 * string. {@link XMLToken#hasAttr(int)} can be used to test for an 1204 * attribute's existence explicitly, and {@link XMLToken#getAttributesLength()} can 1205 * be used to find out the number of attributes possessed by this token. 1206 */ public 1207 String getAttrValue(int index) { 1208 return libsbmlJNI.XMLToken_getAttrValue__SWIG_0(swigCPtr, this, index); 1209 } 1210 1211 1212/** 1213 * Returns the value of the attribute with a given name and XML namespace URI. 1214 <p> 1215 * @param name a string, the name of the attribute whose value is being 1216 * sought. 1217 <p> 1218 * @param uri a string, the XML namespace URI of the attribute. 1219 <p> 1220 * @return The value of the attribute, as a string. 1221 <p> 1222 * @note If an attribute with the given <code>name</code> and <code>uri</code> does not exist 1223 * on this token object, this method will return an empty string. 1224 * {@link XMLToken#hasAttr(String, String)} can be used to test 1225 * explicitly for the presence of an attribute with a given name and 1226 * namespace. 1227 <p> 1228 * 1229</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1230The native C++ implementation of this method defines a default argument 1231value. In the documentation generated for different libSBML language 1232bindings, you may or may not see corresponding arguments in the method 1233declarations. For example, in Java and C#, a default argument is handled by 1234declaring two separate methods, with one of them having the argument and 1235the other one lacking the argument. However, the libSBML documentation will 1236be <em>identical</em> for both methods. Consequently, if you are reading 1237this and do not see an argument even though one is described, please look 1238for descriptions of other variants of this method near where this one 1239appears in the documentation. 1240</dd></dl> 1241 1242 */ public 1243 String getAttrValue(String name, String uri) { 1244 return libsbmlJNI.XMLToken_getAttrValue__SWIG_1(swigCPtr, this, name, uri); 1245 } 1246 1247 1248/** 1249 * Returns the value of the attribute with a given name and XML namespace URI. 1250 <p> 1251 * @param name a string, the name of the attribute whose value is being 1252 * sought. 1253 <p> 1254 * @param uri a string, the XML namespace URI of the attribute. 1255 <p> 1256 * @return The value of the attribute, as a string. 1257 <p> 1258 * @note If an attribute with the given <code>name</code> and <code>uri</code> does not exist 1259 * on this token object, this method will return an empty string. 1260 * {@link XMLToken#hasAttr(String, String)} can be used to test 1261 * explicitly for the presence of an attribute with a given name and 1262 * namespace. 1263 <p> 1264 * 1265</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1266The native C++ implementation of this method defines a default argument 1267value. In the documentation generated for different libSBML language 1268bindings, you may or may not see corresponding arguments in the method 1269declarations. For example, in Java and C#, a default argument is handled by 1270declaring two separate methods, with one of them having the argument and 1271the other one lacking the argument. However, the libSBML documentation will 1272be <em>identical</em> for both methods. Consequently, if you are reading 1273this and do not see an argument even though one is described, please look 1274for descriptions of other variants of this method near where this one 1275appears in the documentation. 1276</dd></dl> 1277 1278 */ public 1279 String getAttrValue(String name) { 1280 return libsbmlJNI.XMLToken_getAttrValue__SWIG_2(swigCPtr, this, name); 1281 } 1282 1283 1284/** 1285 * Returns the value of the attribute specified by a given {@link XMLTriple} object. 1286 <p> 1287 * @param triple an {@link XMLTriple} describing the attribute whose value is being 1288 * sought. 1289 <p> 1290 * @return The value of the attribute, as a string. 1291 <p> 1292 * @note If an attribute defined by the given <code>triple</code> does not exist on 1293 * this token object, this method will return an empty string. 1294 * {@link XMLToken#hasAttr(XMLTriple)} can be used to test 1295 * explicitly for the existence of an attribute with the properties of 1296 * a given triple. 1297 */ public 1298 String getAttrValue(XMLTriple triple) { 1299 return libsbmlJNI.XMLToken_getAttrValue__SWIG_3(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 1300 } 1301 1302 1303/** 1304 * Returns <code>true</code> if an attribute with the given index exists. 1305 <p> 1306 * @param index an integer, the position of the attribute. 1307 <p> 1308 * @return <code>true</code> if this token object possesses an attribute with the 1309 * given index, <code>false</code> otherwise. 1310 */ public 1311 boolean hasAttr(int index) { 1312 return libsbmlJNI.XMLToken_hasAttr__SWIG_0(swigCPtr, this, index); 1313 } 1314 1315 1316/** 1317 * Returns <code>true</code> if an attribute with a given name and namespace URI 1318 * exists. 1319 <p> 1320 * @param name a string, the name of the attribute being sought. 1321 <p> 1322 * @param uri a string, the XML namespace URI of the attribute being 1323 * sought. 1324 <p> 1325 * @return <code>true</code> if an attribute with the given local name and namespace 1326 * URI exists in the list of attributes on this token object, <code>false</code> 1327 * otherwise. 1328 <p> 1329 * 1330</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1331The native C++ implementation of this method defines a default argument 1332value. In the documentation generated for different libSBML language 1333bindings, you may or may not see corresponding arguments in the method 1334declarations. For example, in Java and C#, a default argument is handled by 1335declaring two separate methods, with one of them having the argument and 1336the other one lacking the argument. However, the libSBML documentation will 1337be <em>identical</em> for both methods. Consequently, if you are reading 1338this and do not see an argument even though one is described, please look 1339for descriptions of other variants of this method near where this one 1340appears in the documentation. 1341</dd></dl> 1342 1343 */ public 1344 boolean hasAttr(String name, String uri) { 1345 return libsbmlJNI.XMLToken_hasAttr__SWIG_1(swigCPtr, this, name, uri); 1346 } 1347 1348 1349/** 1350 * Returns <code>true</code> if an attribute with a given name and namespace URI 1351 * exists. 1352 <p> 1353 * @param name a string, the name of the attribute being sought. 1354 <p> 1355 * @param uri a string, the XML namespace URI of the attribute being 1356 * sought. 1357 <p> 1358 * @return <code>true</code> if an attribute with the given local name and namespace 1359 * URI exists in the list of attributes on this token object, <code>false</code> 1360 * otherwise. 1361 <p> 1362 * 1363</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1364The native C++ implementation of this method defines a default argument 1365value. In the documentation generated for different libSBML language 1366bindings, you may or may not see corresponding arguments in the method 1367declarations. For example, in Java and C#, a default argument is handled by 1368declaring two separate methods, with one of them having the argument and 1369the other one lacking the argument. However, the libSBML documentation will 1370be <em>identical</em> for both methods. Consequently, if you are reading 1371this and do not see an argument even though one is described, please look 1372for descriptions of other variants of this method near where this one 1373appears in the documentation. 1374</dd></dl> 1375 1376 */ public 1377 boolean hasAttr(String name) { 1378 return libsbmlJNI.XMLToken_hasAttr__SWIG_2(swigCPtr, this, name); 1379 } 1380 1381 1382/** 1383 * Returns <code>true</code> if an attribute defined by a given {@link XMLTriple} object 1384 * exists. 1385 <p> 1386 * @param triple an {@link XMLTriple} object describing the attribute being sought. 1387 <p> 1388 * @return <code>true</code> if an attribute matching the properties of the given 1389 * {@link XMLTriple} object exists in the list of attributes on this token, 1390 * <code>false</code> otherwise. 1391 */ public 1392 boolean hasAttr(XMLTriple triple) { 1393 return libsbmlJNI.XMLToken_hasAttr__SWIG_3(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 1394 } 1395 1396 1397/** 1398 * Returns <code>true</code> if this token has no attributes. 1399 <p> 1400 * @return <code>true</code> if the list of attributes on {@link XMLToken} object is empty, 1401 * <code>false</code> otherwise. 1402 */ public 1403 boolean isAttributesEmpty() { 1404 return libsbmlJNI.XMLToken_isAttributesEmpty(swigCPtr, this); 1405 } 1406 1407 1408/** 1409 * Returns the XML namespaces declared for this token. 1410 <p> 1411 * @return the XML namespace declarations for this XML element. 1412 */ public 1413 XMLNamespaces getNamespaces() { 1414 return new XMLNamespaces(libsbmlJNI.XMLToken_getNamespaces(swigCPtr, this), false); 1415 } 1416 1417 1418/** 1419 * Sets the XML namespaces on this XML element. 1420 <p> 1421 * <p> 1422 * This operation only makes sense for XML start elements. This 1423 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 1424 * element. 1425 <p> 1426 * @param namespaces the {@link XMLNamespaces} object to be assigned to this {@link XMLToken} object. 1427 <p> 1428 * <p> 1429 * @return integer value indicating success/failure of the 1430 * function. The possible values 1431 * returned by this function are: 1432 * <ul> 1433 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1434 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1435 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 1436 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 1437 * 1438 * </ul> <p> 1439 * @note This function replaces any existing {@link XMLNamespaces} object on this 1440 * {@link XMLToken} object with the new one given by <code>namespaces</code>. 1441 */ public 1442 int setNamespaces(XMLNamespaces namespaces) { 1443 return libsbmlJNI.XMLToken_setNamespaces(swigCPtr, this, XMLNamespaces.getCPtr(namespaces), namespaces); 1444 } 1445 1446 1447/** 1448 * Appends an XML namespace declaration to this token. 1449 <p> 1450 * The namespace added will be defined by the given XML namespace URI and 1451 * an optional prefix. If this {@link XMLToken} object already possesses an XML 1452 * namespace declaration with the given <code>prefix</code>, then the existing XML 1453 * namespace URI will be overwritten by the new one given by <code>uri</code>. 1454 <p> 1455 * <p> 1456 * This operation only makes sense for XML start elements. This 1457 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 1458 * element. 1459 <p> 1460 * @param uri a string, the XML namespace URI for the namespace. 1461 <p> 1462 * @param prefix a string, the namespace prefix to use. 1463 <p> 1464 * <p> 1465 * @return integer value indicating success/failure of the 1466 * function. The possible values 1467 * returned by this function are: 1468 * <ul> 1469 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1470 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 1471 * 1472 * </ul> <p> 1473 * 1474</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1475The native C++ implementation of this method defines a default argument 1476value. In the documentation generated for different libSBML language 1477bindings, you may or may not see corresponding arguments in the method 1478declarations. For example, in Java and C#, a default argument is handled by 1479declaring two separate methods, with one of them having the argument and 1480the other one lacking the argument. However, the libSBML documentation will 1481be <em>identical</em> for both methods. Consequently, if you are reading 1482this and do not see an argument even though one is described, please look 1483for descriptions of other variants of this method near where this one 1484appears in the documentation. 1485</dd></dl> 1486 1487 */ public 1488 int addNamespace(String uri, String prefix) { 1489 return libsbmlJNI.XMLToken_addNamespace__SWIG_0(swigCPtr, this, uri, prefix); 1490 } 1491 1492 1493/** 1494 * Appends an XML namespace declaration to this token. 1495 <p> 1496 * The namespace added will be defined by the given XML namespace URI and 1497 * an optional prefix. If this {@link XMLToken} object already possesses an XML 1498 * namespace declaration with the given <code>prefix</code>, then the existing XML 1499 * namespace URI will be overwritten by the new one given by <code>uri</code>. 1500 <p> 1501 * <p> 1502 * This operation only makes sense for XML start elements. This 1503 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 1504 * element. 1505 <p> 1506 * @param uri a string, the XML namespace URI for the namespace. 1507 <p> 1508 * @param prefix a string, the namespace prefix to use. 1509 <p> 1510 * <p> 1511 * @return integer value indicating success/failure of the 1512 * function. The possible values 1513 * returned by this function are: 1514 * <ul> 1515 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1516 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 1517 * 1518 * </ul> <p> 1519 * 1520</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1521The native C++ implementation of this method defines a default argument 1522value. In the documentation generated for different libSBML language 1523bindings, you may or may not see corresponding arguments in the method 1524declarations. For example, in Java and C#, a default argument is handled by 1525declaring two separate methods, with one of them having the argument and 1526the other one lacking the argument. However, the libSBML documentation will 1527be <em>identical</em> for both methods. Consequently, if you are reading 1528this and do not see an argument even though one is described, please look 1529for descriptions of other variants of this method near where this one 1530appears in the documentation. 1531</dd></dl> 1532 1533 */ public 1534 int addNamespace(String uri) { 1535 return libsbmlJNI.XMLToken_addNamespace__SWIG_1(swigCPtr, this, uri); 1536 } 1537 1538 1539/** 1540 * Removes the <em>n</em>th XML namespace declaration. 1541 <p> 1542 * <p> 1543 * This operation only makes sense for XML start elements. This 1544 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 1545 * element. 1546 <p> 1547 * @param index an integer, the position of the namespace to be removed. 1548 * The position in this context refers to the position of the namespace in 1549 * the {@link XMLNamespaces} object stored in this {@link XMLToken} object. Callers can 1550 * use one of the <code>getNamespace___()</code> methods to find the index 1551 * number of a given namespace. 1552 <p> 1553 * <p> 1554 * @return integer value indicating success/failure of the 1555 * function. The possible values 1556 * returned by this function are: 1557 * <ul> 1558 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1559 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 1560 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE} 1561 * 1562 * </ul> <p> 1563 * @see #getNamespaceIndex(String uri) 1564 * @see #getNamespaceIndexByPrefix(String prefix) 1565 * @see #getNamespacesLength() 1566 */ public 1567 int removeNamespace(int index) { 1568 return libsbmlJNI.XMLToken_removeNamespace__SWIG_0(swigCPtr, this, index); 1569 } 1570 1571 1572/** 1573 * Removes an XML namespace declaration having a given prefix. 1574 <p> 1575 * <p> 1576 * This operation only makes sense for XML start elements. This 1577 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 1578 * element. 1579 <p> 1580 * @param prefix a string, the prefix of the namespace to be removed. 1581 <p> 1582 * <p> 1583 * @return integer value indicating success/failure of the 1584 * function. The possible values 1585 * returned by this function are: 1586 * <ul> 1587 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1588 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 1589 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE} 1590 * 1591 * </ul> <p> 1592 * The value {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE} 1593 * is returned if there is no namespace with the given <code>prefix</code> on this 1594 * element. 1595 <p> 1596 * @see #getNamespaceIndexByPrefix(String prefix) 1597 */ public 1598 int removeNamespace(String prefix) { 1599 return libsbmlJNI.XMLToken_removeNamespace__SWIG_1(swigCPtr, this, prefix); 1600 } 1601 1602 1603/** 1604 * Removes all XML namespace declarations from this token. 1605 <p> 1606 * <p> 1607 * This operation only makes sense for XML start elements. This 1608 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 1609 * element. 1610 <p> 1611 * <p> 1612 * @return integer value indicating success/failure of the 1613 * function. The possible values 1614 * returned by this function are: 1615 * <ul> 1616 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1617 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 1618 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1619 * </ul> 1620 */ public 1621 int clearNamespaces() { 1622 return libsbmlJNI.XMLToken_clearNamespaces(swigCPtr, this); 1623 } 1624 1625 1626/** 1627 * Returns the index of an XML namespace declaration based on its URI. 1628 <p> 1629 * @param uri a string, the XML namespace URI of the sought-after namespace. 1630 <p> 1631 * @return the index of the given declaration, or <code>-1</code> if 1632 * no such namespace URI is present on this {@link XMLToken} object. 1633 */ public 1634 int getNamespaceIndex(String uri) { 1635 return libsbmlJNI.XMLToken_getNamespaceIndex(swigCPtr, this, uri); 1636 } 1637 1638 1639/** 1640 * Returns the index of an XML namespace declaration based on its prefix. 1641 <p> 1642 * @param prefix a string, the prefix of the sought-after XML namespace. 1643 <p> 1644 * @return the index of the given declaration, or <code>-1</code> if 1645 * no such namespace URI is present on this {@link XMLToken} object. 1646 */ public 1647 int getNamespaceIndexByPrefix(String prefix) { 1648 return libsbmlJNI.XMLToken_getNamespaceIndexByPrefix(swigCPtr, this, prefix); 1649 } 1650 1651 1652/** 1653 * Returns the number of XML namespaces declared on this token. 1654 <p> 1655 * @return the number of XML namespaces stored in the {@link XMLNamespaces} 1656 * object of this {@link XMLToken} object. 1657 */ public 1658 int getNamespacesLength() { 1659 return libsbmlJNI.XMLToken_getNamespacesLength(swigCPtr, this); 1660 } 1661 1662 1663/** 1664 * Returns the prefix of the <em>n</em>th XML namespace declaration. 1665 <p> 1666 * @param index an integer, position of the required prefix. 1667 <p> 1668 * @return the prefix of an XML namespace declaration in the {@link XMLNamespaces} 1669 * (by position). 1670 <p> 1671 * @note If <code>index</code> is out of range, this method will return an empty 1672 * string. {@link XMLToken#getNamespacesLength()} can be used to find out how 1673 * many namespaces are defined on this {@link XMLToken} object. 1674 <p> 1675 * @see #getNamespacesLength() 1676 */ public 1677 String getNamespacePrefix(int index) { 1678 return libsbmlJNI.XMLToken_getNamespacePrefix__SWIG_0(swigCPtr, this, index); 1679 } 1680 1681 1682/** 1683 * Returns the prefix associated with a given XML namespace URI on this 1684 * token. 1685 <p> 1686 * @param uri a string, the URI of the namespace whose prefix is being 1687 * sought. 1688 <p> 1689 * @return the prefix of an XML namespace declaration on this {@link XMLToken} object. 1690 <p> 1691 * @note If there is no XML namespace with the given <code>uri</code> declared on 1692 * this {@link XMLToken} object, this method will return an empty string. 1693 */ public 1694 String getNamespacePrefix(String uri) { 1695 return libsbmlJNI.XMLToken_getNamespacePrefix__SWIG_1(swigCPtr, this, uri); 1696 } 1697 1698 1699/** 1700 * Returns the URI of the <em>n</em>th XML namespace declared on this token. 1701 <p> 1702 * @param index an integer, the position of the sought-after XML namespace URI. 1703 <p> 1704 * @return the URI of the <em>n</em>th XML namespace stored in the 1705 * {@link XMLNamespaces} object in this {@link XMLToken} object. 1706 <p> 1707 * @note If <code>index</code> is out of range, this method will return an empty string. 1708 <p> 1709 * @see #getNamespacesLength() 1710 */ public 1711 String getNamespaceURI(int index) { 1712 return libsbmlJNI.XMLToken_getNamespaceURI__SWIG_0(swigCPtr, this, index); 1713 } 1714 1715 1716/** 1717 * Returns the URI of an XML namespace with a given prefix. 1718 <p> 1719 * @param prefix a string, the prefix of the sought-after XML namespace URI. 1720 <p> 1721 * @return the URI of an XML namespace declaration given its prefix. 1722 <p> 1723 * @note If there is no XML namespace with the given <code>prefix</code> stored in 1724 * the {@link XMLNamespaces} object of this {@link XMLToken} object, this method will 1725 * return an empty string. 1726 <p> 1727 * 1728</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1729The native C++ implementation of this method defines a default argument 1730value. In the documentation generated for different libSBML language 1731bindings, you may or may not see corresponding arguments in the method 1732declarations. For example, in Java and C#, a default argument is handled by 1733declaring two separate methods, with one of them having the argument and 1734the other one lacking the argument. However, the libSBML documentation will 1735be <em>identical</em> for both methods. Consequently, if you are reading 1736this and do not see an argument even though one is described, please look 1737for descriptions of other variants of this method near where this one 1738appears in the documentation. 1739</dd></dl> 1740 1741 */ public 1742 String getNamespaceURI(String prefix) { 1743 return libsbmlJNI.XMLToken_getNamespaceURI__SWIG_1(swigCPtr, this, prefix); 1744 } 1745 1746 1747/** 1748 * Returns the URI of an XML namespace with a given prefix. 1749 <p> 1750 * @param prefix a string, the prefix of the sought-after XML namespace URI. 1751 <p> 1752 * @return the URI of an XML namespace declaration given its prefix. 1753 <p> 1754 * @note If there is no XML namespace with the given <code>prefix</code> stored in 1755 * the {@link XMLNamespaces} object of this {@link XMLToken} object, this method will 1756 * return an empty string. 1757 <p> 1758 * 1759</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1760The native C++ implementation of this method defines a default argument 1761value. In the documentation generated for different libSBML language 1762bindings, you may or may not see corresponding arguments in the method 1763declarations. For example, in Java and C#, a default argument is handled by 1764declaring two separate methods, with one of them having the argument and 1765the other one lacking the argument. However, the libSBML documentation will 1766be <em>identical</em> for both methods. Consequently, if you are reading 1767this and do not see an argument even though one is described, please look 1768for descriptions of other variants of this method near where this one 1769appears in the documentation. 1770</dd></dl> 1771 1772 */ public 1773 String getNamespaceURI() { 1774 return libsbmlJNI.XMLToken_getNamespaceURI__SWIG_2(swigCPtr, this); 1775 } 1776 1777 1778/** 1779 * Returns <code>true</code> if there are no namespaces declared on this token. 1780 <p> 1781 * @return <code>true</code> if the {@link XMLNamespaces} object stored in this {@link XMLToken} 1782 * token is empty, <code>false</code> otherwise. 1783 */ public 1784 boolean isNamespacesEmpty() { 1785 return libsbmlJNI.XMLToken_isNamespacesEmpty(swigCPtr, this); 1786 } 1787 1788 1789/** 1790 * Returns <code>true</code> if this token has an XML namespace with a given URI. 1791 <p> 1792 * @param uri a string, the URI of the XML namespace. 1793 <p> 1794 * @return <code>true</code> if an XML namespace with the given URI is contained in 1795 * the {@link XMLNamespaces} object of this {@link XMLToken} object, <code>false</code> otherwise. 1796 */ public 1797 boolean hasNamespaceURI(String uri) { 1798 return libsbmlJNI.XMLToken_hasNamespaceURI(swigCPtr, this, uri); 1799 } 1800 1801 1802/** 1803 * Returns <code>true</code> if this token has an XML namespace with a given prefix. 1804 <p> 1805 * @param prefix a string, the prefix for the XML namespace. 1806 <p> 1807 * @return <code>true</code> if an XML Namespace with the given URI is contained in the 1808 * {@link XMLNamespaces} of this {@link XMLToken}, <code>false</code> otherwise. 1809 */ public 1810 boolean hasNamespacePrefix(String prefix) { 1811 return libsbmlJNI.XMLToken_hasNamespacePrefix(swigCPtr, this, prefix); 1812 } 1813 1814 1815/** 1816 * Returns <code>true</code> if this token has an XML namespace with a given prefix 1817 * and URI combination. 1818 <p> 1819 * @param uri a string, the URI for the namespace. 1820 * @param prefix a string, the prefix for the namespace. 1821 <p> 1822 * @return <code>true</code> if an XML namespace with the given URI/prefix pair is 1823 * contained in the {@link XMLNamespaces} object of this {@link XMLToken} object, <code>false</code> 1824 * otherwise. 1825 */ public 1826 boolean hasNamespaceNS(String uri, String prefix) { 1827 return libsbmlJNI.XMLToken_hasNamespaceNS(swigCPtr, this, uri, prefix); 1828 } 1829 1830 1831/** 1832 * Sets the name, namespace prefix and namespace URI of this token. 1833 <p> 1834 * <p> 1835 * This operation only makes sense for XML start elements. This 1836 * method will return {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} if this {@link XMLToken} object is not an XML start 1837 * element. 1838 <p> 1839 * @param triple the new {@link XMLTriple} to use for this {@link XMLToken} object. If 1840 * this {@link XMLToken} already had an {@link XMLTriple} object stored within it, that 1841 * object will be replaced. 1842 <p> 1843 * <p> 1844 * @return integer value indicating success/failure of the 1845 * function. The possible values 1846 * returned by this function are: 1847 * <ul> 1848 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1849 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1850 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION} 1851 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 1852 * </ul> 1853 */ public 1854 int setTriple(XMLTriple triple) { 1855 return libsbmlJNI.XMLToken_setTriple(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 1856 } 1857 1858 1859/** 1860 * Returns the (unqualified) name of token. 1861 <p> 1862 * @return the (unqualified) name of token. 1863 */ public 1864 String getName() { 1865 return libsbmlJNI.XMLToken_getName(swigCPtr, this); 1866 } 1867 1868 1869/** 1870 * Returns the XML namespace prefix of token. 1871 <p> 1872 * @return the XML namespace prefix of token. 1873 <p> 1874 * @note If no XML namespace prefix has been assigned to this token, this 1875 * method will return an empty string. 1876 */ public 1877 String getPrefix() { 1878 return libsbmlJNI.XMLToken_getPrefix(swigCPtr, this); 1879 } 1880 1881 1882/** 1883 * Returns the XML namespace URI of token. 1884 <p> 1885 * @return the XML namespace URI of token. 1886 */ public 1887 String getURI() { 1888 return libsbmlJNI.XMLToken_getURI(swigCPtr, this); 1889 } 1890 1891 1892/** 1893 * Returns the character text of token. 1894 <p> 1895 * @return the characters of this XML token. If this token is not a 1896 * text token (i.e., it's an XML element and not character content), 1897 * then this will return an empty string. 1898 <p> 1899 * @see #isText() 1900 * @see #isElement() 1901 */ public 1902 String getCharacters() { 1903 return libsbmlJNI.XMLToken_getCharacters(swigCPtr, this); 1904 } 1905 1906 1907/** 1908 * Appends characters to the text content of token. 1909 <p> 1910 * This method only makes sense for {@link XMLToken} objects that contains text. 1911 * If this method is called on a token that represents an XML start or end 1912 * tag, it will return the code {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}. 1913 <p> 1914 * @param chars string, characters to append to the text of this token. 1915 <p> 1916 * <p> 1917 * @return integer value indicating success/failure of the 1918 * function. The possible values 1919 * returned by this function are: 1920 * <ul> 1921 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1922 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1923 * 1924 * </ul> <p> 1925 * @see #isText() 1926 * @see #isElement() 1927 */ public 1928 int append(String chars) { 1929 return libsbmlJNI.XMLToken_append(swigCPtr, this, chars); 1930 } 1931 1932 1933/** 1934 * Returns the column number at which this token occurs in the input. 1935 <p> 1936 * @return the column at which this {@link XMLToken} occurred. 1937 */ public 1938 long getColumn() { 1939 return libsbmlJNI.XMLToken_getColumn(swigCPtr, this); 1940 } 1941 1942 1943/** 1944 * Returns the line number at which this token occurs in the input. 1945 <p> 1946 * @return the line at which this {@link XMLToken} occurred. 1947 */ public 1948 long getLine() { 1949 return libsbmlJNI.XMLToken_getLine(swigCPtr, this); 1950 } 1951 1952 1953/** 1954 * Returns <code>true</code> if this token represents an XML element. 1955 <p> 1956 * This generic predicate returns <code>true</code> if the element is either a start 1957 * or end tag, and <code>false</code> if it's a text object. The related methods 1958 * XMLToken:isStart(), {@link XMLToken#isEnd()} and {@link XMLToken#isText()} are more 1959 * specific predicates. 1960 <p> 1961 * @return <code>true</code> if this {@link XMLToken} object represents an XML element, 1962 * <code>false</code> otherwise. 1963 <p> 1964 * @see #isStart() 1965 * @see #isEnd() 1966 * @see #isText() 1967 */ public 1968 boolean isElement() { 1969 return libsbmlJNI.XMLToken_isElement(swigCPtr, this); 1970 } 1971 1972 1973/** 1974 * Returns <code>true</code> if this token represents an XML end element. 1975 <p> 1976 * @return <code>true</code> if this {@link XMLToken} object represents an XML end element, 1977 * <code>false</code> otherwise. 1978 <p> 1979 * @see #isStart() 1980 * @see #isElement() 1981 * @see #isText() 1982 */ public 1983 boolean isEnd() { 1984 return libsbmlJNI.XMLToken_isEnd(swigCPtr, this); 1985 } 1986 1987 1988/** 1989 * Returns <code>true</code> if this token represents an XML end element for a 1990 * particular start element. 1991 <p> 1992 * @param element {@link XMLToken}, the element with which the current object 1993 * should be compared to determined whether the current object is a 1994 * start element for the given one. 1995 <p> 1996 * @return <code>true</code> if this {@link XMLToken} object represents an XML end tag for 1997 * the start tag given by <code>element</code>, <code>false</code> otherwise. 1998 <p> 1999 * @see #isElement() 2000 * @see #isStart() 2001 * @see #isEnd() 2002 * @see #isText() 2003 */ public 2004 boolean isEndFor(XMLToken element) { 2005 return libsbmlJNI.XMLToken_isEndFor(swigCPtr, this, XMLToken.getCPtr(element), element); 2006 } 2007 2008 2009/** 2010 * Returns <code>true</code> if this token is an end of file marker. 2011 <p> 2012 * @return <code>true</code> if this {@link XMLToken} object represents the end of the input, 2013 * <code>false</code> otherwise. 2014 <p> 2015 * @see #setEOF() 2016 */ public 2017 boolean isEOF() { 2018 return libsbmlJNI.XMLToken_isEOF(swigCPtr, this); 2019 } 2020 2021 2022/** 2023 * Returns <code>true</code> if this token represents an XML start element. 2024 <p> 2025 * @return <code>true</code> if this {@link XMLToken} is an XML start element, <code>false</code> otherwise. 2026 <p> 2027 * @see #isElement() 2028 * @see #isEnd() 2029 * @see #isText() 2030 */ public 2031 boolean isStart() { 2032 return libsbmlJNI.XMLToken_isStart(swigCPtr, this); 2033 } 2034 2035 2036/** 2037 * Returns <code>true</code> if this token represents an XML text element. 2038 <p> 2039 * @return <code>true</code> if this {@link XMLToken} is an XML text element, <code>false</code> otherwise. 2040 <p> 2041 * @see #isElement() 2042 * @see #isStart() 2043 * @see #isEnd() 2044 */ public 2045 boolean isText() { 2046 return libsbmlJNI.XMLToken_isText(swigCPtr, this); 2047 } 2048 2049 2050/** 2051 * Declares that this token represents an XML element end tag. 2052 <p> 2053 * <p> 2054 * @return integer value indicating success/failure of the 2055 * function. The possible values 2056 * returned by this function are: 2057 * <ul> 2058 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 2059 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 2060 * 2061 * </ul> <p> 2062 * @see #isStart() 2063 * @see #isEnd() 2064 */ public 2065 int setEnd() { 2066 return libsbmlJNI.XMLToken_setEnd(swigCPtr, this); 2067 } 2068 2069 2070/** 2071 * Declares that this token is an end-of-file/input marker. 2072 <p> 2073 * <p> 2074 * @return integer value indicating success/failure of the 2075 * function. The possible values 2076 * returned by this function are: 2077 * <ul> 2078 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 2079 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 2080 * 2081 * </ul> <p> 2082 * @see #isEOF() 2083 */ public 2084 int setEOF() { 2085 return libsbmlJNI.XMLToken_setEOF(swigCPtr, this); 2086 } 2087 2088 2089/** 2090 * Declares that this token no longer represents an XML start/end element. 2091 <p> 2092 * <p> 2093 * @return integer value indicating success/failure of the 2094 * function. The possible values 2095 * returned by this function are: 2096 * <ul> 2097 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 2098 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 2099 * </ul> 2100 */ public 2101 int unsetEnd() { 2102 return libsbmlJNI.XMLToken_unsetEnd(swigCPtr, this); 2103 } 2104 2105 2106/** 2107 * Prints a string representation of the underlying token stream. 2108 <p> 2109 * This method is intended for debugging purposes. 2110 <p> 2111 * @return a text string representing this {@link XMLToken} object. 2112 */ public 2113 String toString() { 2114 return libsbmlJNI.XMLToken_toString(swigCPtr, this); 2115 } 2116 2117}