/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.5
 *
 * 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 ValuePostingSource extends PostingSource {
  private long swigCPtr;

  public ValuePostingSource(long cPtr, boolean cMemoryOwn) {
    super(XapianJNI.ValuePostingSource_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

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

  protected void finalize() {
    delete();
  }

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

  public ValuePostingSource(int slot_) {
    this(XapianJNI.new_ValuePostingSource(slot_), true);
  }

  public long getTermfreqMin() {
    return XapianJNI.ValuePostingSource_getTermfreqMin(swigCPtr, this);
  }

  public long getTermfreqEst() {
    return XapianJNI.ValuePostingSource_getTermfreqEst(swigCPtr, this);
  }

  public long getTermfreqMax() {
    return XapianJNI.ValuePostingSource_getTermfreqMax(swigCPtr, this);
  }

  public void next(double min_wt) {
    XapianJNI.ValuePostingSource_next(swigCPtr, this, min_wt);
  }

  public void skipTo(long min_docid, double min_wt) {
    XapianJNI.ValuePostingSource_skipTo(swigCPtr, this, min_docid, min_wt);
  }

  public boolean check(long min_docid, double min_wt) {
    return XapianJNI.ValuePostingSource_check(swigCPtr, this, min_docid, min_wt);
  }

  public boolean atEnd() {
    return XapianJNI.ValuePostingSource_atEnd(swigCPtr, this);
  }

  public long getDocId() {
    return XapianJNI.ValuePostingSource_getDocId(swigCPtr, this);
  }

  public void init(Database db_) {
    XapianJNI.ValuePostingSource_init(swigCPtr, this, Database.getCPtr(db_), db_);
  }

}
