/* ----------------------------------------------------------------------------
 * 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 Unit : SBase {
	private HandleRef swigCPtr;
	
	internal Unit(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.Unit_SWIGUpcast(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) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          libsbmlPINVOKE.delete_Unit(swigCPtr);
        }
        swigCPtr = new HandleRef(null, IntPtr.Zero);
      }
      GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

  public Unit(long level, long version) : this(libsbmlPINVOKE.new_Unit__SWIG_0(level, version), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public Unit(SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_Unit__SWIG_1(SBMLNamespaces.getCPtr(sbmlns)), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public Unit(Unit orig) : this(libsbmlPINVOKE.new_Unit__SWIG_2(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 double getExponentAsDouble() {
    double ret = libsbmlPINVOKE.Unit_getExponentAsDouble(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 isAvogadro() {
    bool ret = libsbmlPINVOKE.Unit_isAvogadro(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 bool isSetExponent() {
    bool ret = libsbmlPINVOKE.Unit_isSetExponent(swigCPtr);
    return ret;
  }

  public bool isSetScale() {
    bool ret = libsbmlPINVOKE.Unit_isSetScale(swigCPtr);
    return ret;
  }

  public bool isSetMultiplier() {
    bool ret = libsbmlPINVOKE.Unit_isSetMultiplier(swigCPtr);
    return ret;
  }

  public int setKind(int kind) {
    int ret = libsbmlPINVOKE.Unit_setKind(swigCPtr, kind);
    return ret;
  }

  public int setExponent(int value) {
    int ret = libsbmlPINVOKE.Unit_setExponent__SWIG_0(swigCPtr, value);
    return ret;
  }

  public int setExponent(double value) {
    int ret = libsbmlPINVOKE.Unit_setExponent__SWIG_1(swigCPtr, value);
    return ret;
  }

  public int setScale(int value) {
    int ret = libsbmlPINVOKE.Unit_setScale(swigCPtr, value);
    return ret;
  }

  public int setMultiplier(double value) {
    int ret = libsbmlPINVOKE.Unit_setMultiplier(swigCPtr, value);
    return ret;
  }

  public int setOffset(double value) {
    int ret = libsbmlPINVOKE.Unit_setOffset(swigCPtr, value);
    return ret;
  }

  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 int removeScale(Unit unit) {
    int ret = libsbmlPINVOKE.Unit_removeScale(Unit.getCPtr(unit));
    return ret;
  }

  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;
  }

  public override bool hasRequiredAttributes() {
    bool ret = libsbmlPINVOKE.Unit_hasRequiredAttributes(swigCPtr);
    return ret;
  }

}

}
