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

package org.xapian;

public class PositionIterator {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

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

  protected void finalize() {
    delete();
  }

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

  public PositionIterator() {
    this(XapianJNI.new_PositionIterator(), true);
  }

  public void skipTo(long termpos) {
    XapianJNI.PositionIterator_skipTo(swigCPtr, this, termpos);
  }

  public String toString() {
    return XapianJNI.PositionIterator_toString(swigCPtr, this);
  }

  public boolean equals(PositionIterator o) {
    return XapianJNI.PositionIterator_equals(swigCPtr, this, PositionIterator.getCPtr(o), o);
  }

  public long getTermPos() {
    return XapianJNI.PositionIterator_getTermPos(swigCPtr, this);
  }

  public long next() {
    return XapianJNI.PositionIterator_next(swigCPtr, this);
  }

}
