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

package org.quantlib;

public class BinomialJ4BarrierEngine extends PricingEngine {
  private transient long swigCPtr;
  private transient boolean swigCMemOwnDerived;

  protected BinomialJ4BarrierEngine(long cPtr, boolean cMemoryOwn) {
    super(QuantLibJNI.BinomialJ4BarrierEngine_SWIGSmartPtrUpcast(cPtr), true);
    swigCMemOwnDerived = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(BinomialJ4BarrierEngine obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwnDerived = own;
    super.swigSetCMemOwn(own);
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwnDerived) {
        swigCMemOwnDerived = false;
        QuantLibJNI.delete_BinomialJ4BarrierEngine(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public BinomialJ4BarrierEngine(GeneralizedBlackScholesProcess arg0, long steps, long max_steps) {
    this(QuantLibJNI.new_BinomialJ4BarrierEngine__SWIG_0(GeneralizedBlackScholesProcess.getCPtr(arg0), arg0, steps, max_steps), true);
  }

  public BinomialJ4BarrierEngine(GeneralizedBlackScholesProcess arg0, long steps) {
    this(QuantLibJNI.new_BinomialJ4BarrierEngine__SWIG_1(GeneralizedBlackScholesProcess.getCPtr(arg0), arg0, steps), true);
  }

}
