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