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

package hep.aida.swig;
 
import hep.aida.jni.AIDAJNIUtil;

public class IHistogram extends IBaseHistogram implements hep.aida.IHistogram {
  private long swigCPtr;

  public IHistogram(long cPtr, boolean cMemoryOwn) {
    super(AIDAJNI.SWIGIHistogramUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  protected static long getCPtr(hep.aida.IHistogram obj) {
    if (obj instanceof IHistogram) {
      return (obj == null) ? 0 : ((IHistogram)obj).swigCPtr;
    } else {
      long cPtr = AIDAJNI.new_IHistogram();
      // FIXME, memory leak if Java class gets finalized, since C++ director is not freed.
      AIDAJNI.IHistogram_director_connect(obj, cPtr, true, true);
      return cPtr;
    }
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      AIDAJNI.delete_IHistogram(swigCPtr);
    }
    swigCPtr = 0;
    super.delete();
  }

  protected void swigDirectorDisconnect() {
    swigCMemOwn = false;
    delete();
  }

  public void swigReleaseOwnership() {
    swigCMemOwn = false;
    AIDAJNI.IHistogram_change_ownership(this, swigCPtr, false);
  }

  public void swigTakeOwnership() {
    swigCMemOwn = true;
    AIDAJNI.IHistogram_change_ownership(this, swigCPtr, true);
  }

  public int allEntries() {
    return AIDAJNI.IHistogram_allEntries(swigCPtr, this);
  }

  public int extraEntries() {
    return AIDAJNI.IHistogram_extraEntries(swigCPtr, this);
  }

  public double equivalentBinEntries() {
    return AIDAJNI.IHistogram_equivalentBinEntries(swigCPtr, this);
  }

  public double sumBinHeights() {
    return AIDAJNI.IHistogram_sumBinHeights(swigCPtr, this);
  }

  public double sumAllBinHeights() {
    return AIDAJNI.IHistogram_sumAllBinHeights(swigCPtr, this);
  }

  public double sumExtraBinHeights() {
    return AIDAJNI.IHistogram_sumExtraBinHeights(swigCPtr, this);
  }

  public double minBinHeight() {
    return AIDAJNI.IHistogram_minBinHeight(swigCPtr, this);
  }

  public double maxBinHeight() {
    return AIDAJNI.IHistogram_maxBinHeight(swigCPtr, this);
  }

  public void scale(double scaleFactor) {
    AIDAJNI.IHistogram_scale(swigCPtr, this, scaleFactor);
  }

  public IHistogram() {
    this(AIDAJNI.new_IHistogram(), true);
    AIDAJNI.IHistogram_director_connect(this, swigCPtr, swigCMemOwn, true);
  }

}
