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

  protected FixedWeightPostingSource(long cPtr, boolean cMemoryOwn) {
    super(XapianJNI.FixedWeightPostingSource_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

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

  protected static long swigRelease(FixedWeightPostingSource obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

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

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

  public FixedWeightPostingSource(double wt) {
    this(XapianJNI.new_FixedWeightPostingSource(wt), true);
  }

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

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

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

  public double getWeight() {
    return XapianJNI.FixedWeightPostingSource_getWeight(swigCPtr, this);
  }

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

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

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

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

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

  public String name() {
    return XapianJNI.FixedWeightPostingSource_name(swigCPtr, this);
  }

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

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

}
