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 * Class to store SBML level, version and namespace information. 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 * There are differences in the definitions of components between different 024 * SBML Levels, as well as Versions within Levels. For example, the 025 * 'sboTerm' attribute was not introduced until Level 2 026 * Version 2, and then only on certain component classes; the SBML 027 * Level 2 Version 3 specification moved the 'sboTerm' attribute 028 * to the {@link SBase} class, thereby allowing nearly all components to have {@link SBO} 029 * annotations. As a result of differences such as those, libSBML needs to 030 * track the SBML Level and Version of every object created. 031 * <p> 032 * The purpose of the {@link SBMLNamespaces} object class is to make it easier to 033 * communicate SBML Level and Version data between libSBML constructors and 034 * other methods. The {@link SBMLNamespaces} object class tracks 3-tuples 035 * (triples) consisting of SBML Level, Version, and the corresponding SBML 036 * XML namespace. 037 * <p> 038 * The plural name (SBMLNamespaces) is not a mistake, because in SBML 039 * Level 3, objects may have extensions added by Level 3 packages 040 * used by a given model and therefore may have multiple namespaces 041 * associated with them; however, until the introduction of SBML 042 * Level 3, the {@link SBMLNamespaces} object only records one SBML 043 * Level/Version/namespace combination at a time. Most constructors for 044 * SBML objects in libSBML take a {@link SBMLNamespaces} object as an argument, 045 * thereby allowing the constructor to produce the proper combination of 046 * attributes and other internal data structures for the given SBML Level 047 * and Version. 048 */ 049 050public class SBMLNamespaces { 051 private long swigCPtr; 052 protected boolean swigCMemOwn; 053 054 protected SBMLNamespaces(long cPtr, boolean cMemoryOwn) 055 { 056 swigCMemOwn = cMemoryOwn; 057 swigCPtr = cPtr; 058 } 059 060 protected static long getCPtr(SBMLNamespaces obj) 061 { 062 return (obj == null) ? 0 : obj.swigCPtr; 063 } 064 065 protected static long getCPtrAndDisown (SBMLNamespaces obj) 066 { 067 long ptr = 0; 068 069 if (obj != null) 070 { 071 ptr = obj.swigCPtr; 072 obj.swigCMemOwn = false; 073 } 074 075 return ptr; 076 } 077 078 protected void finalize() { 079 delete(); 080 } 081 082 public synchronized void delete() { 083 if (swigCPtr != 0) { 084 if (swigCMemOwn) { 085 swigCMemOwn = false; 086 libsbmlJNI.delete_SBMLNamespaces(swigCPtr); 087 } 088 swigCPtr = 0; 089 } 090 } 091 092 /** 093 * Equality comparison method for SBMLNamespaces. 094 * <p> 095 * Because the Java methods for libSBML are actually wrappers around code 096 * implemented in C++ and C, certain operations will not behave as 097 * expected. Equality comparison is one such case. An instance of a 098 * libSBML object class is actually a <em>proxy object</em> 099 * wrapping the real underlying C/C++ object. The normal <code>==</code> 100 * equality operator in Java will <em>only compare the Java proxy objects</em>, 101 * not the underlying native object. The result is almost never what you 102 * want in practical situations. Unfortunately, Java does not provide a 103 * way to override <code>==</code>. 104 * <p> 105 * The alternative that must be followed is to use the 106 * <code>equals()</code> method. The <code>equals</code> method on this 107 * class overrides the default java.lang.Object one, and performs an 108 * intelligent comparison of instances of objects of this class. The 109 * result is an assessment of whether two libSBML Java objects are truly 110 * the same underlying native-code objects. 111 * <p> 112 * The use of this method in practice is the same as the use of any other 113 * Java <code>equals</code> method. For example, 114 * <em>a</em><code>.equals(</code><em>b</em><code>)</code> returns 115 * <code>true</code> if <em>a</em> and <em>b</em> are references to the 116 * same underlying object. 117 * 118 * @param sb a reference to an object to which the current object 119 * instance will be compared 120 * 121 * @return <code>true</code> if <code>sb</code> refers to the same underlying 122 * native object as this one, <code>false</code> otherwise 123 */ 124 public boolean equals(Object sb) 125 { 126 if ( this == sb ) 127 { 128 return true; 129 } 130 return swigCPtr == getCPtr((SBMLNamespaces)(sb)); 131 } 132 133 /** 134 * Returns a hashcode for this SBMLNamespaces object. 135 * 136 * @return a hash code usable by Java methods that need them. 137 */ 138 public int hashCode() 139 { 140 return (int)(swigCPtr^(swigCPtr>>>32)); 141 } 142 143 144/** 145 * Creates a new {@link SBMLNamespaces} object corresponding to the given SBML 146 * <code>level</code> and <code>version</code>. 147 * <p> 148 * {@link SBMLNamespaces} objects are used in libSBML to communicate SBML Level 149 * and Version data between constructors and other methods. The 150 * {@link SBMLNamespaces} object class tracks 3-tuples (triples) consisting of 151 * SBML Level, Version, and the corresponding SBML XML namespace. Most 152 * constructors for SBML objects in libSBML take a {@link SBMLNamespaces} object 153 * as an argument, thereby allowing the constructor to produce the proper 154 * combination of attributes and other internal data structures for the 155 * given SBML Level and Version. 156 * <p> 157 * The plural name (SBMLNamespaces) is not a mistake, because in SBML 158 * Level 3, objects may have extensions added by Level 3 159 * packages used by a given model and therefore may have multiple 160 * namespaces associated with them; however, until the introduction of 161 * SBML Level 3, the {@link SBMLNamespaces} object only records one SBML 162 * Level/Version/namespace combination at a time. Most constructors for 163 * SBML objects in libSBML take a {@link SBMLNamespaces} object as an argument, 164 * thereby allowing the constructor to produce the proper combination of 165 * attributes and other internal data structures for the given SBML Level 166 * and Version. 167 * <p> 168 * @param level the SBML level 169 * @param version the SBML version 170 * <p> 171 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 172</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 173The native C++ implementation of this method defines a default argument 174value. In the documentation generated for different libSBML language 175bindings, you may or may not see corresponding arguments in the method 176declarations. For example, in Java and C#, a default argument is handled by 177declaring two separate methods, with one of them having the argument and 178the other one lacking the argument. However, the libSBML documentation will 179be <em>identical</em> for both methods. Consequently, if you are reading 180this and do not see an argument even though one is described, please look 181for descriptions of other variants of this method near where this one 182appears in the documentation. 183</dd></dl> 184 185 */ public 186 SBMLNamespaces(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 187 this(libsbmlJNI.new_SBMLNamespaces__SWIG_0(level, version), true); 188 } 189 190 191/** 192 * Creates a new {@link SBMLNamespaces} object corresponding to the given SBML 193 * <code>level</code> and <code>version</code>. 194 * <p> 195 * {@link SBMLNamespaces} objects are used in libSBML to communicate SBML Level 196 * and Version data between constructors and other methods. The 197 * {@link SBMLNamespaces} object class tracks 3-tuples (triples) consisting of 198 * SBML Level, Version, and the corresponding SBML XML namespace. Most 199 * constructors for SBML objects in libSBML take a {@link SBMLNamespaces} object 200 * as an argument, thereby allowing the constructor to produce the proper 201 * combination of attributes and other internal data structures for the 202 * given SBML Level and Version. 203 * <p> 204 * The plural name (SBMLNamespaces) is not a mistake, because in SBML 205 * Level 3, objects may have extensions added by Level 3 206 * packages used by a given model and therefore may have multiple 207 * namespaces associated with them; however, until the introduction of 208 * SBML Level 3, the {@link SBMLNamespaces} object only records one SBML 209 * Level/Version/namespace combination at a time. Most constructors for 210 * SBML objects in libSBML take a {@link SBMLNamespaces} object as an argument, 211 * thereby allowing the constructor to produce the proper combination of 212 * attributes and other internal data structures for the given SBML Level 213 * and Version. 214 * <p> 215 * @param level the SBML level 216 * @param version the SBML version 217 * <p> 218 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 219</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 220The native C++ implementation of this method defines a default argument 221value. In the documentation generated for different libSBML language 222bindings, you may or may not see corresponding arguments in the method 223declarations. For example, in Java and C#, a default argument is handled by 224declaring two separate methods, with one of them having the argument and 225the other one lacking the argument. However, the libSBML documentation will 226be <em>identical</em> for both methods. Consequently, if you are reading 227this and do not see an argument even though one is described, please look 228for descriptions of other variants of this method near where this one 229appears in the documentation. 230</dd></dl> 231 232 */ public 233 SBMLNamespaces(long level) throws org.sbml.libsbml.SBMLConstructorException { 234 this(libsbmlJNI.new_SBMLNamespaces__SWIG_1(level), true); 235 } 236 237 238/** 239 * Creates a new {@link SBMLNamespaces} object corresponding to the given SBML 240 * <code>level</code> and <code>version</code>. 241 * <p> 242 * {@link SBMLNamespaces} objects are used in libSBML to communicate SBML Level 243 * and Version data between constructors and other methods. The 244 * {@link SBMLNamespaces} object class tracks 3-tuples (triples) consisting of 245 * SBML Level, Version, and the corresponding SBML XML namespace. Most 246 * constructors for SBML objects in libSBML take a {@link SBMLNamespaces} object 247 * as an argument, thereby allowing the constructor to produce the proper 248 * combination of attributes and other internal data structures for the 249 * given SBML Level and Version. 250 * <p> 251 * The plural name (SBMLNamespaces) is not a mistake, because in SBML 252 * Level 3, objects may have extensions added by Level 3 253 * packages used by a given model and therefore may have multiple 254 * namespaces associated with them; however, until the introduction of 255 * SBML Level 3, the {@link SBMLNamespaces} object only records one SBML 256 * Level/Version/namespace combination at a time. Most constructors for 257 * SBML objects in libSBML take a {@link SBMLNamespaces} object as an argument, 258 * thereby allowing the constructor to produce the proper combination of 259 * attributes and other internal data structures for the given SBML Level 260 * and Version. 261 * <p> 262 * @param level the SBML level 263 * @param version the SBML version 264 * <p> 265 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 266</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 267The native C++ implementation of this method defines a default argument 268value. In the documentation generated for different libSBML language 269bindings, you may or may not see corresponding arguments in the method 270declarations. For example, in Java and C#, a default argument is handled by 271declaring two separate methods, with one of them having the argument and 272the other one lacking the argument. However, the libSBML documentation will 273be <em>identical</em> for both methods. Consequently, if you are reading 274this and do not see an argument even though one is described, please look 275for descriptions of other variants of this method near where this one 276appears in the documentation. 277</dd></dl> 278 279 */ public 280 SBMLNamespaces() throws org.sbml.libsbml.SBMLConstructorException { 281 this(libsbmlJNI.new_SBMLNamespaces__SWIG_2(), true); 282 } 283 284 285/** 286 * (For Extension) 287 * <p> 288 * Creates a new {@link SBMLNamespaces} object corresponding to the combination of 289 * (1) the given SBML <code>level</code> and <code>version</code>, and (2) the given <code>package</code> 290 * with the <code>package</code> <code>version</code>. 291 * <p> 292 * @note {@link SBMLExtensionException} will be thrown if the extension module 293 * that supports the combination of the given sbml level, sbml version, 294 * package name, and package version has not been registered. 295 * <p> 296 * @param level the SBML level 297 * @param version the SBML version 298 * @param pkgName the string of package name (e.g. 'layout', 'multi') 299 * @param pkgVersion the package version 300 * @param pkgPrefix the prefix of the package namespace (e.g. 'layout', 'multi') to be added. 301 * The package's name will be used if the given string is empty (default). 302 * <p> 303 * <p> 304 */ public 305 SBMLNamespaces(long level, long version, String pkgName, long pkgVersion, String pkgPrefix) throws org.sbml.libsbml.SBMLConstructorException { 306 this(libsbmlJNI.new_SBMLNamespaces__SWIG_3(level, version, pkgName, pkgVersion, pkgPrefix), true); 307 } 308 309 310/** 311 * (For Extension) 312 * <p> 313 * Creates a new {@link SBMLNamespaces} object corresponding to the combination of 314 * (1) the given SBML <code>level</code> and <code>version</code>, and (2) the given <code>package</code> 315 * with the <code>package</code> <code>version</code>. 316 * <p> 317 * @note {@link SBMLExtensionException} will be thrown if the extension module 318 * that supports the combination of the given sbml level, sbml version, 319 * package name, and package version has not been registered. 320 * <p> 321 * @param level the SBML level 322 * @param version the SBML version 323 * @param pkgName the string of package name (e.g. 'layout', 'multi') 324 * @param pkgVersion the package version 325 * @param pkgPrefix the prefix of the package namespace (e.g. 'layout', 'multi') to be added. 326 * The package's name will be used if the given string is empty (default). 327 * <p> 328 * <p> 329 */ public 330 SBMLNamespaces(long level, long version, String pkgName, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 331 this(libsbmlJNI.new_SBMLNamespaces__SWIG_4(level, version, pkgName, pkgVersion), true); 332 } 333 334 335/** 336 * Copy constructor; creates a copy of a {@link SBMLNamespaces}. 337 * <p> 338 * @param orig the {@link SBMLNamespaces} instance to copy. 339 * <p> 340 * @throws SBMLConstructorException 341 * Thrown if the argument <code>orig</code> is <code>null.</code> 342 */ public 343 SBMLNamespaces(SBMLNamespaces orig) throws org.sbml.libsbml.SBMLConstructorException { 344 this(libsbmlJNI.new_SBMLNamespaces__SWIG_5(SBMLNamespaces.getCPtr(orig), orig), true); 345 } 346 347 348/** 349 * Creates and returns a deep copy of this {@link SBMLNamespaces}. 350 * <p> 351 * @return a (deep) copy of this {@link SBMLNamespaces}. 352 */ public 353 SBMLNamespaces cloneObject() { 354 return libsbml.DowncastSBMLNamespaces(libsbmlJNI.SBMLNamespaces_cloneObject(swigCPtr, this), true); 355} 356 357 358/** 359 * Returns a string representing the SBML XML namespace for the 360 * given <code>level</code> and <code>version</code> of SBML. 361 * <p> 362 * @param level the SBML level 363 * @param version the SBML version 364 * <p> 365 * @return a string representing the SBML namespace that reflects the 366 * SBML Level and Version specified. 367 * <p> 368 * @note Because this is a <em>static</em> method, the 369 * non-C++ language interfaces for libSBML will contain two variants. One 370 * will be a static method on the class (i.e., {@link SBMLNamespaces}), and the 371 * other will be a standalone top-level function with the name 372 * SBMLNamespaces_getSBMLNamespaceURI(). They are functionally 373 * identical. 374 */ public 375 static String getSBMLNamespaceURI(long level, long version) { 376 return libsbmlJNI.SBMLNamespaces_getSBMLNamespaceURI(level, version); 377 } 378 379 380/** 381 * Returns a list of all supported {@link SBMLNamespaces} in this version of 382 * {@link libsbml}. 383 * <p> 384 * @return a list with supported SBML namespaces. 385 * <p> 386 * @note Because this is a <em>static</em> method, the 387 * non-C++ language interfaces for libSBML will contain two variants. One 388 * will be a static method on the class (i.e., {@link SBMLNamespaces}), and the 389 * other will be a standalone top-level function with the name 390 * SBMLNamespaces_getSupportedNamespaces(). They are functionally 391 * identical. 392 */ public 393 static SBMLNamespacesList getSupportedNamespaces() { 394 long cPtr = libsbmlJNI.SBMLNamespaces_getSupportedNamespaces(); 395 return (cPtr == 0) ? null : new SBMLNamespacesList(cPtr, true); 396} 397 398 399/** 400 * Returns a string representing the SBML XML namespace of this 401 * object. 402 * <p> 403 * @return a string representing the SBML namespace that reflects the 404 * SBML Level and Version of this object. 405 */ public 406 String getURI() { 407 return libsbmlJNI.SBMLNamespaces_getURI(swigCPtr, this); 408 } 409 410 411/** 412 * Get the SBML Level of this {@link SBMLNamespaces} object. 413 * <p> 414 * @return the SBML Level of this {@link SBMLNamespaces} object. 415 */ public 416 long getLevel() { 417 return libsbmlJNI.SBMLNamespaces_getLevel__SWIG_0(swigCPtr, this); 418 } 419 420 421/** 422 * Get the SBML Version of this {@link SBMLNamespaces} object. 423 * <p> 424 * @return the SBML Version of this {@link SBMLNamespaces} object. 425 */ public 426 long getVersion() { 427 return libsbmlJNI.SBMLNamespaces_getVersion__SWIG_0(swigCPtr, this); 428 } 429 430 431/** 432 * Get the XML namespaces list for this {@link SBMLNamespaces} object. 433 * <p> 434 * The plural is not a mistake, because in SBML Level 3, objects may 435 * have extensions added by Level 3 packages used by a given model, 436 * and therefore there may be multiple XML namespaces involved too. 437 * However, until the introduction of SBML Level 3, the 438 * {@link SBMLNamespaces} object only records one SBML Level/Version/namespace 439 * combination at a time, and so this method will also only return 440 * a list of one item. 441 * <p> 442 * @return the XML namespaces of this {@link SBMLNamespaces} object. 443 */ public 444 XMLNamespaces getNamespaces() { 445 long cPtr = libsbmlJNI.SBMLNamespaces_getNamespaces__SWIG_0(swigCPtr, this); 446 return (cPtr == 0) ? null : new XMLNamespaces(cPtr, false); 447 } 448 449 450/** 451 * Add the given XML namespaces list to the set of namespaces within this 452 * {@link SBMLNamespaces} object. 453 * <p> 454 * The following code gives an example of how one could add the XHTML 455 * namespace to the list of namespaces recorded by the top-level 456 * <code><sbml></code> element of a model. It gives the new 457 * namespace a prefix of <code>html</code>. <div class='fragment'><pre> 458{@link SBMLDocument} sd; 459try 460{ 461 sd = new {@link SBMLDocument}(3, 1); 462} 463catch (SBMLConstructorException e) 464{ 465 // Here, have code to handle a truly exceptional situation. Candidate 466 // causes include invalid combinations of SBML Level and Version 467 // (impossible if hardwired as given here), running out of memory, and 468 // unknown system exceptions. 469} 470 471{@link SBMLNamespaces} sn = sd.getNamespaces(); 472if (sn != null) 473{ 474 sn.add('http://www.w3.org/1999/xhtml', 'html'); 475} 476else 477{ 478 // Handle another truly exceptional situation. 479 } 480</pre></div> 481 * <p> 482 * <p> 483 * @param xmlns the XML namespaces to be added. 484 * <p> 485 * @return integer value indicating success/failure of the 486 * function. The possible values 487 * returned by this function are: 488 * <ul> 489 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 490 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 491 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 492 * </ul> 493 */ public 494 int addNamespaces(XMLNamespaces xmlns) { 495 return libsbmlJNI.SBMLNamespaces_addNamespaces(swigCPtr, this, XMLNamespaces.getCPtr(xmlns), xmlns); 496 } 497 498 499/** 500 * Add an XML namespace (a pair of URI and prefix) to the set of namespaces 501 * within this {@link SBMLNamespaces} object. 502 * <p> 503 * @param uri the XML namespace to be added. 504 * @param prefix the prefix of the namespace to be added. 505 * <p> 506 * @return integer value indicating success/failure of the 507 * function. The possible values 508 * returned by this function are: 509 * <ul> 510 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 511 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 512 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT } 513 * </ul> 514 */ public 515 int addNamespace(String uri, String prefix) { 516 return libsbmlJNI.SBMLNamespaces_addNamespace(swigCPtr, this, uri, prefix); 517 } 518 519 520/** 521 * Removes an XML namespace from the set of namespaces within this 522 * {@link SBMLNamespaces} object. 523 * <p> 524 * @param uri the XML namespace to be added. 525 * <p> 526 * @return integer value indicating success/failure of the 527 * function. The possible values 528 * returned by this function are: 529 * <ul> 530 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 531 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE } 532 * </ul> 533 */ public 534 int removeNamespace(String uri) { 535 return libsbmlJNI.SBMLNamespaces_removeNamespace(swigCPtr, this, uri); 536 } 537 538 539/** 540 * Add an XML namespace (a pair of URI and prefix) of a package extension 541 * to the set of namespaces within this {@link SBMLNamespaces} object. 542 * The SBML Level and SBML Version of this object is used. 543 * <p> 544 * @note An XML namespace of a non-registered package extension can't be 545 * added by this function ({@link 546 * libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 547 * will be returned). 548 * <p> 549 * @param pkgName the string of package name (e.g. 'layout', 'multi') 550 * @param pkgVersion the package version 551 * @param prefix the prefix of the package namespace to be added. 552 * The package's name will be used if the given string is empty (default). 553 * <p> 554 * @return integer value indicating success/failure of the 555 * function. The possible values 556 * returned by this function are: 557 * <ul> 558 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 559 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 560 * </ul> 561 * <p> 562 * @see #addNamespace(String uri, String prefix) 563 */ public 564 int addPackageNamespace(String pkgName, long pkgVersion, String prefix) { 565 return libsbmlJNI.SBMLNamespaces_addPackageNamespace__SWIG_0(swigCPtr, this, pkgName, pkgVersion, prefix); 566 } 567 568 569/** 570 * Add an XML namespace (a pair of URI and prefix) of a package extension 571 * to the set of namespaces within this {@link SBMLNamespaces} object. 572 * The SBML Level and SBML Version of this object is used. 573 * <p> 574 * @note An XML namespace of a non-registered package extension can't be 575 * added by this function ({@link 576 * libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 577 * will be returned). 578 * <p> 579 * @param pkgName the string of package name (e.g. 'layout', 'multi') 580 * @param pkgVersion the package version 581 * @param prefix the prefix of the package namespace to be added. 582 * The package's name will be used if the given string is empty (default). 583 * <p> 584 * @return integer value indicating success/failure of the 585 * function. The possible values 586 * returned by this function are: 587 * <ul> 588 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 589 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 590 * </ul> 591 * <p> 592 * @see #addNamespace(String uri, String prefix) 593 */ public 594 int addPackageNamespace(String pkgName, long pkgVersion) { 595 return libsbmlJNI.SBMLNamespaces_addPackageNamespace__SWIG_1(swigCPtr, this, pkgName, pkgVersion); 596 } 597 598 599/** 600 * Add the XML namespaces of package extensions in the given 601 * XMLNamespace object to the set of namespaces within this 602 * {@link SBMLNamespaces} object (Non-package XML namespaces are not added 603 * by this function). 604 * <p> 605 * @note XML namespaces of a non-registered package extensions are not 606 * added (just ignored) by this function. {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 607 * will be returned if the given xmlns is null. 608 * <p> 609 * @param xmlns the XML namespaces to be added. 610 * <p> 611 * @return integer value indicating success/failure of the 612 * function. The possible values 613 * returned by this function are: 614 * <ul> 615 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 616 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 617 * </ul> 618 */ public 619 int addPackageNamespaces(XMLNamespaces xmlns) { 620 return libsbmlJNI.SBMLNamespaces_addPackageNamespaces(swigCPtr, this, XMLNamespaces.getCPtr(xmlns), xmlns); 621 } 622 623 624/** 625 * Removes an XML namespace of a package extension from the set of namespaces 626 * within this {@link SBMLNamespaces} object. 627 * <p> 628 * @param level the SBML level 629 * @param version the SBML version 630 * @param pkgName the string of package name (e.g. 'layout', 'multi') 631 * @param pkgVersion the package version 632 * <p> 633 * @return integer value indicating success/failure of the 634 * function. The possible values 635 * returned by this function are: 636 * <ul> 637 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 638 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 639 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE } 640 * </ul> 641 */ public 642 int removePackageNamespace(long level, long version, String pkgName, long pkgVersion) { 643 return libsbmlJNI.SBMLNamespaces_removePackageNamespace(swigCPtr, this, level, version, pkgName, pkgVersion); 644 } 645 646 647/** 648 * Add an XML namespace (a pair of URI and prefix) of a package extension 649 * to the set of namespaces within this {@link SBMLNamespaces} object. 650 * The SBML Level and SBML Version of this object is used. 651 * <p> 652 * @note An XML namespace of a non-registered package extension can't be 653 * added by this function ({@link 654 * libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 655 * will be returned). 656 * <p> 657 * @param pkgName the string of package name (e.g. 'layout', 'multi') 658 * @param pkgVersion the package version 659 * @param prefix the prefix of the package namespace to be added. 660 * The package's name will be used if the given string is empty (default). 661 * <p> 662 * @return integer value indicating success/failure of the 663 * function. The possible values 664 * returned by this function are: 665 * <ul> 666 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 667 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 668 * </ul> 669 * <p> 670 * @see #addNamespace(String uri, String prefix) 671 * @internal 672 */ public 673 int addPkgNamespace(String pkgName, long pkgVersion, String prefix) { 674 return libsbmlJNI.SBMLNamespaces_addPkgNamespace__SWIG_0(swigCPtr, this, pkgName, pkgVersion, prefix); 675 } 676 677 678/** 679 * Add an XML namespace (a pair of URI and prefix) of a package extension 680 * to the set of namespaces within this {@link SBMLNamespaces} object. 681 * The SBML Level and SBML Version of this object is used. 682 * <p> 683 * @note An XML namespace of a non-registered package extension can't be 684 * added by this function ({@link 685 * libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 686 * will be returned). 687 * <p> 688 * @param pkgName the string of package name (e.g. 'layout', 'multi') 689 * @param pkgVersion the package version 690 * @param prefix the prefix of the package namespace to be added. 691 * The package's name will be used if the given string is empty (default). 692 * <p> 693 * @return integer value indicating success/failure of the 694 * function. The possible values 695 * returned by this function are: 696 * <ul> 697 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 698 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 699 * </ul> 700 * <p> 701 * @see #addNamespace(String uri, String prefix) 702 * @internal 703 */ public 704 int addPkgNamespace(String pkgName, long pkgVersion) { 705 return libsbmlJNI.SBMLNamespaces_addPkgNamespace__SWIG_1(swigCPtr, this, pkgName, pkgVersion); 706 } 707 708 709/** 710 * Add the XML namespaces of package extensions in the given 711 * XMLNamespace object to the set of namespaces within this 712 * {@link SBMLNamespaces} object (Non-package XML namespaces are not added 713 * by this function). 714 * <p> 715 * @note XML namespaces of a non-registered package extensions are not 716 * added (just ignored) by this function. {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 717 * will be returned if the given xmlns is null. 718 * <p> 719 * @param xmlns the XML namespaces to be added. 720 * <p> 721 * @return integer value indicating success/failure of the 722 * function. The possible values 723 * returned by this function are: 724 * <ul> 725 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 726 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 727 * </ul> 728 * @internal 729 */ public 730 int addPkgNamespaces(XMLNamespaces xmlns) { 731 return libsbmlJNI.SBMLNamespaces_addPkgNamespaces(swigCPtr, this, XMLNamespaces.getCPtr(xmlns), xmlns); 732 } 733 734 735/** 736 * Removes an XML namespace of a package extension from the set of namespaces 737 * within this {@link SBMLNamespaces} object. 738 * <p> 739 * @param level the SBML level 740 * @param version the SBML version 741 * @param pkgName the string of package name (e.g. 'layout', 'multi') 742 * @param pkgVersion the package version 743 * <p> 744 * @return integer value indicating success/failure of the 745 * function. The possible values 746 * returned by this function are: 747 * <ul> 748 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 749 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 750 * <li> {@link libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE } 751 * </ul> 752 * @internal 753 */ public 754 int removePkgNamespace(long level, long version, String pkgName, long pkgVersion) { 755 return libsbmlJNI.SBMLNamespaces_removePkgNamespace(swigCPtr, this, level, version, pkgName, pkgVersion); 756 } 757 758 759/** 760 * Predicate returning <code>true</code> if the given 761 * URL is one of SBML XML namespaces. 762 * <p> 763 * @param uri the URI of namespace 764 * <p> 765 * @return <code>true</code> if the 'uri' is one of SBML namespaces, <code>false</code> otherwise. 766 * <p> 767 * @note Because this is a <em>static</em> method, the 768 * non-C++ language interfaces for libSBML will contain two variants. One 769 * will be a static method on the class (i.e., {@link SBMLNamespaces}), and the 770 * other will be a standalone top-level function with the name 771 * SBMLNamespaces_isSBMLNamespace(). They are functionally 772 * identical. 773 */ public 774 static boolean isSBMLNamespace(String uri) { 775 return libsbmlJNI.SBMLNamespaces_isSBMLNamespace(uri); 776 } 777 778 779/** 780 * Predicate returning <code>true</code> if the given 781 * set of namespaces represent a valid set 782 * <p> 783 * @return <code>true</code> if the set of namespaces is valid, <code>false</code> otherwise. 784 */ public 785 boolean isValidCombination() { 786 return libsbmlJNI.SBMLNamespaces_isValidCombination(swigCPtr, this); 787 } 788 789 790/** 791 * Returns the name of the main package for this namespace. 792 * <p> 793 * @return the name of the main package for this namespace. 794 * 'core' will be returned if this namespace is defined in the SBML 795 * core. 796 */ public 797 String getPackageName() { 798 return libsbmlJNI.SBMLNamespaces_getPackageName(swigCPtr, this); 799 } 800 801}