/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.3
 *
 * 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 Snipper {
  private long swigCPtr;
  protected boolean swigCMemOwn;

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

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

  protected void finalize() {
    delete();
  }

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

  public Snipper() {
    this(XapianJNI.new_Snipper(), true);
  }

  public void setStemmer(Stem stemmer) {
    XapianJNI.Snipper_setStemmer(swigCPtr, this, Stem.getCPtr(stemmer), stemmer);
  }

  public void setMset(MSet mset, long rm_docno) {
    XapianJNI.Snipper_setMset__SWIG_0(swigCPtr, this, MSet.getCPtr(mset), mset, rm_docno);
  }

  public void setMset(MSet mset) {
    XapianJNI.Snipper_setMset__SWIG_1(swigCPtr, this, MSet.getCPtr(mset), mset);
  }

  public String generateSnippet(String text, long length, long window_size, double smoothing) {
    return XapianJNI.Snipper_generateSnippet__SWIG_0(swigCPtr, this, text, length, window_size, smoothing);
  }

  public String generateSnippet(String text, long length, long window_size) {
    return XapianJNI.Snipper_generateSnippet__SWIG_1(swigCPtr, this, text, length, window_size);
  }

  public String generateSnippet(String text, long length) {
    return XapianJNI.Snipper_generateSnippet__SWIG_2(swigCPtr, this, text, length);
  }

  public String generateSnippet(String text) {
    return XapianJNI.Snipper_generateSnippet__SWIG_3(swigCPtr, this, text);
  }

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

}
