/* ----------------------------------------------------------------------------
 * 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 FdmLinearOpIterator {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected FdmLinearOpIterator(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

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

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        QuantLibJNI.delete_FdmLinearOpIterator(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public FdmLinearOpIterator(UnsignedIntVector dim, UnsignedIntVector coordinates, long index) {
    this(QuantLibJNI.new_FdmLinearOpIterator(UnsignedIntVector.getCPtr(dim), dim, UnsignedIntVector.getCPtr(coordinates), coordinates, index), true);
  }

  public UnsignedIntVector coordinates() {
    return new UnsignedIntVector(QuantLibJNI.FdmLinearOpIterator_coordinates(swigCPtr, this), true);
  }

  public void increment() {
    QuantLibJNI.FdmLinearOpIterator_increment(swigCPtr, this);
  }

  public boolean notEqual(FdmLinearOpIterator iterator) {
    return QuantLibJNI.FdmLinearOpIterator_notEqual(swigCPtr, this, FdmLinearOpIterator.getCPtr(iterator), iterator);
  }

  public long index() {
    return QuantLibJNI.FdmLinearOpIterator_index(swigCPtr, this);
  }

}
