/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.38
 *
 * 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 XMLAttributes : IDisposable {
	private HandleRef swigCPtr;
	protected bool swigCMemOwn;
	
	internal XMLAttributes(IntPtr cPtr, bool cMemoryOwn)
	{
		swigCMemOwn = cMemoryOwn;
		swigCPtr    = new HandleRef(this, cPtr);
	}
	
	internal static HandleRef getCPtr(XMLAttributes obj)
	{
		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
	}
	
	internal static HandleRef getCPtrAndDisown (XMLAttributes obj)
	{
		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
		
		if (obj != null)
		{
			ptr             = obj.swigCPtr;
			obj.swigCMemOwn = false;
		}
		
		return ptr;
	}

  ~XMLAttributes() {
    Dispose();
  }

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

  public static bool operator==(XMLAttributes lhs, XMLAttributes 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!=(XMLAttributes lhs, XMLAttributes rhs)
  {
    return !(lhs == rhs);
  }

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

    return this == (XMLAttributes)sb;
  }

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

  public XMLAttributes() : this(libsbmlPINVOKE.new_XMLAttributes__SWIG_0(), true) {
  }

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

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

  public void add(string name, string value, string namespaceURI, string prefix) {
    libsbmlPINVOKE.XMLAttributes_add__SWIG_0(swigCPtr, name, value, namespaceURI, prefix);
  }

  public void add(string name, string value, string namespaceURI) {
    libsbmlPINVOKE.XMLAttributes_add__SWIG_1(swigCPtr, name, value, namespaceURI);
  }

  public void add(string name, string value) {
    libsbmlPINVOKE.XMLAttributes_add__SWIG_2(swigCPtr, name, value);
  }

  public void add(XMLTriple triple, string value) {
    libsbmlPINVOKE.XMLAttributes_add__SWIG_3(swigCPtr, XMLTriple.getCPtr(triple), value);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public void addResource(string name, string value) {
    libsbmlPINVOKE.XMLAttributes_addResource(swigCPtr, name, value);
  }

  public void removeResource(int n) {
    libsbmlPINVOKE.XMLAttributes_removeResource(swigCPtr, n);
  }

  public void remove(int n) {
    libsbmlPINVOKE.XMLAttributes_remove__SWIG_0(swigCPtr, n);
  }

  public void remove(string name, string uri) {
    libsbmlPINVOKE.XMLAttributes_remove__SWIG_1(swigCPtr, name, uri);
  }

  public void remove(string name) {
    libsbmlPINVOKE.XMLAttributes_remove__SWIG_2(swigCPtr, name);
  }

  public void remove(XMLTriple triple) {
    libsbmlPINVOKE.XMLAttributes_remove__SWIG_3(swigCPtr, XMLTriple.getCPtr(triple));
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public void clear() {
    libsbmlPINVOKE.XMLAttributes_clear(swigCPtr);
  }

  public int getIndex(string name) {
    int ret = libsbmlPINVOKE.XMLAttributes_getIndex__SWIG_0(swigCPtr, name);
    return ret;
  }

  public int getIndex(string name, string uri) {
    int ret = libsbmlPINVOKE.XMLAttributes_getIndex__SWIG_1(swigCPtr, name, uri);
    return ret;
  }

  public int getIndex(XMLTriple triple) {
    int ret = libsbmlPINVOKE.XMLAttributes_getIndex__SWIG_2(swigCPtr, XMLTriple.getCPtr(triple));
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

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

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

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

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

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

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

  public string getValue(string name) {
    string ret = libsbmlPINVOKE.XMLAttributes_getValue__SWIG_1(swigCPtr, name);
    return ret;
  }

  public string getValue(string name, string uri) {
    string ret = libsbmlPINVOKE.XMLAttributes_getValue__SWIG_2(swigCPtr, name, uri);
    return ret;
  }

  public string getValue(XMLTriple triple) {
    string ret = libsbmlPINVOKE.XMLAttributes_getValue__SWIG_3(swigCPtr, XMLTriple.getCPtr(triple));
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool hasAttribute(int index) {
    bool ret = libsbmlPINVOKE.XMLAttributes_hasAttribute__SWIG_0(swigCPtr, index);
    return ret;
  }

  public bool hasAttribute(string name, string uri) {
    bool ret = libsbmlPINVOKE.XMLAttributes_hasAttribute__SWIG_1(swigCPtr, name, uri);
    return ret;
  }

  public bool hasAttribute(string name) {
    bool ret = libsbmlPINVOKE.XMLAttributes_hasAttribute__SWIG_2(swigCPtr, name);
    return ret;
  }

  public bool hasAttribute(XMLTriple triple) {
    bool ret = libsbmlPINVOKE.XMLAttributes_hasAttribute__SWIG_3(swigCPtr, XMLTriple.getCPtr(triple));
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

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

  public void write(XMLOutputStream stream) {
    libsbmlPINVOKE.XMLAttributes_write(swigCPtr, XMLOutputStream.getCPtr(stream));
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public void setErrorLog(XMLErrorLog log) {
    libsbmlPINVOKE.XMLAttributes_setErrorLog(swigCPtr, XMLErrorLog.getCPtr(log));
  }

}

}
