001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 2.0.12
004 *
005 * Do not make changes to this file unless you know what you are doing--modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.sbml.libsbml;
010
011/** 
012 *  Class to store SBML Level, Version and namespace
013 * 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&nbsp;2
026 * Version&nbsp;2, and then only on certain component classes; the SBML
027 * Level&nbsp;2 Version&nbsp;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&nbsp;3, objects may have extensions added by Level&nbsp;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&nbsp;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   * <p>
149 * {@link SBMLNamespaces} objects are used in libSBML to communicate SBML Level and
150 * Version data between constructors and other methods.  The {@link SBMLNamespaces}
151 * object class holds triples consisting of SBML Level, Version, and the
152 * corresponding SBML XML namespace.  Most constructors for SBML objects in
153 * libSBML take a {@link SBMLNamespaces} object as an argument, thereby allowing
154 * the constructor to produce the proper combination of attributes and
155 * other internal data structures for the given SBML Level and Version.
156 <p>
157 * The plural name (SBMLNamespaces) is not a mistake, because in SBML
158 * Level&nbsp;3, objects may have extensions added by Level&nbsp;3 packages
159 * used by a given model and therefore may have multiple namespaces
160 * associated with them.  In SBML Levels below Level&nbsp;3, the
161 * {@link SBMLNamespaces} object only records one SBML Level/Version/namespace
162 * combination at a time.  Most constructors for SBML objects in libSBML
163 * take a {@link SBMLNamespaces} object as an argument, thereby allowing the
164 * constructor to produce the proper combination of attributes and other
165 * internal data structures for the given SBML Level and Version. 
166   <p>
167   * @param level the SBML level
168   * @param version the SBML version
169   <p>
170   * 
171</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
172The native C++ implementation of this method defines a default argument
173value. In the documentation generated for different libSBML language
174bindings, you may or may not see corresponding arguments in the method
175declarations. For example, in Java and C#, a default argument is handled by
176declaring two separate methods, with one of them having the argument and
177the other one lacking the argument. However, the libSBML documentation will
178be <em>identical</em> for both methods. Consequently, if you are reading
179this and do not see an argument even though one is described, please look
180for descriptions of other variants of this method near where this one
181appears in the documentation.
182</dd></dl>
183 
184   */ public
185 SBMLNamespaces(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
186    this(libsbmlJNI.new_SBMLNamespaces__SWIG_0(level, version), true);
187  }
188
189  
190/**
191   * Creates a new {@link SBMLNamespaces} object corresponding to the given SBML
192   * <code>level</code> and <code>version</code>.
193   <p>
194   * <p>
195 * {@link SBMLNamespaces} objects are used in libSBML to communicate SBML Level and
196 * Version data between constructors and other methods.  The {@link SBMLNamespaces}
197 * object class holds triples consisting of SBML Level, Version, and the
198 * corresponding SBML XML namespace.  Most constructors for SBML objects in
199 * libSBML take a {@link SBMLNamespaces} object as an argument, thereby allowing
200 * the constructor to produce the proper combination of attributes and
201 * other internal data structures for the given SBML Level and Version.
202 <p>
203 * The plural name (SBMLNamespaces) is not a mistake, because in SBML
204 * Level&nbsp;3, objects may have extensions added by Level&nbsp;3 packages
205 * used by a given model and therefore may have multiple namespaces
206 * associated with them.  In SBML Levels below Level&nbsp;3, the
207 * {@link SBMLNamespaces} object only records one SBML Level/Version/namespace
208 * combination at a time.  Most constructors for SBML objects in libSBML
209 * take a {@link SBMLNamespaces} object as an argument, thereby allowing the
210 * constructor to produce the proper combination of attributes and other
211 * internal data structures for the given SBML Level and Version. 
212   <p>
213   * @param level the SBML level
214   * @param version the SBML version
215   <p>
216   * 
217</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
218The native C++ implementation of this method defines a default argument
219value. In the documentation generated for different libSBML language
220bindings, you may or may not see corresponding arguments in the method
221declarations. For example, in Java and C#, a default argument is handled by
222declaring two separate methods, with one of them having the argument and
223the other one lacking the argument. However, the libSBML documentation will
224be <em>identical</em> for both methods. Consequently, if you are reading
225this and do not see an argument even though one is described, please look
226for descriptions of other variants of this method near where this one
227appears in the documentation.
228</dd></dl>
229 
230   */ public
231 SBMLNamespaces(long level) throws org.sbml.libsbml.SBMLConstructorException {
232    this(libsbmlJNI.new_SBMLNamespaces__SWIG_1(level), true);
233  }
234
235  
236/**
237   * Creates a new {@link SBMLNamespaces} object corresponding to the given SBML
238   * <code>level</code> and <code>version</code>.
239   <p>
240   * <p>
241 * {@link SBMLNamespaces} objects are used in libSBML to communicate SBML Level and
242 * Version data between constructors and other methods.  The {@link SBMLNamespaces}
243 * object class holds triples consisting of SBML Level, Version, and the
244 * corresponding SBML XML namespace.  Most constructors for SBML objects in
245 * libSBML take a {@link SBMLNamespaces} object as an argument, thereby allowing
246 * the constructor to produce the proper combination of attributes and
247 * other internal data structures for the given SBML Level and Version.
248 <p>
249 * The plural name (SBMLNamespaces) is not a mistake, because in SBML
250 * Level&nbsp;3, objects may have extensions added by Level&nbsp;3 packages
251 * used by a given model and therefore may have multiple namespaces
252 * associated with them.  In SBML Levels below Level&nbsp;3, the
253 * {@link SBMLNamespaces} object only records one SBML Level/Version/namespace
254 * combination at a time.  Most constructors for SBML objects in libSBML
255 * take a {@link SBMLNamespaces} object as an argument, thereby allowing the
256 * constructor to produce the proper combination of attributes and other
257 * internal data structures for the given SBML Level and Version. 
258   <p>
259   * @param level the SBML level
260   * @param version the SBML version
261   <p>
262   * 
263</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
264The native C++ implementation of this method defines a default argument
265value. In the documentation generated for different libSBML language
266bindings, you may or may not see corresponding arguments in the method
267declarations. For example, in Java and C#, a default argument is handled by
268declaring two separate methods, with one of them having the argument and
269the other one lacking the argument. However, the libSBML documentation will
270be <em>identical</em> for both methods. Consequently, if you are reading
271this and do not see an argument even though one is described, please look
272for descriptions of other variants of this method near where this one
273appears in the documentation.
274</dd></dl>
275 
276   */ public
277 SBMLNamespaces() throws org.sbml.libsbml.SBMLConstructorException {
278    this(libsbmlJNI.new_SBMLNamespaces__SWIG_2(), true);
279  }
280
281  
282/**
283   * (For extensions) Creates a new {@link SBMLNamespaces} object corresponding to
284   * the combination of (1) the given SBML <code>level</code> and <code>version</code>, and (2)
285   * the given <code>package</code> with the <code>package</code> <code>version</code>.
286   <p>
287   * <p>
288 * {@link SBMLNamespaces} objects are used in libSBML to communicate SBML Level and
289 * Version data between constructors and other methods.  The {@link SBMLNamespaces}
290 * object class holds triples consisting of SBML Level, Version, and the
291 * corresponding SBML XML namespace.  Most constructors for SBML objects in
292 * libSBML take a {@link SBMLNamespaces} object as an argument, thereby allowing
293 * the constructor to produce the proper combination of attributes and
294 * other internal data structures for the given SBML Level and Version.
295 <p>
296 * The plural name (SBMLNamespaces) is not a mistake, because in SBML
297 * Level&nbsp;3, objects may have extensions added by Level&nbsp;3 packages
298 * used by a given model and therefore may have multiple namespaces
299 * associated with them.  In SBML Levels below Level&nbsp;3, the
300 * {@link SBMLNamespaces} object only records one SBML Level/Version/namespace
301 * combination at a time.  Most constructors for SBML objects in libSBML
302 * take a {@link SBMLNamespaces} object as an argument, thereby allowing the
303 * constructor to produce the proper combination of attributes and other
304 * internal data structures for the given SBML Level and Version. 
305   <p>
306   * @param level   the SBML Level
307   * @param version the SBML Version
308   * @param pkgName the string of package name (e.g. 'layout', 'multi')
309   * @param pkgVersion the package version
310   * @param pkgPrefix the prefix of the package namespace (e.g. 'layout', 'multi') to be added.
311   *        The package's name will be used if the given string is empty (default).
312   <p>
313   * @throws SBMLExtensionException if the extension module that supports the
314   * combination of the given SBML Level, SBML Version, package name, and
315   * package version has not been registered with libSBML.
316   */ public
317 SBMLNamespaces(long level, long version, String pkgName, long pkgVersion, String pkgPrefix) throws org.sbml.libsbml.SBMLConstructorException {
318    this(libsbmlJNI.new_SBMLNamespaces__SWIG_3(level, version, pkgName, pkgVersion, pkgPrefix), true);
319  }
320
321  
322/**
323   * (For extensions) Creates a new {@link SBMLNamespaces} object corresponding to
324   * the combination of (1) the given SBML <code>level</code> and <code>version</code>, and (2)
325   * the given <code>package</code> with the <code>package</code> <code>version</code>.
326   <p>
327   * <p>
328 * {@link SBMLNamespaces} objects are used in libSBML to communicate SBML Level and
329 * Version data between constructors and other methods.  The {@link SBMLNamespaces}
330 * object class holds triples consisting of SBML Level, Version, and the
331 * corresponding SBML XML namespace.  Most constructors for SBML objects in
332 * libSBML take a {@link SBMLNamespaces} object as an argument, thereby allowing
333 * the constructor to produce the proper combination of attributes and
334 * other internal data structures for the given SBML Level and Version.
335 <p>
336 * The plural name (SBMLNamespaces) is not a mistake, because in SBML
337 * Level&nbsp;3, objects may have extensions added by Level&nbsp;3 packages
338 * used by a given model and therefore may have multiple namespaces
339 * associated with them.  In SBML Levels below Level&nbsp;3, the
340 * {@link SBMLNamespaces} object only records one SBML Level/Version/namespace
341 * combination at a time.  Most constructors for SBML objects in libSBML
342 * take a {@link SBMLNamespaces} object as an argument, thereby allowing the
343 * constructor to produce the proper combination of attributes and other
344 * internal data structures for the given SBML Level and Version. 
345   <p>
346   * @param level   the SBML Level
347   * @param version the SBML Version
348   * @param pkgName the string of package name (e.g. 'layout', 'multi')
349   * @param pkgVersion the package version
350   * @param pkgPrefix the prefix of the package namespace (e.g. 'layout', 'multi') to be added.
351   *        The package's name will be used if the given string is empty (default).
352   <p>
353   * @throws SBMLExtensionException if the extension module that supports the
354   * combination of the given SBML Level, SBML Version, package name, and
355   * package version has not been registered with libSBML.
356   */ public
357 SBMLNamespaces(long level, long version, String pkgName, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
358    this(libsbmlJNI.new_SBMLNamespaces__SWIG_4(level, version, pkgName, pkgVersion), true);
359  }
360
361  
362/**
363   * Copy constructor; creates a copy of a {@link SBMLNamespaces}.
364   <p>
365   * @param orig the {@link SBMLNamespaces} instance to copy.
366   <p>
367   * @throws SBMLConstructorException 
368   * Thrown if the argument <code>orig</code> is <code>null.</code>
369   */ public
370 SBMLNamespaces(SBMLNamespaces orig) throws org.sbml.libsbml.SBMLConstructorException {
371    this(libsbmlJNI.new_SBMLNamespaces__SWIG_5(SBMLNamespaces.getCPtr(orig), orig), true);
372  }
373
374  
375/**
376   * Creates and returns a deep copy of this {@link SBMLNamespaces}.
377   <p>
378   * @return a (deep) copy of this {@link SBMLNamespaces}.
379   */ public
380 SBMLNamespaces cloneObject() {
381  return libsbml.DowncastSBMLNamespaces(libsbmlJNI.SBMLNamespaces_cloneObject(swigCPtr, this), true);
382}
383
384  
385/**
386   * Returns a string representing the SBML XML namespace for the 
387   * given <code>level</code> and <code>version</code> of SBML.
388   <p>
389   * @param level the SBML level
390   * @param version the SBML version
391   <p>
392   * @return a string representing the SBML namespace that reflects the
393   * SBML Level and Version specified.
394   <p>
395   * 
396   */ public
397 static String getSBMLNamespaceURI(long level, long version) {
398    return libsbmlJNI.SBMLNamespaces_getSBMLNamespaceURI(level, version);
399  }
400
401  
402/**
403   * Returns a list of all supported {@link SBMLNamespaces} in this version of 
404   * libsbml. 
405   <p>
406   * @return a list with supported SBML namespaces. 
407   <p>
408   * 
409   */ public
410 static  SBMLNamespacesList  getSupportedNamespaces() { 
411  long cPtr = libsbmlJNI.SBMLNamespaces_getSupportedNamespaces();
412  return (cPtr == 0) ? null : new  SBMLNamespacesList(cPtr, true);
413}
414
415  
416/**
417   * Frees the list of supported namespaces as generated by
418   * getSupportedNamespaces().
419   <p>
420   * @param supportedNS the list to be freed.
421   <p>
422   * 
423   */ public
424 static void freeSBMLNamespaces(SWIGTYPE_p_List supportedNS) {
425    libsbmlJNI.SBMLNamespaces_freeSBMLNamespaces(SWIGTYPE_p_List.getCPtr(supportedNS));
426  }
427
428  
429/**
430   * Returns a string representing the SBML XML namespace of this
431   * object.
432   <p>
433   * @return a string representing the SBML namespace that reflects the
434   * SBML Level and Version of this object.
435   */ public
436 String getURI() {
437    return libsbmlJNI.SBMLNamespaces_getURI(swigCPtr, this);
438  }
439
440  
441/**
442   * Get the SBML Level of this {@link SBMLNamespaces} object.
443   <p>
444   * @return the SBML Level of this {@link SBMLNamespaces} object.
445   */ public
446 long getLevel() {
447    return libsbmlJNI.SBMLNamespaces_getLevel__SWIG_0(swigCPtr, this);
448  }
449
450  
451/**
452   * Get the SBML Version of this {@link SBMLNamespaces} object.
453   <p>
454   * @return the SBML Version of this {@link SBMLNamespaces} object.
455   */ public
456 long getVersion() {
457    return libsbmlJNI.SBMLNamespaces_getVersion__SWIG_0(swigCPtr, this);
458  }
459
460  
461/**
462   * Get the XML namespaces list for this {@link SBMLNamespaces} object.
463   <p>
464   * <p>
465 * {@link SBMLNamespaces} objects are used in libSBML to communicate SBML Level and
466 * Version data between constructors and other methods.  The {@link SBMLNamespaces}
467 * object class holds triples consisting of SBML Level, Version, and the
468 * corresponding SBML XML namespace.  Most constructors for SBML objects in
469 * libSBML take a {@link SBMLNamespaces} object as an argument, thereby allowing
470 * the constructor to produce the proper combination of attributes and
471 * other internal data structures for the given SBML Level and Version.
472 <p>
473 * The plural name (SBMLNamespaces) is not a mistake, because in SBML
474 * Level&nbsp;3, objects may have extensions added by Level&nbsp;3 packages
475 * used by a given model and therefore may have multiple namespaces
476 * associated with them.  In SBML Levels below Level&nbsp;3, the
477 * {@link SBMLNamespaces} object only records one SBML Level/Version/namespace
478 * combination at a time.  Most constructors for SBML objects in libSBML
479 * take a {@link SBMLNamespaces} object as an argument, thereby allowing the
480 * constructor to produce the proper combination of attributes and other
481 * internal data structures for the given SBML Level and Version.
482   <p>
483   * @return the XML namespaces of this {@link SBMLNamespaces} object.
484   */ public
485 XMLNamespaces getNamespaces() {
486    long cPtr = libsbmlJNI.SBMLNamespaces_getNamespaces__SWIG_0(swigCPtr, this);
487    return (cPtr == 0) ? null : new XMLNamespaces(cPtr, false);
488  }
489
490  
491/**
492   * Add the given XML namespaces list to the set of namespaces within this
493   * {@link SBMLNamespaces} object.
494   <p>
495   * The following code gives an example of how one could add the XHTML
496   * namespace to the list of namespaces recorded by the top-level
497   * <code>&lt;sbml&gt;</code> element of a model.  It gives the new
498   * namespace a prefix of <code>html</code>.  <div class='fragment'><pre class='fragment'>
499{@link SBMLDocument} sd;
500try 
501{
502    sd = new {@link SBMLDocument}(3, 1);
503} 
504catch (SBMLConstructorException e)
505{
506    // Here, have code to handle a truly exceptional situation. Candidate
507    // causes include invalid combinations of SBML Level and Version
508    // (impossible if hardwired as given here), running out of memory, and
509    // unknown system exceptions.
510}
511
512{@link SBMLNamespaces} sn = sd.getNamespaces();
513if (sn != null)
514{
515    sn.add('http://www.w3.org/1999/xhtml', 'html');
516}
517else
518{
519    // Handle another truly exceptional situation.
520 }
521</pre></div>
522   <p>
523   <p>
524   * @param xmlns the XML namespaces 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_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
532   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT }
533   * </ul>
534   */ public
535 int addNamespaces(XMLNamespaces xmlns) {
536    return libsbmlJNI.SBMLNamespaces_addNamespaces(swigCPtr, this, XMLNamespaces.getCPtr(xmlns), xmlns);
537  }
538
539  
540/**
541   * Add an XML namespace (a pair of URI and prefix) to the set of namespaces
542   * within this {@link SBMLNamespaces} object.
543   <p>
544   * @param uri    the XML namespace to be added.
545   * @param prefix the prefix of the namespace to be added.
546   <p>
547   * @return integer value indicating success/failure of the
548   * function.   The possible values
549   * returned by this function are:
550   * <ul>
551   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
552   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
553   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT }
554   * </ul>
555   */ public
556 int addNamespace(String uri, String prefix) {
557    return libsbmlJNI.SBMLNamespaces_addNamespace(swigCPtr, this, uri, prefix);
558  }
559
560  
561/**
562   * Removes an XML namespace from the set of namespaces within this 
563   * {@link SBMLNamespaces} object.
564   <p>
565   * @param uri    the XML namespace to be added.
566   <p>
567   * @return integer value indicating success/failure of the
568   * function.   The possible values
569   * returned by this function are:
570   * <ul>
571   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
572   * <li> {@link  libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE }
573   * </ul>
574   */ public
575 int removeNamespace(String uri) {
576    return libsbmlJNI.SBMLNamespaces_removeNamespace(swigCPtr, this, uri);
577  }
578
579  
580/**
581   * Add an XML namespace (a pair of URI and prefix) of a package extension
582   * to the set of namespaces within this {@link SBMLNamespaces} object.
583   <p>
584   * The SBML Level and SBML Version of this object is used.
585   <p>
586   * @param pkgName the string of package name (e.g. 'layout', 'multi')
587   * @param pkgVersion the package version
588   * @param prefix the prefix of the package namespace to be added.
589   *        The package's name will be used if the given string is empty (default).
590   <p>
591   * @return integer value indicating success/failure of the
592   * function.   The possible values
593   * returned by this function are:
594   * <ul>
595   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
596   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
597   *
598   * </ul> <p>
599   * @note An XML namespace of a non-registered package extension can't be
600   * added by this function ({@link 
601   * libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 
602   * will be returned).
603   <p>
604   * @see #addNamespace(String uri, String prefix)
605   */ public
606 int addPackageNamespace(String pkgName, long pkgVersion, String prefix) {
607    return libsbmlJNI.SBMLNamespaces_addPackageNamespace__SWIG_0(swigCPtr, this, pkgName, pkgVersion, prefix);
608  }
609
610  
611/**
612   * Add an XML namespace (a pair of URI and prefix) of a package extension
613   * to the set of namespaces within this {@link SBMLNamespaces} object.
614   <p>
615   * The SBML Level and SBML Version of this object is used.
616   <p>
617   * @param pkgName the string of package name (e.g. 'layout', 'multi')
618   * @param pkgVersion the package version
619   * @param prefix the prefix of the package namespace to be added.
620   *        The package's name will be used if the given string is empty (default).
621   <p>
622   * @return integer value indicating success/failure of the
623   * function.   The possible values
624   * returned by this function are:
625   * <ul>
626   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
627   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
628   *
629   * </ul> <p>
630   * @note An XML namespace of a non-registered package extension can't be
631   * added by this function ({@link 
632   * libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 
633   * will be returned).
634   <p>
635   * @see #addNamespace(String uri, String prefix)
636   */ public
637 int addPackageNamespace(String pkgName, long pkgVersion) {
638    return libsbmlJNI.SBMLNamespaces_addPackageNamespace__SWIG_1(swigCPtr, this, pkgName, pkgVersion);
639  }
640
641  
642/**
643   * Add the XML namespaces of package extensions in the given XMLNamespace
644   * object to the set of namespaces within this {@link SBMLNamespaces} object
645   * (Non-package XML namespaces are not added by this function).
646   <p>
647   * @param xmlns the XML namespaces to be added.
648   <p>
649   * @return integer value indicating success/failure of the
650   * function.   The possible values
651   * returned by this function are:
652   * <ul>
653   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
654   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
655   *
656   * </ul> <p>
657   * @note XML namespaces of a non-registered package extensions are not
658   * added (just ignored) by this function. {@link 
659   * libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE
660   * LIBSBML_INVALID_ATTRIBUTE_VALUE} will be returned if the given
661   * xmlns is null.
662   */ public
663 int addPackageNamespaces(XMLNamespaces xmlns) {
664    return libsbmlJNI.SBMLNamespaces_addPackageNamespaces(swigCPtr, this, XMLNamespaces.getCPtr(xmlns), xmlns);
665  }
666
667  
668/**
669   * Removes an XML namespace of a package extension from the set of namespaces 
670   * within this {@link SBMLNamespaces} object.
671   <p>
672   * @param level   the SBML level
673   * @param version the SBML version
674   * @param pkgName the string of package name (e.g. 'layout', 'multi')
675   * @param pkgVersion the package version
676   <p>
677   * @return integer value indicating success/failure of the
678   * function.   The possible values
679   * returned by this function are:
680   * <ul>
681   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
682   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
683   * <li> {@link  libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE }
684   * </ul>
685   */ public
686 int removePackageNamespace(long level, long version, String pkgName, long pkgVersion) {
687    return libsbmlJNI.SBMLNamespaces_removePackageNamespace(swigCPtr, this, level, version, pkgName, pkgVersion);
688  }
689
690  
691/**
692   * Add an XML namespace (a pair of URI and prefix) of a package extension
693   * to the set of namespaces within this {@link SBMLNamespaces} object.
694   <p>
695   * The SBML Level and SBML Version of this object is used.
696   <p>
697   * @param pkgName the string of package name (e.g. 'layout', 'multi')
698   * @param pkgVersion the package version
699   * @param prefix the prefix of the package namespace to be added.
700   *        The package's name will be used if the given string is empty (default).
701   <p>
702   * @return integer value indicating success/failure of the
703   * function.   The possible values
704   * returned by this function are:
705   * <ul>
706   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
707   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
708   *
709   * </ul> <p>
710   * @note An XML namespace of a non-registered package extension can't be
711   * added by this function ({@link 
712   * libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 
713   * will be returned).
714   <p>
715   * @see #addNamespace(String uri, String prefix)
716   * @internal
717   */ public
718 int addPkgNamespace(String pkgName, long pkgVersion, String prefix) {
719    return libsbmlJNI.SBMLNamespaces_addPkgNamespace__SWIG_0(swigCPtr, this, pkgName, pkgVersion, prefix);
720  }
721
722  
723/**
724   * Add an XML namespace (a pair of URI and prefix) of a package extension
725   * to the set of namespaces within this {@link SBMLNamespaces} object.
726   <p>
727   * The SBML Level and SBML Version of this object is used.
728   <p>
729   * @param pkgName the string of package name (e.g. 'layout', 'multi')
730   * @param pkgVersion the package version
731   * @param prefix the prefix of the package namespace to be added.
732   *        The package's name will be used if the given string is empty (default).
733   <p>
734   * @return integer value indicating success/failure of the
735   * function.   The possible values
736   * returned by this function are:
737   * <ul>
738   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
739   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
740   *
741   * </ul> <p>
742   * @note An XML namespace of a non-registered package extension can't be
743   * added by this function ({@link 
744   * libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 
745   * will be returned).
746   <p>
747   * @see #addNamespace(String uri, String prefix)
748   * @internal
749   */ public
750 int addPkgNamespace(String pkgName, long pkgVersion) {
751    return libsbmlJNI.SBMLNamespaces_addPkgNamespace__SWIG_1(swigCPtr, this, pkgName, pkgVersion);
752  }
753
754  
755/**
756   * Add the XML namespaces of package extensions in the given XMLNamespace
757   * object to the set of namespaces within this {@link SBMLNamespaces} object.
758   <p>
759   * Non-package XML namespaces are not added by this function.
760   <p>
761   * @param xmlns the XML namespaces to be added.
762   <p>
763   * @return integer value indicating success/failure of the
764   * function.   The possible values
765   * returned by this function are:
766   * <ul>
767   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
768   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
769   *
770   * </ul> <p>
771   * @note XML namespaces of a non-registered package extensions are not
772   * added (just ignored) by this function. {@link 
773   * libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE
774   * LIBSBML_INVALID_ATTRIBUTE_VALUE} will be returned if the given
775   * xmlns is null.
776   * @internal
777   */ public
778 int addPkgNamespaces(XMLNamespaces xmlns) {
779    return libsbmlJNI.SBMLNamespaces_addPkgNamespaces(swigCPtr, this, XMLNamespaces.getCPtr(xmlns), xmlns);
780  }
781
782  
783/**
784   * Removes an XML namespace of a package extension from the set of
785   * namespaces within this {@link SBMLNamespaces} object.
786   <p>
787   * @param level   the SBML level
788   * @param version the SBML version
789   * @param pkgName the string of package name (e.g. 'layout', 'multi')
790   * @param pkgVersion the package version
791   <p>
792   * @return integer value indicating success/failure of the
793   * function.   The possible values
794   * returned by this function are:
795   * <ul>
796   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
797   * <li> {@link  libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE }
798   * <li> {@link  libsbmlConstants#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE }
799   * @internal
800   * </ul>
801   */ public
802 int removePkgNamespace(long level, long version, String pkgName, long pkgVersion) {
803    return libsbmlJNI.SBMLNamespaces_removePkgNamespace(swigCPtr, this, level, version, pkgName, pkgVersion);
804  }
805
806  
807/**
808   * Predicate returning <code>true</code> if the given URL is one of SBML XML
809   * namespaces.
810   <p>
811   * @param uri the URI of namespace
812   <p>
813   * @return <code>true</code> if the 'uri' is one of SBML namespaces, <code>false</code> otherwise.
814   <p>
815   * 
816   */ public
817 static boolean isSBMLNamespace(String uri) {
818    return libsbmlJNI.SBMLNamespaces_isSBMLNamespace(uri);
819  }
820
821  
822/**
823   * Predicate returning <code>true</code> if the given set of namespaces represent a
824   * valid set
825   <p>
826   * @return <code>true</code> if the set of namespaces is valid, <code>false</code> otherwise.
827   */ public
828 boolean isValidCombination() {
829    return libsbmlJNI.SBMLNamespaces_isValidCombination(swigCPtr, this);
830  }
831
832  
833/**
834   * Returns the name of the main package for this namespace.
835   <p>
836   * @return the name of the main package for this namespace.
837   * 'core' will be returned if this namespace is defined in the SBML 
838   * core. 
839   */ public
840 String getPackageName() {
841    return libsbmlJNI.SBMLNamespaces_getPackageName(swigCPtr, this);
842  }
843
844}