/* ----------------------------------------------------------------------------
 * 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 ValueWeightPostingSource extends ValuePostingSource {
  private long swigCPtr;

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

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

  protected void finalize() {
    delete();
  }

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

  public ValueWeightPostingSource(int slot_) {
    this(XapianJNI.new_ValueWeightPostingSource(slot_), true);
  }

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

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

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

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

}
