/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.0
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace libsbml {

using System;
using System.Runtime.InteropServices;

public class XMLNamespaces : IDisposable {
	private HandleRef swigCPtr;
	protected bool swigCMemOwn;
	
	internal XMLNamespaces(IntPtr cPtr, bool cMemoryOwn)
	{
		swigCMemOwn = cMemoryOwn;
		swigCPtr    = new HandleRef(this, cPtr);
	}
	
	internal static HandleRef getCPtr(XMLNamespaces obj)
	{
		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
	}
	
	internal static HandleRef getCPtrAndDisown (XMLNamespaces obj)
	{
		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
		
		if (obj != null)
		{
			ptr             = obj.swigCPtr;
			obj.swigCMemOwn = false;
		}
		
		return ptr;
	}

  ~XMLNamespaces() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          libsbmlPINVOKE.delete_XMLNamespaces(swigCPtr);
        }
        swigCPtr = new HandleRef(null, IntPtr.Zero);
      }
      GC.SuppressFinalize(this);
    }
  }

  public static bool operator==(XMLNamespaces lhs, XMLNamespaces rhs)
  {
    if((Object)lhs == (Object)rhs)
    {
      return true;
    }

    if( ((Object)lhs == null) || ((Object)rhs == null) )
    {
      return false;
    }

    return (getCPtr(lhs).Handle.ToString() == getCPtr(rhs).Handle.ToString());
  }

  public static bool operator!=(XMLNamespaces lhs, XMLNamespaces rhs)
  {
    return !(lhs == rhs);
  }

  public override bool Equals(Object sb)
  {
    if ( ! (sb is XMLNamespaces) )
    {
      return false;
    }

    return this == (XMLNamespaces)sb;
  }

  public override int GetHashCode()
  {
    return swigCPtr.Handle.ToInt32();
  }

  public XMLNamespaces() : this(libsbmlPINVOKE.new_XMLNamespaces__SWIG_0(), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public XMLNamespaces(XMLNamespaces orig) : this(libsbmlPINVOKE.new_XMLNamespaces__SWIG_1(XMLNamespaces.getCPtr(orig)), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public XMLNamespaces clone() {
    IntPtr cPtr = libsbmlPINVOKE.XMLNamespaces_clone(swigCPtr);
    XMLNamespaces ret = (cPtr == IntPtr.Zero) ? null : new XMLNamespaces(cPtr, true);
    return ret;
  }

  public int add(string uri, string prefix) {
    int ret = libsbmlPINVOKE.XMLNamespaces_add__SWIG_0(swigCPtr, uri, prefix);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public int add(string uri) {
    int ret = libsbmlPINVOKE.XMLNamespaces_add__SWIG_1(swigCPtr, uri);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public int remove(int index) {
    int ret = libsbmlPINVOKE.XMLNamespaces_remove__SWIG_0(swigCPtr, index);
    return ret;
  }

  public int remove(string prefix) {
    int ret = libsbmlPINVOKE.XMLNamespaces_remove__SWIG_1(swigCPtr, prefix);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public int clear() {
    int ret = libsbmlPINVOKE.XMLNamespaces_clear(swigCPtr);
    return ret;
  }

  public int getIndex(string uri) {
    int ret = libsbmlPINVOKE.XMLNamespaces_getIndex(swigCPtr, uri);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public int getIndexByPrefix(string prefix) {
    int ret = libsbmlPINVOKE.XMLNamespaces_getIndexByPrefix(swigCPtr, prefix);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public int getLength() {
    int ret = libsbmlPINVOKE.XMLNamespaces_getLength(swigCPtr);
    return ret;
  }

  public string getPrefix(int index) {
    string ret = libsbmlPINVOKE.XMLNamespaces_getPrefix__SWIG_0(swigCPtr, index);
    return ret;
  }

  public string getPrefix(string uri) {
    string ret = libsbmlPINVOKE.XMLNamespaces_getPrefix__SWIG_1(swigCPtr, uri);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string getURI(int index) {
    string ret = libsbmlPINVOKE.XMLNamespaces_getURI__SWIG_0(swigCPtr, index);
    return ret;
  }

  public string getURI(string prefix) {
    string ret = libsbmlPINVOKE.XMLNamespaces_getURI__SWIG_1(swigCPtr, prefix);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string getURI() {
    string ret = libsbmlPINVOKE.XMLNamespaces_getURI__SWIG_2(swigCPtr);
    return ret;
  }

  public bool isEmpty() {
    bool ret = libsbmlPINVOKE.XMLNamespaces_isEmpty(swigCPtr);
    return ret;
  }

  public bool hasURI(string uri) {
    bool ret = libsbmlPINVOKE.XMLNamespaces_hasURI(swigCPtr, uri);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool hasPrefix(string prefix) {
    bool ret = libsbmlPINVOKE.XMLNamespaces_hasPrefix(swigCPtr, prefix);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool hasNS(string uri, string prefix) {
    bool ret = libsbmlPINVOKE.XMLNamespaces_hasNS(swigCPtr, uri, prefix);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
