/* ----------------------------------------------------------------------------
 * 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 Unit : SBase {
	private HandleRef swigCPtr;
	
	internal Unit(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.UnitUpcast(cPtr), cMemoryOwn)
	{
		//super(libsbmlPINVOKE.UnitUpcast(cPtr), cMemoryOwn);
		swigCPtr = new HandleRef(this, cPtr);
	}
	
	internal static HandleRef getCPtr(Unit obj)
	{
		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
	}
	
	internal static HandleRef getCPtrAndDisown (Unit obj)
	{
		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
		
		if (obj != null)
		{
			ptr             = obj.swigCPtr;
			obj.swigCMemOwn = false;
		}
		
		return ptr;
	}

  ~Unit() {
    Dispose();
  }

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

  public Unit(int kind, int exponent, int scale, double multiplier) : this(libsbmlPINVOKE.new_Unit__SWIG_0(kind, exponent, scale, multiplier), true) {
  }

  public Unit(int kind, int exponent, int scale) : this(libsbmlPINVOKE.new_Unit__SWIG_1(kind, exponent, scale), true) {
  }

  public Unit(int kind, int exponent) : this(libsbmlPINVOKE.new_Unit__SWIG_2(kind, exponent), true) {
  }

  public Unit(int kind) : this(libsbmlPINVOKE.new_Unit__SWIG_3(kind), true) {
  }

  public Unit() : this(libsbmlPINVOKE.new_Unit__SWIG_4(), true) {
  }

  public Unit(string kind, int exponent, int scale, double multiplier) : this(libsbmlPINVOKE.new_Unit__SWIG_5(kind, exponent, scale, multiplier), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public Unit(string kind, int exponent, int scale) : this(libsbmlPINVOKE.new_Unit__SWIG_6(kind, exponent, scale), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public Unit(string kind, int exponent) : this(libsbmlPINVOKE.new_Unit__SWIG_7(kind, exponent), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public Unit(string kind) : this(libsbmlPINVOKE.new_Unit__SWIG_8(kind), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public Unit(long level, long version, XMLNamespaces xmlns) : this(libsbmlPINVOKE.new_Unit__SWIG_9(level, version, XMLNamespaces.getCPtr(xmlns)), true) {
  }

  public Unit(long level, long version) : this(libsbmlPINVOKE.new_Unit__SWIG_10(level, version), true) {
  }

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

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

  public void initDefaults() {
    libsbmlPINVOKE.Unit_initDefaults(swigCPtr);
  }

  public int getKind() {
    int ret = libsbmlPINVOKE.Unit_getKind(swigCPtr);
    return ret;
  }

  public int getExponent() {
    int ret = libsbmlPINVOKE.Unit_getExponent(swigCPtr);
    return ret;
  }

  public int getScale() {
    int ret = libsbmlPINVOKE.Unit_getScale(swigCPtr);
    return ret;
  }

  public double getMultiplier() {
    double ret = libsbmlPINVOKE.Unit_getMultiplier(swigCPtr);
    return ret;
  }

  public double getOffset() {
    double ret = libsbmlPINVOKE.Unit_getOffset(swigCPtr);
    return ret;
  }

  public bool isAmpere() {
    bool ret = libsbmlPINVOKE.Unit_isAmpere(swigCPtr);
    return ret;
  }

  public bool isBecquerel() {
    bool ret = libsbmlPINVOKE.Unit_isBecquerel(swigCPtr);
    return ret;
  }

  public bool isCandela() {
    bool ret = libsbmlPINVOKE.Unit_isCandela(swigCPtr);
    return ret;
  }

  public bool isCelsius() {
    bool ret = libsbmlPINVOKE.Unit_isCelsius(swigCPtr);
    return ret;
  }

  public bool isCoulomb() {
    bool ret = libsbmlPINVOKE.Unit_isCoulomb(swigCPtr);
    return ret;
  }

  public bool isDimensionless() {
    bool ret = libsbmlPINVOKE.Unit_isDimensionless(swigCPtr);
    return ret;
  }

  public bool isFarad() {
    bool ret = libsbmlPINVOKE.Unit_isFarad(swigCPtr);
    return ret;
  }

  public bool isGram() {
    bool ret = libsbmlPINVOKE.Unit_isGram(swigCPtr);
    return ret;
  }

  public bool isGray() {
    bool ret = libsbmlPINVOKE.Unit_isGray(swigCPtr);
    return ret;
  }

  public bool isHenry() {
    bool ret = libsbmlPINVOKE.Unit_isHenry(swigCPtr);
    return ret;
  }

  public bool isHertz() {
    bool ret = libsbmlPINVOKE.Unit_isHertz(swigCPtr);
    return ret;
  }

  public bool isItem() {
    bool ret = libsbmlPINVOKE.Unit_isItem(swigCPtr);
    return ret;
  }

  public bool isJoule() {
    bool ret = libsbmlPINVOKE.Unit_isJoule(swigCPtr);
    return ret;
  }

  public bool isKatal() {
    bool ret = libsbmlPINVOKE.Unit_isKatal(swigCPtr);
    return ret;
  }

  public bool isKelvin() {
    bool ret = libsbmlPINVOKE.Unit_isKelvin(swigCPtr);
    return ret;
  }

  public bool isKilogram() {
    bool ret = libsbmlPINVOKE.Unit_isKilogram(swigCPtr);
    return ret;
  }

  public bool isLitre() {
    bool ret = libsbmlPINVOKE.Unit_isLitre(swigCPtr);
    return ret;
  }

  public bool isLumen() {
    bool ret = libsbmlPINVOKE.Unit_isLumen(swigCPtr);
    return ret;
  }

  public bool isLux() {
    bool ret = libsbmlPINVOKE.Unit_isLux(swigCPtr);
    return ret;
  }

  public bool isMetre() {
    bool ret = libsbmlPINVOKE.Unit_isMetre(swigCPtr);
    return ret;
  }

  public bool isMole() {
    bool ret = libsbmlPINVOKE.Unit_isMole(swigCPtr);
    return ret;
  }

  public bool isNewton() {
    bool ret = libsbmlPINVOKE.Unit_isNewton(swigCPtr);
    return ret;
  }

  public bool isOhm() {
    bool ret = libsbmlPINVOKE.Unit_isOhm(swigCPtr);
    return ret;
  }

  public bool isPascal() {
    bool ret = libsbmlPINVOKE.Unit_isPascal(swigCPtr);
    return ret;
  }

  public bool isRadian() {
    bool ret = libsbmlPINVOKE.Unit_isRadian(swigCPtr);
    return ret;
  }

  public bool isSecond() {
    bool ret = libsbmlPINVOKE.Unit_isSecond(swigCPtr);
    return ret;
  }

  public bool isSiemens() {
    bool ret = libsbmlPINVOKE.Unit_isSiemens(swigCPtr);
    return ret;
  }

  public bool isSievert() {
    bool ret = libsbmlPINVOKE.Unit_isSievert(swigCPtr);
    return ret;
  }

  public bool isSteradian() {
    bool ret = libsbmlPINVOKE.Unit_isSteradian(swigCPtr);
    return ret;
  }

  public bool isTesla() {
    bool ret = libsbmlPINVOKE.Unit_isTesla(swigCPtr);
    return ret;
  }

  public bool isVolt() {
    bool ret = libsbmlPINVOKE.Unit_isVolt(swigCPtr);
    return ret;
  }

  public bool isWatt() {
    bool ret = libsbmlPINVOKE.Unit_isWatt(swigCPtr);
    return ret;
  }

  public bool isWeber() {
    bool ret = libsbmlPINVOKE.Unit_isWeber(swigCPtr);
    return ret;
  }

  public bool isSetKind() {
    bool ret = libsbmlPINVOKE.Unit_isSetKind(swigCPtr);
    return ret;
  }

  public void setKind(int kind) {
    libsbmlPINVOKE.Unit_setKind(swigCPtr, kind);
  }

  public void setExponent(int value) {
    libsbmlPINVOKE.Unit_setExponent(swigCPtr, value);
  }

  public void setScale(int value) {
    libsbmlPINVOKE.Unit_setScale(swigCPtr, value);
  }

  public void setMultiplier(double value) {
    libsbmlPINVOKE.Unit_setMultiplier(swigCPtr, value);
  }

  public void setOffset(double value) {
    libsbmlPINVOKE.Unit_setOffset(swigCPtr, value);
  }

  public override int getTypeCode() {
    int ret = libsbmlPINVOKE.Unit_getTypeCode(swigCPtr);
    return ret;
  }

  public override string getElementName() {
    string ret = libsbmlPINVOKE.Unit_getElementName(swigCPtr);
    return ret;
  }

  public static bool isBuiltIn(string name, long level) {
    bool ret = libsbmlPINVOKE.Unit_isBuiltIn(name, level);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static bool isUnitKind(string name, long level, long version) {
    bool ret = libsbmlPINVOKE.Unit_isUnitKind(name, level, version);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static bool areIdentical(Unit unit1, Unit unit2) {
    bool ret = libsbmlPINVOKE.Unit_areIdentical(Unit.getCPtr(unit1), Unit.getCPtr(unit2));
    return ret;
  }

  public static bool areEquivalent(Unit unit1, Unit unit2) {
    bool ret = libsbmlPINVOKE.Unit_areEquivalent(Unit.getCPtr(unit1), Unit.getCPtr(unit2));
    return ret;
  }

  public static void removeScale(Unit unit) {
    libsbmlPINVOKE.Unit_removeScale(Unit.getCPtr(unit));
  }

  public static void merge(Unit unit1, Unit unit2) {
    libsbmlPINVOKE.Unit_merge(Unit.getCPtr(unit1), Unit.getCPtr(unit2));
  }

  public static UnitDefinition convertToSI(Unit unit) {
    IntPtr cPtr = libsbmlPINVOKE.Unit_convertToSI(Unit.getCPtr(unit));
    UnitDefinition ret = (cPtr == IntPtr.Zero) ? null : new UnitDefinition(cPtr, true);
    return ret;
  }

}

}
