1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.13
4  *
5  * Do not make changes to this file unless you know what you are doing--modify
6  * the SWIG interface file instead.
7  * ----------------------------------------------------------------------------- */
8 
9 package org.xapian;
10 
11 public class ValueWeightPostingSource extends ValuePostingSource {
12   private transient long swigCPtr;
13 
ValueWeightPostingSource(long cPtr, boolean cMemoryOwn)14   protected ValueWeightPostingSource(long cPtr, boolean cMemoryOwn) {
15     super(XapianJNI.ValueWeightPostingSource_SWIGUpcast(cPtr), cMemoryOwn);
16     swigCPtr = cPtr;
17   }
18 
getCPtr(ValueWeightPostingSource obj)19   protected static long getCPtr(ValueWeightPostingSource obj) {
20     return (obj == null) ? 0 : obj.swigCPtr;
21   }
22 
finalize()23   protected void finalize() {
24     delete();
25   }
26 
delete()27   public synchronized void delete() {
28     if (swigCPtr != 0) {
29       if (swigCMemOwn) {
30         swigCMemOwn = false;
31         XapianJNI.delete_ValueWeightPostingSource(swigCPtr);
32       }
33       swigCPtr = 0;
34     }
35     super.delete();
36   }
37 
swigDirectorDisconnect()38   protected void swigDirectorDisconnect() {
39     swigCMemOwn = false;
40     delete();
41   }
42 
swigReleaseOwnership()43   public void swigReleaseOwnership() {
44     swigCMemOwn = false;
45     XapianJNI.ValueWeightPostingSource_change_ownership(this, swigCPtr, false);
46   }
47 
swigTakeOwnership()48   public void swigTakeOwnership() {
49     swigCMemOwn = true;
50     XapianJNI.ValueWeightPostingSource_change_ownership(this, swigCPtr, true);
51   }
52 
ValueWeightPostingSource(int slot_)53   public ValueWeightPostingSource(int slot_) {
54     this(XapianJNI.new_ValueWeightPostingSource(slot_), true);
55     XapianJNI.ValueWeightPostingSource_director_connect(this, swigCPtr, swigCMemOwn, true);
56   }
57 
getWeight()58   public double getWeight() {
59     return (getClass() == ValueWeightPostingSource.class) ? XapianJNI.ValueWeightPostingSource_getWeight(swigCPtr, this) : XapianJNI.ValueWeightPostingSource_getWeightSwigExplicitValueWeightPostingSource(swigCPtr, this);
60   }
61 
name()62   public String name() {
63     return (getClass() == ValueWeightPostingSource.class) ? XapianJNI.ValueWeightPostingSource_name(swigCPtr, this) : XapianJNI.ValueWeightPostingSource_nameSwigExplicitValueWeightPostingSource(swigCPtr, this);
64   }
65 
init(Database db_)66   public void init(Database db_) {
67     if (getClass() == ValueWeightPostingSource.class) XapianJNI.ValueWeightPostingSource_init(swigCPtr, this, Database.getCPtr(db_), db_); else XapianJNI.ValueWeightPostingSource_initSwigExplicitValueWeightPostingSource(swigCPtr, this, Database.getCPtr(db_), db_);
68   }
69 
toString()70   public String toString() {
71     return (getClass() == ValueWeightPostingSource.class) ? XapianJNI.ValueWeightPostingSource_toString(swigCPtr, this) : XapianJNI.ValueWeightPostingSource_toStringSwigExplicitValueWeightPostingSource(swigCPtr, this);
72   }
73 
74 }
75