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

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

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

  protected void finalize() {
    delete();
  }

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

  public TermIterator() {
    this(XapianJNI.new_TermIterator(), true);
  }

  public long getWdf() {
    return XapianJNI.TermIterator_getWdf(swigCPtr, this);
  }

  public long getTermFreq() {
    return XapianJNI.TermIterator_getTermFreq(swigCPtr, this);
  }

  public long positionlistCount() {
    return XapianJNI.TermIterator_positionlistCount(swigCPtr, this);
  }

  public PositionIterator positionListBegin() {
    return new PositionIterator(XapianJNI.TermIterator_positionListBegin(swigCPtr, this), true);
  }

  public PositionIterator positionListEnd() {
    return new PositionIterator(XapianJNI.TermIterator_positionListEnd(swigCPtr, this), true);
  }

  public void skipTo(String term) {
    XapianJNI.TermIterator_skipTo(swigCPtr, this, term);
  }

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

  public String next() {
    return XapianJNI.TermIterator_next(swigCPtr, this);
  }

  public boolean hasNext() {
    return XapianJNI.TermIterator_hasNext(swigCPtr, this);
  }

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

  public String getTerm() {
    return XapianJNI.TermIterator_getTerm(swigCPtr, this);
  }

}
