001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.0.12 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * Representation of 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 */ 022 023public class XMLToken { 024 private long swigCPtr; 025 protected boolean swigCMemOwn; 026 027 protected XMLToken(long cPtr, boolean cMemoryOwn) 028 { 029 swigCMemOwn = cMemoryOwn; 030 swigCPtr = cPtr; 031 } 032 033 protected static long getCPtr(XMLToken obj) 034 { 035 return (obj == null) ? 0 : obj.swigCPtr; 036 } 037 038 protected static long getCPtrAndDisown (XMLToken obj) 039 { 040 long ptr = 0; 041 042 if (obj != null) 043 { 044 ptr = obj.swigCPtr; 045 obj.swigCMemOwn = false; 046 } 047 048 return ptr; 049 } 050 051 protected void finalize() { 052 delete(); 053 } 054 055 public synchronized void delete() { 056 if (swigCPtr != 0) { 057 if (swigCMemOwn) { 058 swigCMemOwn = false; 059 libsbmlJNI.delete_XMLToken(swigCPtr); 060 } 061 swigCPtr = 0; 062 } 063 } 064 065 /** 066 * Equality comparison method for XMLToken. 067 * <p> 068 * Because the Java methods for libSBML are actually wrappers around code 069 * implemented in C++ and C, certain operations will not behave as 070 * expected. Equality comparison is one such case. An instance of a 071 * libSBML object class is actually a <em>proxy object</em> 072 * wrapping the real underlying C/C++ object. The normal <code>==</code> 073 * equality operator in Java will <em>only compare the Java proxy objects</em>, 074 * not the underlying native object. The result is almost never what you 075 * want in practical situations. Unfortunately, Java does not provide a 076 * way to override <code>==</code>. 077 * <p> 078 * The alternative that must be followed is to use the 079 * <code>equals()</code> method. The <code>equals</code> method on this 080 * class overrides the default java.lang.Object one, and performs an 081 * intelligent comparison of instances of objects of this class. The 082 * result is an assessment of whether two libSBML Java objects are truly 083 * the same underlying native-code objects. 084 * <p> 085 * The use of this method in practice is the same as the use of any other 086 * Java <code>equals</code> method. For example, 087 * <em>a</em><code>.equals(</code><em>b</em><code>)</code> returns 088 * <code>true</code> if <em>a</em> and <em>b</em> are references to the 089 * same underlying object. 090 * 091 * @param sb a reference to an object to which the current object 092 * instance will be compared 093 * 094 * @return <code>true</code> if <code>sb</code> refers to the same underlying 095 * native object as this one, <code>false</code> otherwise 096 */ 097 public boolean equals(Object sb) 098 { 099 if ( this == sb ) 100 { 101 return true; 102 } 103 return swigCPtr == getCPtr((XMLToken)(sb)); 104 } 105 106 /** 107 * Returns a hashcode for this XMLToken object. 108 * 109 * @return a hash code usable by Java methods that need them. 110 */ 111 public int hashCode() 112 { 113 return (int)(swigCPtr^(swigCPtr>>>32)); 114 } 115 116 117/** 118 * Creates a new empty {@link XMLToken}. 119 */ public 120 XMLToken() throws org.sbml.libsbml.XMLConstructorException { 121 this(libsbmlJNI.new_XMLToken__SWIG_0(), true); 122 } 123 124 125/** 126 * Creates a start element {@link XMLToken} with the given set of attributes and 127 * namespace declarations. 128 <p> 129 * @param triple {@link XMLTriple}. 130 * @param attributes {@link XMLAttributes}, the attributes to set. 131 * @param namespaces {@link XMLNamespaces}, the namespaces to set. 132 * @param line a long integer, the line number (default = 0). 133 * @param column a long integer, the column number (default = 0). 134 <p> 135 * 136</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 137The native C++ implementation of this method defines a default argument 138value. In the documentation generated for different libSBML language 139bindings, you may or may not see corresponding arguments in the method 140declarations. For example, in Java and C#, a default argument is handled by 141declaring two separate methods, with one of them having the argument and 142the other one lacking the argument. However, the libSBML documentation will 143be <em>identical</em> for both methods. Consequently, if you are reading 144this and do not see an argument even though one is described, please look 145for descriptions of other variants of this method near where this one 146appears in the documentation. 147</dd></dl> 148 149 */ public 150 XMLToken(XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line, long column) throws org.sbml.libsbml.XMLConstructorException { 151 this(libsbmlJNI.new_XMLToken__SWIG_1(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes, XMLNamespaces.getCPtr(namespaces), namespaces, line, column), true); 152 } 153 154 155/** 156 * Creates a start element {@link XMLToken} with the given set of attributes and 157 * namespace declarations. 158 <p> 159 * @param triple {@link XMLTriple}. 160 * @param attributes {@link XMLAttributes}, the attributes to set. 161 * @param namespaces {@link XMLNamespaces}, the namespaces to set. 162 * @param line a long integer, the line number (default = 0). 163 * @param column a long integer, the column number (default = 0). 164 <p> 165 * 166</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 167The native C++ implementation of this method defines a default argument 168value. In the documentation generated for different libSBML language 169bindings, you may or may not see corresponding arguments in the method 170declarations. For example, in Java and C#, a default argument is handled by 171declaring two separate methods, with one of them having the argument and 172the other one lacking the argument. However, the libSBML documentation will 173be <em>identical</em> for both methods. Consequently, if you are reading 174this and do not see an argument even though one is described, please look 175for descriptions of other variants of this method near where this one 176appears in the documentation. 177</dd></dl> 178 179 */ public 180 XMLToken(XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line) throws org.sbml.libsbml.XMLConstructorException { 181 this(libsbmlJNI.new_XMLToken__SWIG_2(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes, XMLNamespaces.getCPtr(namespaces), namespaces, line), true); 182 } 183 184 185/** 186 * Creates a start element {@link XMLToken} with the given set of attributes and 187 * namespace declarations. 188 <p> 189 * @param triple {@link XMLTriple}. 190 * @param attributes {@link XMLAttributes}, the attributes to set. 191 * @param namespaces {@link XMLNamespaces}, the namespaces to set. 192 * @param line a long integer, the line number (default = 0). 193 * @param column a long integer, the column number (default = 0). 194 <p> 195 * 196</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 197The native C++ implementation of this method defines a default argument 198value. In the documentation generated for different libSBML language 199bindings, you may or may not see corresponding arguments in the method 200declarations. For example, in Java and C#, a default argument is handled by 201declaring two separate methods, with one of them having the argument and 202the other one lacking the argument. However, the libSBML documentation will 203be <em>identical</em> for both methods. Consequently, if you are reading 204this and do not see an argument even though one is described, please look 205for descriptions of other variants of this method near where this one 206appears in the documentation. 207</dd></dl> 208 209 */ public 210 XMLToken(XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces) throws org.sbml.libsbml.XMLConstructorException { 211 this(libsbmlJNI.new_XMLToken__SWIG_3(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes, XMLNamespaces.getCPtr(namespaces), namespaces), true); 212 } 213 214 215/** 216 * Creates a start element {@link XMLToken} with the given set of attributes. 217 <p> 218 * @param triple {@link XMLTriple}. 219 * @param attributes {@link XMLAttributes}, the attributes to set. 220 * @param line a long integer, the line number (default = 0). 221 * @param column a long integer, the column number (default = 0). 222 <p> 223 * 224</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 225The native C++ implementation of this method defines a default argument 226value. In the documentation generated for different libSBML language 227bindings, you may or may not see corresponding arguments in the method 228declarations. For example, in Java and C#, a default argument is handled by 229declaring two separate methods, with one of them having the argument and 230the other one lacking the argument. However, the libSBML documentation will 231be <em>identical</em> for both methods. Consequently, if you are reading 232this and do not see an argument even though one is described, please look 233for descriptions of other variants of this method near where this one 234appears in the documentation. 235</dd></dl> 236 237 */ public 238 XMLToken(XMLTriple triple, XMLAttributes attributes, long line, long column) throws org.sbml.libsbml.XMLConstructorException { 239 this(libsbmlJNI.new_XMLToken__SWIG_4(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes, line, column), true); 240 } 241 242 243/** 244 * Creates a start element {@link XMLToken} with the given set of attributes. 245 <p> 246 * @param triple {@link XMLTriple}. 247 * @param attributes {@link XMLAttributes}, the attributes to set. 248 * @param line a long integer, the line number (default = 0). 249 * @param column a long integer, the column number (default = 0). 250 <p> 251 * 252</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 253The native C++ implementation of this method defines a default argument 254value. In the documentation generated for different libSBML language 255bindings, you may or may not see corresponding arguments in the method 256declarations. For example, in Java and C#, a default argument is handled by 257declaring two separate methods, with one of them having the argument and 258the other one lacking the argument. However, the libSBML documentation will 259be <em>identical</em> for both methods. Consequently, if you are reading 260this and do not see an argument even though one is described, please look 261for descriptions of other variants of this method near where this one 262appears in the documentation. 263</dd></dl> 264 265 */ public 266 XMLToken(XMLTriple triple, XMLAttributes attributes, long line) throws org.sbml.libsbml.XMLConstructorException { 267 this(libsbmlJNI.new_XMLToken__SWIG_5(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes, line), true); 268 } 269 270 271/** 272 * Creates a start element {@link XMLToken} with the given set of attributes. 273 <p> 274 * @param triple {@link XMLTriple}. 275 * @param attributes {@link XMLAttributes}, the attributes to set. 276 * @param line a long integer, the line number (default = 0). 277 * @param column a long integer, the column number (default = 0). 278 <p> 279 * 280</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 281The native C++ implementation of this method defines a default argument 282value. In the documentation generated for different libSBML language 283bindings, you may or may not see corresponding arguments in the method 284declarations. For example, in Java and C#, a default argument is handled by 285declaring two separate methods, with one of them having the argument and 286the other one lacking the argument. However, the libSBML documentation will 287be <em>identical</em> for both methods. Consequently, if you are reading 288this and do not see an argument even though one is described, please look 289for descriptions of other variants of this method near where this one 290appears in the documentation. 291</dd></dl> 292 293 */ public 294 XMLToken(XMLTriple triple, XMLAttributes attributes) throws org.sbml.libsbml.XMLConstructorException { 295 this(libsbmlJNI.new_XMLToken__SWIG_6(XMLTriple.getCPtr(triple), triple, XMLAttributes.getCPtr(attributes), attributes), true); 296 } 297 298 299/** 300 * Creates an end element {@link XMLToken}. 301 <p> 302 * @param triple {@link XMLTriple}. 303 * @param line a long integer, the line number (default = 0). 304 * @param column a long integer, the column number (default = 0). 305 <p> 306 * 307</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 308The native C++ implementation of this method defines a default argument 309value. In the documentation generated for different libSBML language 310bindings, you may or may not see corresponding arguments in the method 311declarations. For example, in Java and C#, a default argument is handled by 312declaring two separate methods, with one of them having the argument and 313the other one lacking the argument. However, the libSBML documentation will 314be <em>identical</em> for both methods. Consequently, if you are reading 315this and do not see an argument even though one is described, please look 316for descriptions of other variants of this method near where this one 317appears in the documentation. 318</dd></dl> 319 320 */ public 321 XMLToken(XMLTriple triple, long line, long column) throws org.sbml.libsbml.XMLConstructorException { 322 this(libsbmlJNI.new_XMLToken__SWIG_7(XMLTriple.getCPtr(triple), triple, line, column), true); 323 } 324 325 326/** 327 * Creates an end element {@link XMLToken}. 328 <p> 329 * @param triple {@link XMLTriple}. 330 * @param line a long integer, the line number (default = 0). 331 * @param column a long integer, the column number (default = 0). 332 <p> 333 * 334</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 335The native C++ implementation of this method defines a default argument 336value. In the documentation generated for different libSBML language 337bindings, you may or may not see corresponding arguments in the method 338declarations. For example, in Java and C#, a default argument is handled by 339declaring two separate methods, with one of them having the argument and 340the other one lacking the argument. However, the libSBML documentation will 341be <em>identical</em> for both methods. Consequently, if you are reading 342this and do not see an argument even though one is described, please look 343for descriptions of other variants of this method near where this one 344appears in the documentation. 345</dd></dl> 346 347 */ public 348 XMLToken(XMLTriple triple, long line) throws org.sbml.libsbml.XMLConstructorException { 349 this(libsbmlJNI.new_XMLToken__SWIG_8(XMLTriple.getCPtr(triple), triple, line), true); 350 } 351 352 353/** 354 * Creates an end element {@link XMLToken}. 355 <p> 356 * @param triple {@link XMLTriple}. 357 * @param line a long integer, the line number (default = 0). 358 * @param column a long integer, the column number (default = 0). 359 <p> 360 * 361</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 362The native C++ implementation of this method defines a default argument 363value. In the documentation generated for different libSBML language 364bindings, you may or may not see corresponding arguments in the method 365declarations. For example, in Java and C#, a default argument is handled by 366declaring two separate methods, with one of them having the argument and 367the other one lacking the argument. However, the libSBML documentation will 368be <em>identical</em> for both methods. Consequently, if you are reading 369this and do not see an argument even though one is described, please look 370for descriptions of other variants of this method near where this one 371appears in the documentation. 372</dd></dl> 373 374 */ public 375 XMLToken(XMLTriple triple) throws org.sbml.libsbml.XMLConstructorException { 376 this(libsbmlJNI.new_XMLToken__SWIG_9(XMLTriple.getCPtr(triple), triple), true); 377 } 378 379 380/** 381 * Creates a text {@link XMLToken}. 382 <p> 383 * @param chars a string, the text to be added to the {@link XMLToken} 384 * @param line a long integer, the line number (default = 0). 385 * @param column a long integer, the column number (default = 0). 386 <p> 387 * @throws XMLConstructorException 388 * Thrown if the argument <code>orig</code> is <code>null.</code> 389 <p> 390 * 391</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 392The native C++ implementation of this method defines a default argument 393value. In the documentation generated for different libSBML language 394bindings, you may or may not see corresponding arguments in the method 395declarations. For example, in Java and C#, a default argument is handled by 396declaring two separate methods, with one of them having the argument and 397the other one lacking the argument. However, the libSBML documentation will 398be <em>identical</em> for both methods. Consequently, if you are reading 399this and do not see an argument even though one is described, please look 400for descriptions of other variants of this method near where this one 401appears in the documentation. 402</dd></dl> 403 404 */ public 405 XMLToken(String chars, long line, long column) throws org.sbml.libsbml.XMLConstructorException { 406 this(libsbmlJNI.new_XMLToken__SWIG_10(chars, line, column), true); 407 } 408 409 410/** 411 * Creates a text {@link XMLToken}. 412 <p> 413 * @param chars a string, the text to be added to the {@link XMLToken} 414 * @param line a long integer, the line number (default = 0). 415 * @param column a long integer, the column number (default = 0). 416 <p> 417 * @throws XMLConstructorException 418 * Thrown if the argument <code>orig</code> is <code>null.</code> 419 <p> 420 * 421</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 422The native C++ implementation of this method defines a default argument 423value. In the documentation generated for different libSBML language 424bindings, you may or may not see corresponding arguments in the method 425declarations. For example, in Java and C#, a default argument is handled by 426declaring two separate methods, with one of them having the argument and 427the other one lacking the argument. However, the libSBML documentation will 428be <em>identical</em> for both methods. Consequently, if you are reading 429this and do not see an argument even though one is described, please look 430for descriptions of other variants of this method near where this one 431appears in the documentation. 432</dd></dl> 433 434 */ public 435 XMLToken(String chars, long line) throws org.sbml.libsbml.XMLConstructorException { 436 this(libsbmlJNI.new_XMLToken__SWIG_11(chars, line), true); 437 } 438 439 440/** 441 * Creates a text {@link XMLToken}. 442 <p> 443 * @param chars a string, the text to be added to the {@link XMLToken} 444 * @param line a long integer, the line number (default = 0). 445 * @param column a long integer, the column number (default = 0). 446 <p> 447 * @throws XMLConstructorException 448 * Thrown if the argument <code>orig</code> is <code>null.</code> 449 <p> 450 * 451</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 452The native C++ implementation of this method defines a default argument 453value. In the documentation generated for different libSBML language 454bindings, you may or may not see corresponding arguments in the method 455declarations. For example, in Java and C#, a default argument is handled by 456declaring two separate methods, with one of them having the argument and 457the other one lacking the argument. However, the libSBML documentation will 458be <em>identical</em> for both methods. Consequently, if you are reading 459this and do not see an argument even though one is described, please look 460for descriptions of other variants of this method near where this one 461appears in the documentation. 462</dd></dl> 463 464 */ public 465 XMLToken(String chars) throws org.sbml.libsbml.XMLConstructorException { 466 this(libsbmlJNI.new_XMLToken__SWIG_12(chars), true); 467 } 468 469 470/** 471 * Copy constructor; creates a copy of this {@link XMLToken}. 472 <p> 473 * @param orig the {@link XMLToken} object to copy. 474 <p> 475 * @throws XMLConstructorException 476 * Thrown if the argument <code>orig</code> is <code>null.</code> 477 */ public 478 XMLToken(XMLToken orig) throws org.sbml.libsbml.XMLConstructorException { 479 this(libsbmlJNI.new_XMLToken__SWIG_13(XMLToken.getCPtr(orig), orig), true); 480 } 481 482 483/** 484 * Creates and returns a deep copy of this {@link XMLToken}. 485 <p> 486 * @return a (deep) copy of this {@link XMLToken} set. 487 */ public 488 XMLToken cloneObject() { 489 long cPtr = libsbmlJNI.XMLToken_cloneObject(swigCPtr, this); 490 return (cPtr == 0) ? null : new XMLToken(cPtr, true); 491 } 492 493 494/** 495 * Returns the attributes of this element. 496 <p> 497 * @return the {@link XMLAttributes} of this XML element. 498 */ public 499 XMLAttributes getAttributes() { 500 return new XMLAttributes(libsbmlJNI.XMLToken_getAttributes(swigCPtr, this), false); 501 } 502 503 504/** 505 * Sets an {@link XMLAttributes} to this {@link XMLToken}. 506 * Nothing will be done if this {@link XMLToken} is not a start element. 507 <p> 508 * @param attributes {@link XMLAttributes} to be set to this {@link XMLToken}. 509 <p> 510 * @return integer value indicating success/failure of the 511 * function. The possible values 512 * returned by this function are: 513 * <ul> 514 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 515 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 516 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 517 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 518 * 519 * </ul> <p> 520 * @note This function replaces the existing {@link XMLAttributes} with the new one. 521 */ public 522 int setAttributes(XMLAttributes attributes) { 523 return libsbmlJNI.XMLToken_setAttributes(swigCPtr, this, XMLAttributes.getCPtr(attributes), attributes); 524 } 525 526 527/** 528 * Adds an attribute to the attribute set in this {@link XMLToken} optionally 529 * with a prefix and URI defining a namespace. 530 * Nothing will be done if this {@link XMLToken} is not a start element. 531 <p> 532 * @param name a string, the local name of the attribute. 533 * @param value a string, the value of the attribute. 534 * @param namespaceURI a string, the namespace URI of the attribute. 535 * @param prefix a string, the prefix of the namespace 536 <p> 537 * @return integer value indicating success/failure of the 538 * function. The possible values 539 * returned by this function are: 540 * <ul> 541 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 542 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 543 * 544 * </ul> <p> 545 * @note if local name with the same namespace URI already exists in the 546 * attribute set, its value and prefix will be replaced. 547 <p> 548 * 549</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 550The native C++ implementation of this method defines a default argument 551value. In the documentation generated for different libSBML language 552bindings, you may or may not see corresponding arguments in the method 553declarations. For example, in Java and C#, a default argument is handled by 554declaring two separate methods, with one of them having the argument and 555the other one lacking the argument. However, the libSBML documentation will 556be <em>identical</em> for both methods. Consequently, if you are reading 557this and do not see an argument even though one is described, please look 558for descriptions of other variants of this method near where this one 559appears in the documentation. 560</dd></dl> 561 562 */ public 563 int addAttr(String name, String value, String namespaceURI, String prefix) { 564 return libsbmlJNI.XMLToken_addAttr__SWIG_0(swigCPtr, this, name, value, namespaceURI, prefix); 565 } 566 567 568/** 569 * Adds an attribute to the attribute set in this {@link XMLToken} optionally 570 * with a prefix and URI defining a namespace. 571 * Nothing will be done if this {@link XMLToken} is not a start element. 572 <p> 573 * @param name a string, the local name of the attribute. 574 * @param value a string, the value of the attribute. 575 * @param namespaceURI a string, the namespace URI of the attribute. 576 * @param prefix a string, the prefix of the namespace 577 <p> 578 * @return integer value indicating success/failure of the 579 * function. The possible values 580 * returned by this function are: 581 * <ul> 582 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 583 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 584 * 585 * </ul> <p> 586 * @note if local name with the same namespace URI already exists in the 587 * attribute set, its value and prefix will be replaced. 588 <p> 589 * 590</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 591The native C++ implementation of this method defines a default argument 592value. In the documentation generated for different libSBML language 593bindings, you may or may not see corresponding arguments in the method 594declarations. For example, in Java and C#, a default argument is handled by 595declaring two separate methods, with one of them having the argument and 596the other one lacking the argument. However, the libSBML documentation will 597be <em>identical</em> for both methods. Consequently, if you are reading 598this and do not see an argument even though one is described, please look 599for descriptions of other variants of this method near where this one 600appears in the documentation. 601</dd></dl> 602 603 */ public 604 int addAttr(String name, String value, String namespaceURI) { 605 return libsbmlJNI.XMLToken_addAttr__SWIG_1(swigCPtr, this, name, value, namespaceURI); 606 } 607 608 609/** 610 * Adds an attribute to the attribute set in this {@link XMLToken} optionally 611 * with a prefix and URI defining a namespace. 612 * Nothing will be done if this {@link XMLToken} is not a start element. 613 <p> 614 * @param name a string, the local name of the attribute. 615 * @param value a string, the value of the attribute. 616 * @param namespaceURI a string, the namespace URI of the attribute. 617 * @param prefix a string, the prefix of the namespace 618 <p> 619 * @return integer value indicating success/failure of the 620 * function. The possible values 621 * returned by this function are: 622 * <ul> 623 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 624 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 625 * 626 * </ul> <p> 627 * @note if local name with the same namespace URI already exists in the 628 * attribute set, its value and prefix will be replaced. 629 <p> 630 * 631</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 632The native C++ implementation of this method defines a default argument 633value. In the documentation generated for different libSBML language 634bindings, you may or may not see corresponding arguments in the method 635declarations. For example, in Java and C#, a default argument is handled by 636declaring two separate methods, with one of them having the argument and 637the other one lacking the argument. However, the libSBML documentation will 638be <em>identical</em> for both methods. Consequently, if you are reading 639this and do not see an argument even though one is described, please look 640for descriptions of other variants of this method near where this one 641appears in the documentation. 642</dd></dl> 643 644 */ public 645 int addAttr(String name, String value) { 646 return libsbmlJNI.XMLToken_addAttr__SWIG_2(swigCPtr, this, name, value); 647 } 648 649 650/** 651 * Adds an attribute with the given {@link XMLTriple}/value pair to the attribute set 652 * in this {@link XMLToken}. 653 * Nothing will be done if this {@link XMLToken} is not a start element. 654 <p> 655 * @note if local name with the same namespace URI already exists in the 656 * attribute set, its value and prefix will be replaced. 657 <p> 658 * @param triple an {@link XMLTriple}, the XML triple of the attribute. 659 * @param value a string, the value of the attribute. 660 <p> 661 * @return integer value indicating success/failure of the 662 * function. The possible values 663 * returned by this function are: 664 * <ul> 665 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 666 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 667 * </ul> 668 */ public 669 int addAttr(XMLTriple triple, String value) { 670 return libsbmlJNI.XMLToken_addAttr__SWIG_3(swigCPtr, this, XMLTriple.getCPtr(triple), triple, value); 671 } 672 673 674/** 675 * Removes an attribute with the given index from the attribute set in 676 * this {@link XMLToken}. 677 * Nothing will be done if this {@link XMLToken} is not a start element. 678 <p> 679 * @param n an integer the index of the resource to be deleted 680 <p> 681 * @return integer value indicating success/failure of the 682 * function. The possible values 683 * returned by this function are: 684 * <ul> 685 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 686 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 687 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE } 688 * </ul> 689 */ public 690 int removeAttr(int n) { 691 return libsbmlJNI.XMLToken_removeAttr__SWIG_0(swigCPtr, this, n); 692 } 693 694 695/** 696 * Removes an attribute with the given local name and namespace URI from 697 * the attribute set in this {@link XMLToken}. 698 * Nothing will be done if this {@link XMLToken} is not a start element. 699 <p> 700 * @param name a string, the local name of the attribute. 701 * @param uri a string, the namespace URI of the attribute. 702 <p> 703 * @return integer value indicating success/failure of the 704 * function. The possible values 705 * returned by this function are: 706 * <ul> 707 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 708 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 709 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE } 710 * </ul> 711 */ public 712 int removeAttr(String name, String uri) { 713 return libsbmlJNI.XMLToken_removeAttr__SWIG_1(swigCPtr, this, name, uri); 714 } 715 716 717/** 718 * Removes an attribute with the given local name and namespace URI from 719 * the attribute set in this {@link XMLToken}. 720 * Nothing will be done if this {@link XMLToken} is not a start element. 721 <p> 722 * @param name a string, the local name of the attribute. 723 * @param uri a string, the namespace URI of the attribute. 724 <p> 725 * @return integer value indicating success/failure of the 726 * function. The possible values 727 * returned by this function are: 728 * <ul> 729 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 730 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 731 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE } 732 * </ul> 733 */ public 734 int removeAttr(String name) { 735 return libsbmlJNI.XMLToken_removeAttr__SWIG_2(swigCPtr, this, name); 736 } 737 738 739/** 740 * Removes an attribute with the given {@link XMLTriple} from the attribute set 741 * in this {@link XMLToken}. 742 * Nothing will be done if this {@link XMLToken} is not a start element. 743 <p> 744 * @param triple an {@link XMLTriple}, the XML triple of the attribute. 745 <p> 746 * @return integer value indicating success/failure of the 747 * function. The possible values 748 * returned by this function are: 749 * <ul> 750 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 751 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 752 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE } 753 * </ul> 754 */ public 755 int removeAttr(XMLTriple triple) { 756 return libsbmlJNI.XMLToken_removeAttr__SWIG_3(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 757 } 758 759 760/** 761 * Clears (deletes) all attributes in this {@link XMLToken}. 762 * Nothing will be done if this {@link XMLToken} is not a start element. 763 <p> 764 * @return integer value indicating success/failure of the 765 * function. The possible values 766 * returned by this function are: 767 * <ul> 768 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 769 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 770 * </ul> 771 */ public 772 int clearAttributes() { 773 return libsbmlJNI.XMLToken_clearAttributes(swigCPtr, this); 774 } 775 776 777/** 778 * Return the index of an attribute with the given local name and namespace URI. 779 <p> 780 * @param name a string, the local name of the attribute. 781 * @param uri a string, the namespace URI of the attribute. 782 <p> 783 * @return the index of an attribute with the given local name and namespace URI, 784 * or <code>-1</code> if not present. 785 <p> 786 * 787</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 788The native C++ implementation of this method defines a default argument 789value. In the documentation generated for different libSBML language 790bindings, you may or may not see corresponding arguments in the method 791declarations. For example, in Java and C#, a default argument is handled by 792declaring two separate methods, with one of them having the argument and 793the other one lacking the argument. However, the libSBML documentation will 794be <em>identical</em> for both methods. Consequently, if you are reading 795this and do not see an argument even though one is described, please look 796for descriptions of other variants of this method near where this one 797appears in the documentation. 798</dd></dl> 799 800 */ public 801 int getAttrIndex(String name, String uri) { 802 return libsbmlJNI.XMLToken_getAttrIndex__SWIG_0(swigCPtr, this, name, uri); 803 } 804 805 806/** 807 * Return the index of an attribute with the given local name and namespace URI. 808 <p> 809 * @param name a string, the local name of the attribute. 810 * @param uri a string, the namespace URI of the attribute. 811 <p> 812 * @return the index of an attribute with the given local name and namespace URI, 813 * or <code>-1</code> if not present. 814 <p> 815 * 816</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 817The native C++ implementation of this method defines a default argument 818value. In the documentation generated for different libSBML language 819bindings, you may or may not see corresponding arguments in the method 820declarations. For example, in Java and C#, a default argument is handled by 821declaring two separate methods, with one of them having the argument and 822the other one lacking the argument. However, the libSBML documentation will 823be <em>identical</em> for both methods. Consequently, if you are reading 824this and do not see an argument even though one is described, please look 825for descriptions of other variants of this method near where this one 826appears in the documentation. 827</dd></dl> 828 829 */ public 830 int getAttrIndex(String name) { 831 return libsbmlJNI.XMLToken_getAttrIndex__SWIG_1(swigCPtr, this, name); 832 } 833 834 835/** 836 * Return the index of an attribute with the given {@link XMLTriple}. 837 <p> 838 * @param triple an {@link XMLTriple}, the XML triple of the attribute for which 839 * the index is required. 840 <p> 841 * @return the index of an attribute with the given {@link XMLTriple}, or <code>-1</code> if not present. 842 */ public 843 int getAttrIndex(XMLTriple triple) { 844 return libsbmlJNI.XMLToken_getAttrIndex__SWIG_2(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 845 } 846 847 848/** 849 * Return the number of attributes in the attributes set. 850 <p> 851 * @return the number of attributes in the attributes set in this {@link XMLToken}. 852 */ public 853 int getAttributesLength() { 854 return libsbmlJNI.XMLToken_getAttributesLength(swigCPtr, this); 855 } 856 857 858/** 859 * Return the local name of an attribute in the attributes set in this 860 * {@link XMLToken} (by position). 861 <p> 862 * @param index an integer, the position of the attribute whose local name 863 * is required. 864 <p> 865 * @return the local name of an attribute in this list (by position). 866 <p> 867 * @note If index 868 * is out of range, an empty string will be returned. Use 869 * {@link XMLToken#hasAttr(int index)} 870 * to test for the attribute existence. 871 */ public 872 String getAttrName(int index) { 873 return libsbmlJNI.XMLToken_getAttrName(swigCPtr, this, index); 874 } 875 876 877/** 878 * Return the prefix of an attribute in the attribute set in this 879 * {@link XMLToken} (by position). 880 <p> 881 * @param index an integer, the position of the attribute whose prefix is 882 * required. 883 <p> 884 * @return the namespace prefix of an attribute in the attribute set 885 * (by position). 886 <p> 887 * @note If index is out of range, an empty string will be returned. Use 888 * {@link XMLToken#hasAttr(int index)} to test 889 * for the attribute existence. 890 */ public 891 String getAttrPrefix(int index) { 892 return libsbmlJNI.XMLToken_getAttrPrefix(swigCPtr, this, index); 893 } 894 895 896/** 897 * Return the prefixed name of an attribute in the attribute set in this 898 * {@link XMLToken} (by position). 899 <p> 900 * @param index an integer, the position of the attribute whose prefixed 901 * name is required. 902 <p> 903 * @return the prefixed name of an attribute in the attribute set 904 * (by position). 905 <p> 906 * @note If index is out of range, an empty string will be returned. Use 907 * {@link XMLToken#hasAttr(int index)} to test 908 * for attribute existence. 909 */ public 910 String getAttrPrefixedName(int index) { 911 return libsbmlJNI.XMLToken_getAttrPrefixedName(swigCPtr, this, index); 912 } 913 914 915/** 916 * Return the namespace URI of an attribute in the attribute set in this 917 * {@link XMLToken} (by position). 918 <p> 919 * @param index an integer, the position of the attribute whose namespace 920 * URI is required. 921 <p> 922 * @return the namespace URI of an attribute in the attribute set (by position). 923 <p> 924 * @note If index is out of range, an empty string will be returned. Use 925 * {@link XMLToken#hasAttr(int index)} to test 926 * for attribute existence. 927 */ public 928 String getAttrURI(int index) { 929 return libsbmlJNI.XMLToken_getAttrURI(swigCPtr, this, index); 930 } 931 932 933/** 934 * Return the value of an attribute in the attribute set in this {@link XMLToken} 935 * (by position). 936 <p> 937 * @param index an integer, the position of the attribute whose value is 938 * required. 939 <p> 940 * @return the value of an attribute in the attribute set (by position). 941 <p> 942 * @note If index is out of range, an empty string will be returned. Use 943 * {@link XMLToken#hasAttr(int index)} to test 944 * for attribute existence. 945 */ public 946 String getAttrValue(int index) { 947 return libsbmlJNI.XMLToken_getAttrValue__SWIG_0(swigCPtr, this, index); 948 } 949 950 951/** 952 * Return a value of an attribute with the given local name and namespace URI. 953 <p> 954 * @param name a string, the local name of the attribute whose value is required. 955 * @param uri a string, the namespace URI of the attribute. 956 <p> 957 * @return The attribute value as a string. 958 <p> 959 * @note If an attribute with the 960 * given local name and namespace URI does not exist, an empty string will be 961 * returned. 962 * Use {@link XMLToken#hasAttr(String name, String uri)} 963 * to test for attribute existence. 964 <p> 965 * 966</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 967The native C++ implementation of this method defines a default argument 968value. In the documentation generated for different libSBML language 969bindings, you may or may not see corresponding arguments in the method 970declarations. For example, in Java and C#, a default argument is handled by 971declaring two separate methods, with one of them having the argument and 972the other one lacking the argument. However, the libSBML documentation will 973be <em>identical</em> for both methods. Consequently, if you are reading 974this and do not see an argument even though one is described, please look 975for descriptions of other variants of this method near where this one 976appears in the documentation. 977</dd></dl> 978 979 */ public 980 String getAttrValue(String name, String uri) { 981 return libsbmlJNI.XMLToken_getAttrValue__SWIG_1(swigCPtr, this, name, uri); 982 } 983 984 985/** 986 * Return a value of an attribute with the given local name and namespace URI. 987 <p> 988 * @param name a string, the local name of the attribute whose value is required. 989 * @param uri a string, the namespace URI of the attribute. 990 <p> 991 * @return The attribute value as a string. 992 <p> 993 * @note If an attribute with the 994 * given local name and namespace URI does not exist, an empty string will be 995 * returned. 996 * Use {@link XMLToken#hasAttr(String name, String uri)} 997 * to test for attribute existence. 998 <p> 999 * 1000</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1001The native C++ implementation of this method defines a default argument 1002value. In the documentation generated for different libSBML language 1003bindings, you may or may not see corresponding arguments in the method 1004declarations. For example, in Java and C#, a default argument is handled by 1005declaring two separate methods, with one of them having the argument and 1006the other one lacking the argument. However, the libSBML documentation will 1007be <em>identical</em> for both methods. Consequently, if you are reading 1008this and do not see an argument even though one is described, please look 1009for descriptions of other variants of this method near where this one 1010appears in the documentation. 1011</dd></dl> 1012 1013 */ public 1014 String getAttrValue(String name) { 1015 return libsbmlJNI.XMLToken_getAttrValue__SWIG_2(swigCPtr, this, name); 1016 } 1017 1018 1019/** 1020 * Return a value of an attribute with the given {@link XMLTriple}. 1021 <p> 1022 * @param triple an {@link XMLTriple}, the XML triple of the attribute whose 1023 * value is required. 1024 <p> 1025 * @return The attribute value as a string. 1026 <p> 1027 * @note If an attribute with the 1028 * given {@link XMLTriple} does not exist, an empty string will be returned. 1029 * Use {@link XMLToken#hasAttr(XMLTriple triple)} 1030 * to test for attribute existence. 1031 */ public 1032 String getAttrValue(XMLTriple triple) { 1033 return libsbmlJNI.XMLToken_getAttrValue__SWIG_3(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 1034 } 1035 1036 1037/** 1038 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1039 * an attribute with the given index exists in the attribute set in this 1040 * {@link XMLToken}. 1041 <p> 1042 * @param index an integer, the position of the attribute. 1043 <p> 1044 * @return <code>true</code> if an attribute with the given index exists in the attribute 1045 * set in this {@link XMLToken}, <code>false</code> otherwise. 1046 */ public 1047 boolean hasAttr(int index) { 1048 return libsbmlJNI.XMLToken_hasAttr__SWIG_0(swigCPtr, this, index); 1049 } 1050 1051 1052/** 1053 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1054 * an attribute with the given local name and namespace URI exists 1055 * in the attribute set in this {@link XMLToken}. 1056 <p> 1057 * @param name a string, the local name of the attribute. 1058 * @param uri a string, the namespace URI of the attribute. 1059 <p> 1060 * @return <code>true</code> if an attribute with the given local name and namespace 1061 * URI exists in the attribute set in this {@link XMLToken}, <code>false</code> otherwise. 1062 <p> 1063 * 1064</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1065The native C++ implementation of this method defines a default argument 1066value. In the documentation generated for different libSBML language 1067bindings, you may or may not see corresponding arguments in the method 1068declarations. For example, in Java and C#, a default argument is handled by 1069declaring two separate methods, with one of them having the argument and 1070the other one lacking the argument. However, the libSBML documentation will 1071be <em>identical</em> for both methods. Consequently, if you are reading 1072this and do not see an argument even though one is described, please look 1073for descriptions of other variants of this method near where this one 1074appears in the documentation. 1075</dd></dl> 1076 1077 */ public 1078 boolean hasAttr(String name, String uri) { 1079 return libsbmlJNI.XMLToken_hasAttr__SWIG_1(swigCPtr, this, name, uri); 1080 } 1081 1082 1083/** 1084 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1085 * an attribute with the given local name and namespace URI exists 1086 * in the attribute set in this {@link XMLToken}. 1087 <p> 1088 * @param name a string, the local name of the attribute. 1089 * @param uri a string, the namespace URI of the attribute. 1090 <p> 1091 * @return <code>true</code> if an attribute with the given local name and namespace 1092 * URI exists in the attribute set in this {@link XMLToken}, <code>false</code> otherwise. 1093 <p> 1094 * 1095</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1096The native C++ implementation of this method defines a default argument 1097value. In the documentation generated for different libSBML language 1098bindings, you may or may not see corresponding arguments in the method 1099declarations. For example, in Java and C#, a default argument is handled by 1100declaring two separate methods, with one of them having the argument and 1101the other one lacking the argument. However, the libSBML documentation will 1102be <em>identical</em> for both methods. Consequently, if you are reading 1103this and do not see an argument even though one is described, please look 1104for descriptions of other variants of this method near where this one 1105appears in the documentation. 1106</dd></dl> 1107 1108 */ public 1109 boolean hasAttr(String name) { 1110 return libsbmlJNI.XMLToken_hasAttr__SWIG_2(swigCPtr, this, name); 1111 } 1112 1113 1114/** 1115 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1116 * an attribute with the given XML triple exists in the attribute set in 1117 * this {@link XMLToken} 1118 <p> 1119 * @param triple an {@link XMLTriple}, the XML triple of the attribute 1120 <p> 1121 * @return <code>true</code> if an attribute with the given XML triple exists 1122 * in the attribute set in this {@link XMLToken}, <code>false</code> otherwise. 1123 */ public 1124 boolean hasAttr(XMLTriple triple) { 1125 return libsbmlJNI.XMLToken_hasAttr__SWIG_3(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 1126 } 1127 1128 1129/** 1130 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1131 * the attribute set in this {@link XMLToken} set is empty. 1132 <p> 1133 * @return <code>true</code> if the attribute set in this {@link XMLToken} is empty, 1134 * <code>false</code> otherwise. 1135 */ public 1136 boolean isAttributesEmpty() { 1137 return libsbmlJNI.XMLToken_isAttributesEmpty(swigCPtr, this); 1138 } 1139 1140 1141/** 1142 * Returns the XML namespace declarations for this XML element. 1143 <p> 1144 * @return the XML namespace declarations for this XML element. 1145 */ public 1146 XMLNamespaces getNamespaces() { 1147 return new XMLNamespaces(libsbmlJNI.XMLToken_getNamespaces(swigCPtr, this), false); 1148 } 1149 1150 1151/** 1152 * Sets an XMLnamespaces to this XML element. 1153 * Nothing will be done if this {@link XMLToken} is not a start element. 1154 <p> 1155 * @param namespaces {@link XMLNamespaces} to be set to this {@link XMLToken}. 1156 <p> 1157 * @return integer value indicating success/failure of the 1158 * function. The possible values 1159 * returned by this function are: 1160 * <ul> 1161 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1162 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1163 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 1164 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 1165 * 1166 * </ul> <p> 1167 * @note This function replaces the existing {@link XMLNamespaces} with the new one. 1168 */ public 1169 int setNamespaces(XMLNamespaces namespaces) { 1170 return libsbmlJNI.XMLToken_setNamespaces(swigCPtr, this, XMLNamespaces.getCPtr(namespaces), namespaces); 1171 } 1172 1173 1174/** 1175 * Appends an XML namespace prefix and URI pair to this {@link XMLToken}. 1176 * If there is an XML namespace with the given prefix in this {@link XMLToken}, 1177 * then the existing XML namespace will be overwritten by the new one. 1178 <p> 1179 * Nothing will be done if this {@link XMLToken} is not a start element. 1180 <p> 1181 * @param uri a string, the uri for the namespace 1182 * @param prefix a string, the prefix for the namespace 1183 <p> 1184 * @return integer value indicating success/failure of the 1185 * function. The possible values 1186 * returned by this function are: 1187 * <ul> 1188 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1189 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 1190 * 1191 * </ul> <p> 1192 * 1193</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1194The native C++ implementation of this method defines a default argument 1195value. In the documentation generated for different libSBML language 1196bindings, you may or may not see corresponding arguments in the method 1197declarations. For example, in Java and C#, a default argument is handled by 1198declaring two separate methods, with one of them having the argument and 1199the other one lacking the argument. However, the libSBML documentation will 1200be <em>identical</em> for both methods. Consequently, if you are reading 1201this and do not see an argument even though one is described, please look 1202for descriptions of other variants of this method near where this one 1203appears in the documentation. 1204</dd></dl> 1205 1206 */ public 1207 int addNamespace(String uri, String prefix) { 1208 return libsbmlJNI.XMLToken_addNamespace__SWIG_0(swigCPtr, this, uri, prefix); 1209 } 1210 1211 1212/** 1213 * Appends an XML namespace prefix and URI pair to this {@link XMLToken}. 1214 * If there is an XML namespace with the given prefix in this {@link XMLToken}, 1215 * then the existing XML namespace will be overwritten by the new one. 1216 <p> 1217 * Nothing will be done if this {@link XMLToken} is not a start element. 1218 <p> 1219 * @param uri a string, the uri for the namespace 1220 * @param prefix a string, the prefix for the namespace 1221 <p> 1222 * @return integer value indicating success/failure of the 1223 * function. The possible values 1224 * returned by this function are: 1225 * <ul> 1226 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1227 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 1228 * 1229 * </ul> <p> 1230 * 1231</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1232The native C++ implementation of this method defines a default argument 1233value. In the documentation generated for different libSBML language 1234bindings, you may or may not see corresponding arguments in the method 1235declarations. For example, in Java and C#, a default argument is handled by 1236declaring two separate methods, with one of them having the argument and 1237the other one lacking the argument. However, the libSBML documentation will 1238be <em>identical</em> for both methods. Consequently, if you are reading 1239this and do not see an argument even though one is described, please look 1240for descriptions of other variants of this method near where this one 1241appears in the documentation. 1242</dd></dl> 1243 1244 */ public 1245 int addNamespace(String uri) { 1246 return libsbmlJNI.XMLToken_addNamespace__SWIG_1(swigCPtr, this, uri); 1247 } 1248 1249 1250/** 1251 * Removes an XML Namespace stored in the given position of the {@link XMLNamespaces} 1252 * of this {@link XMLToken}. 1253 * Nothing will be done if this {@link XMLToken} is not a start element. 1254 <p> 1255 * @param index an integer, position of the removed namespace. 1256 <p> 1257 * @return integer value indicating success/failure of the 1258 * function. The possible values 1259 * returned by this function are: 1260 * <ul> 1261 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1262 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 1263 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE } 1264 * </ul> 1265 */ public 1266 int removeNamespace(int index) { 1267 return libsbmlJNI.XMLToken_removeNamespace__SWIG_0(swigCPtr, this, index); 1268 } 1269 1270 1271/** 1272 * Removes an XML Namespace with the given prefix. 1273 * Nothing will be done if this {@link XMLToken} is not a start element. 1274 <p> 1275 * @param prefix a string, prefix of the required namespace. 1276 <p> 1277 * @return integer value indicating success/failure of the 1278 * function. The possible values 1279 * returned by this function are: 1280 * <ul> 1281 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1282 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 1283 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE } 1284 * </ul> 1285 */ public 1286 int removeNamespace(String prefix) { 1287 return libsbmlJNI.XMLToken_removeNamespace__SWIG_1(swigCPtr, this, prefix); 1288 } 1289 1290 1291/** 1292 * Clears (deletes) all XML namespace declarations in the {@link XMLNamespaces} of 1293 * this {@link XMLToken}. 1294 * Nothing will be done if this {@link XMLToken} is not a start element. 1295 <p> 1296 * @return integer value indicating success/failure of the 1297 * function. The possible values 1298 * returned by this function are: 1299 * <ul> 1300 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1301 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 1302 * </ul> 1303 */ public 1304 int clearNamespaces() { 1305 return libsbmlJNI.XMLToken_clearNamespaces(swigCPtr, this); 1306 } 1307 1308 1309/** 1310 * Look up the index of an XML namespace declaration by URI. 1311 <p> 1312 * @param uri a string, uri of the required namespace. 1313 <p> 1314 * @return the index of the given declaration, or <code>-1</code> if not present. 1315 */ public 1316 int getNamespaceIndex(String uri) { 1317 return libsbmlJNI.XMLToken_getNamespaceIndex(swigCPtr, this, uri); 1318 } 1319 1320 1321/** 1322 * Look up the index of an XML namespace declaration by prefix. 1323 <p> 1324 * @param prefix a string, prefix of the required namespace. 1325 <p> 1326 * @return the index of the given declaration, or <code>-1</code> if not present. 1327 */ public 1328 int getNamespaceIndexByPrefix(String prefix) { 1329 return libsbmlJNI.XMLToken_getNamespaceIndexByPrefix(swigCPtr, this, prefix); 1330 } 1331 1332 1333/** 1334 * Returns the number of XML namespaces stored in the {@link XMLNamespaces} 1335 * of this {@link XMLToken}. 1336 <p> 1337 * @return the number of namespaces in this list. 1338 */ public 1339 int getNamespacesLength() { 1340 return libsbmlJNI.XMLToken_getNamespacesLength(swigCPtr, this); 1341 } 1342 1343 1344/** 1345 * Look up the prefix of an XML namespace declaration by position. 1346 <p> 1347 * Callers should use getNamespacesLength() to find out how many 1348 * namespaces are stored in the {@link XMLNamespaces}. 1349 <p> 1350 * @param index an integer, position of the required prefix. 1351 <p> 1352 * @return the prefix of an XML namespace declaration in the {@link XMLNamespaces} 1353 * (by position). 1354 <p> 1355 * @note If index is out of range, an empty string will be 1356 * returned. 1357 <p> 1358 * @see #getNamespacesLength() 1359 */ public 1360 String getNamespacePrefix(int index) { 1361 return libsbmlJNI.XMLToken_getNamespacePrefix__SWIG_0(swigCPtr, this, index); 1362 } 1363 1364 1365/** 1366 * Look up the prefix of an XML namespace declaration by its URI. 1367 <p> 1368 * @param uri a string, the URI of the prefix being sought 1369 <p> 1370 * @return the prefix of an XML namespace declaration given its URI. 1371 <p> 1372 * @note If <code>uri</code> does not exist, an empty string will be returned. 1373 */ public 1374 String getNamespacePrefix(String uri) { 1375 return libsbmlJNI.XMLToken_getNamespacePrefix__SWIG_1(swigCPtr, this, uri); 1376 } 1377 1378 1379/** 1380 * Look up the URI of an XML namespace declaration by its position. 1381 <p> 1382 * @param index an integer, position of the required URI. 1383 <p> 1384 * @return the URI of an XML namespace declaration in the {@link XMLNamespaces} 1385 * (by position). 1386 <p> 1387 * @note If <code>index</code> is out of range, an empty string will be 1388 * returned. 1389 <p> 1390 * @see #getNamespacesLength() 1391 */ public 1392 String getNamespaceURI(int index) { 1393 return libsbmlJNI.XMLToken_getNamespaceURI__SWIG_0(swigCPtr, this, index); 1394 } 1395 1396 1397/** 1398 * Look up the URI of an XML namespace declaration by its prefix. 1399 <p> 1400 * @param prefix a string, the prefix of the required URI 1401 <p> 1402 * @return the URI of an XML namespace declaration given its prefix. 1403 <p> 1404 * @note If <code>prefix</code> does not exist, an empty string will be returned. 1405 <p> 1406 * 1407</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1408The native C++ implementation of this method defines a default argument 1409value. In the documentation generated for different libSBML language 1410bindings, you may or may not see corresponding arguments in the method 1411declarations. For example, in Java and C#, a default argument is handled by 1412declaring two separate methods, with one of them having the argument and 1413the other one lacking the argument. However, the libSBML documentation will 1414be <em>identical</em> for both methods. Consequently, if you are reading 1415this and do not see an argument even though one is described, please look 1416for descriptions of other variants of this method near where this one 1417appears in the documentation. 1418</dd></dl> 1419 1420 */ public 1421 String getNamespaceURI(String prefix) { 1422 return libsbmlJNI.XMLToken_getNamespaceURI__SWIG_1(swigCPtr, this, prefix); 1423 } 1424 1425 1426/** 1427 * Look up the URI of an XML namespace declaration by its prefix. 1428 <p> 1429 * @param prefix a string, the prefix of the required URI 1430 <p> 1431 * @return the URI of an XML namespace declaration given its prefix. 1432 <p> 1433 * @note If <code>prefix</code> does not exist, an empty string will be returned. 1434 <p> 1435 * 1436</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 1437The native C++ implementation of this method defines a default argument 1438value. In the documentation generated for different libSBML language 1439bindings, you may or may not see corresponding arguments in the method 1440declarations. For example, in Java and C#, a default argument is handled by 1441declaring two separate methods, with one of them having the argument and 1442the other one lacking the argument. However, the libSBML documentation will 1443be <em>identical</em> for both methods. Consequently, if you are reading 1444this and do not see an argument even though one is described, please look 1445for descriptions of other variants of this method near where this one 1446appears in the documentation. 1447</dd></dl> 1448 1449 */ public 1450 String getNamespaceURI() { 1451 return libsbmlJNI.XMLToken_getNamespaceURI__SWIG_2(swigCPtr, this); 1452 } 1453 1454 1455/** 1456 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1457 * the {@link XMLNamespaces} of this {@link XMLToken} is empty. 1458 <p> 1459 * @return <code>true</code> if the {@link XMLNamespaces} of this {@link XMLToken} is empty, 1460 * <code>false</code> otherwise. 1461 */ public 1462 boolean isNamespacesEmpty() { 1463 return libsbmlJNI.XMLToken_isNamespacesEmpty(swigCPtr, this); 1464 } 1465 1466 1467/** 1468 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1469 * an XML Namespace with the given URI is contained in the {@link XMLNamespaces} of 1470 * this {@link XMLToken}. 1471 <p> 1472 * @param uri a string, the uri for the namespace 1473 <p> 1474 * @return <code>true</code> if an XML Namespace with the given URI is contained in the 1475 * {@link XMLNamespaces} of this {@link XMLToken}, <code>false</code> otherwise. 1476 */ public 1477 boolean hasNamespaceURI(String uri) { 1478 return libsbmlJNI.XMLToken_hasNamespaceURI(swigCPtr, this, uri); 1479 } 1480 1481 1482/** 1483 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1484 * an XML Namespace with the given prefix is contained in the {@link XMLNamespaces} of 1485 * this {@link XMLToken}. 1486 <p> 1487 * @param prefix a string, the prefix for the namespace 1488 <p> 1489 * @return <code>true</code> if an XML Namespace with the given URI is contained in the 1490 * {@link XMLNamespaces} of this {@link XMLToken}, <code>false</code> otherwise. 1491 */ public 1492 boolean hasNamespacePrefix(String prefix) { 1493 return libsbmlJNI.XMLToken_hasNamespacePrefix(swigCPtr, this, prefix); 1494 } 1495 1496 1497/** 1498 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1499 * an XML Namespace with the given uri/prefix pair is contained in the 1500 * {@link XMLNamespaces} ofthis {@link XMLToken}. 1501 <p> 1502 * @param uri a string, the uri for the namespace 1503 * @param prefix a string, the prefix for the namespace 1504 <p> 1505 * @return <code>true</code> if an XML Namespace with the given uri/prefix pair is 1506 * contained in the {@link XMLNamespaces} of this {@link XMLToken}, <code>false</code> otherwise. 1507 */ public 1508 boolean hasNamespaceNS(String uri, String prefix) { 1509 return libsbmlJNI.XMLToken_hasNamespaceNS(swigCPtr, this, uri, prefix); 1510 } 1511 1512 1513/** 1514 * Sets the XMLTripe (name, uri and prefix) of this XML element. 1515 * Nothing will be done if this XML element is a text node. 1516 <p> 1517 * @param triple {@link XMLTriple} to be added to this XML element. 1518 <p> 1519 * @return integer value indicating success/failure of the 1520 * function. The possible values 1521 * returned by this function are: 1522 * <ul> 1523 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1524 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1525 * <li> {@link libsbmlConstants#LIBSBML_INVALID_XML_OPERATION LIBSBML_INVALID_XML_OPERATION } 1526 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 1527 * </ul> 1528 */ public 1529 int setTriple(XMLTriple triple) { 1530 return libsbmlJNI.XMLToken_setTriple(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 1531 } 1532 1533 1534/** 1535 * Returns the (unqualified) name of this XML element. 1536 <p> 1537 * @return the (unqualified) name of this XML element. 1538 */ public 1539 String getName() { 1540 return libsbmlJNI.XMLToken_getName(swigCPtr, this); 1541 } 1542 1543 1544/** 1545 * Returns the namespace prefix of this XML element. 1546 <p> 1547 * @return the namespace prefix of this XML element. 1548 <p> 1549 * @note If no prefix 1550 * exists, an empty string will be return. 1551 */ public 1552 String getPrefix() { 1553 return libsbmlJNI.XMLToken_getPrefix(swigCPtr, this); 1554 } 1555 1556 1557/** 1558 * Returns the namespace URI of this XML element. 1559 <p> 1560 * @return the namespace URI of this XML element. 1561 */ public 1562 String getURI() { 1563 return libsbmlJNI.XMLToken_getURI(swigCPtr, this); 1564 } 1565 1566 1567/** 1568 * Returns the text of this element. 1569 <p> 1570 * @return the characters of this XML text. 1571 */ public 1572 String getCharacters() { 1573 return libsbmlJNI.XMLToken_getCharacters(swigCPtr, this); 1574 } 1575 1576 1577/** 1578 * Appends characters to this XML text content. 1579 <p> 1580 * @param chars string, characters to append 1581 <p> 1582 * @return integer value indicating success/failure of the 1583 * function. The possible values 1584 * returned by this function are: 1585 * <ul> 1586 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1587 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1588 * </ul> 1589 */ public 1590 int append(String chars) { 1591 return libsbmlJNI.XMLToken_append(swigCPtr, this, chars); 1592 } 1593 1594 1595/** 1596 * Returns the column at which this {@link XMLToken} occurred in the input 1597 * document or data stream. 1598 <p> 1599 * @return the column at which this {@link XMLToken} occurred. 1600 */ public 1601 long getColumn() { 1602 return libsbmlJNI.XMLToken_getColumn(swigCPtr, this); 1603 } 1604 1605 1606/** 1607 * Returns the line at which this {@link XMLToken} occurred in the input document 1608 * or data stream. 1609 <p> 1610 * @return the line at which this {@link XMLToken} occurred. 1611 */ public 1612 long getLine() { 1613 return libsbmlJNI.XMLToken_getLine(swigCPtr, this); 1614 } 1615 1616 1617/** 1618 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1619 * this {@link XMLToken} is an XML element. 1620 <p> 1621 * @return <code>true</code> if this {@link XMLToken} is an XML element, <code>false</code> otherwise. 1622 */ public 1623 boolean isElement() { 1624 return libsbmlJNI.XMLToken_isElement(swigCPtr, this); 1625 } 1626 1627 1628/** 1629 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1630 * this {@link XMLToken} is an XML end element. 1631 <p> 1632 * @return <code>true</code> if this {@link XMLToken} is an XML end element, <code>false</code> otherwise. 1633 */ public 1634 boolean isEnd() { 1635 return libsbmlJNI.XMLToken_isEnd(swigCPtr, this); 1636 } 1637 1638 1639/** 1640 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1641 * this {@link XMLToken} is an XML end element for the given start element. 1642 <p> 1643 * @param element {@link XMLToken}, element for which query is made. 1644 <p> 1645 * @return <code>true</code> if this {@link XMLToken} is an XML end element for the given 1646 * {@link XMLToken} start element, <code>false</code> otherwise. 1647 */ public 1648 boolean isEndFor(XMLToken element) { 1649 return libsbmlJNI.XMLToken_isEndFor(swigCPtr, this, XMLToken.getCPtr(element), element); 1650 } 1651 1652 1653/** 1654 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1655 * this {@link XMLToken} is an end of file marker. 1656 <p> 1657 * @return <code>true</code> if this {@link XMLToken} is an end of file (input) marker, <code>false</code> 1658 * otherwise. 1659 */ public 1660 boolean isEOF() { 1661 return libsbmlJNI.XMLToken_isEOF(swigCPtr, this); 1662 } 1663 1664 1665/** 1666 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1667 * this {@link XMLToken} is an XML start element. 1668 <p> 1669 * @return <code>true</code> if this {@link XMLToken} is an XML start element, <code>false</code> otherwise. 1670 */ public 1671 boolean isStart() { 1672 return libsbmlJNI.XMLToken_isStart(swigCPtr, this); 1673 } 1674 1675 1676/** 1677 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1678 * this {@link XMLToken} is an XML text element. 1679 <p> 1680 * @return <code>true</code> if this {@link XMLToken} is an XML text element, <code>false</code> otherwise. 1681 */ public 1682 boolean isText() { 1683 return libsbmlJNI.XMLToken_isText(swigCPtr, this); 1684 } 1685 1686 1687/** 1688 * Declares this XML start element is also an end element. 1689 <p> 1690 * @return integer value indicating success/failure of the 1691 * function. The possible values 1692 * returned by this function are: 1693 * <ul> 1694 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1695 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1696 * </ul> 1697 */ public 1698 int setEnd() { 1699 return libsbmlJNI.XMLToken_setEnd(swigCPtr, this); 1700 } 1701 1702 1703/** 1704 * Declares this {@link XMLToken} is an end-of-file (input) marker. 1705 <p> 1706 * @return integer value indicating success/failure of the 1707 * function. The possible values 1708 * returned by this function are: 1709 * <ul> 1710 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1711 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1712 * </ul> 1713 */ public 1714 int setEOF() { 1715 return libsbmlJNI.XMLToken_setEOF(swigCPtr, this); 1716 } 1717 1718 1719/** 1720 * Declares this XML start/end element is no longer an end element. 1721 <p> 1722 * @return integer value indicating success/failure of the 1723 * function. The possible values 1724 * returned by this function are: 1725 * <ul> 1726 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1727 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1728 * </ul> 1729 */ public 1730 int unsetEnd() { 1731 return libsbmlJNI.XMLToken_unsetEnd(swigCPtr, this); 1732 } 1733 1734 1735/** 1736 * Prints a string representation of the underlying token stream, for 1737 * debugging purposes. 1738 */ public 1739 String toString() { 1740 return libsbmlJNI.XMLToken_toString(swigCPtr, this); 1741 } 1742 1743}