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 Weight {
12   private transient long swigCPtr;
13   protected transient boolean swigCMemOwn;
14 
Weight(long cPtr, boolean cMemoryOwn)15   protected Weight(long cPtr, boolean cMemoryOwn) {
16     swigCMemOwn = cMemoryOwn;
17     swigCPtr = cPtr;
18   }
19 
getCPtr(Weight obj)20   protected static long getCPtr(Weight obj) {
21     return (obj == null) ? 0 : obj.swigCPtr;
22   }
23 
finalize()24   protected void finalize() {
25     delete();
26   }
27 
delete()28   public synchronized void delete() {
29     if (swigCPtr != 0) {
30       if (swigCMemOwn) {
31         swigCMemOwn = false;
32         XapianJNI.delete_Weight(swigCPtr);
33       }
34       swigCPtr = 0;
35     }
36   }
37 
name()38   public String name() {
39     return XapianJNI.Weight_name(swigCPtr, this);
40   }
41 
getSumPart(long wdf, long doclen, long uniqterms)42   public double getSumPart(long wdf, long doclen, long uniqterms) {
43     return XapianJNI.Weight_getSumPart(swigCPtr, this, wdf, doclen, uniqterms);
44   }
45 
getMaxPart()46   public double getMaxPart() {
47     return XapianJNI.Weight_getMaxPart(swigCPtr, this);
48   }
49 
getSumExtra(long doclen, long uniqterms)50   public double getSumExtra(long doclen, long uniqterms) {
51     return XapianJNI.Weight_getSumExtra(swigCPtr, this, doclen, uniqterms);
52   }
53 
getMaxExtra()54   public double getMaxExtra() {
55     return XapianJNI.Weight_getMaxExtra(swigCPtr, this);
56   }
57 
58   public final static class type_smoothing {
59     public final static Weight.type_smoothing TWO_STAGE_SMOOTHING = new Weight.type_smoothing("TWO_STAGE_SMOOTHING", XapianJNI.Weight_TWO_STAGE_SMOOTHING_get());
60     public final static Weight.type_smoothing DIRICHLET_SMOOTHING = new Weight.type_smoothing("DIRICHLET_SMOOTHING", XapianJNI.Weight_DIRICHLET_SMOOTHING_get());
61     public final static Weight.type_smoothing ABSOLUTE_DISCOUNT_SMOOTHING = new Weight.type_smoothing("ABSOLUTE_DISCOUNT_SMOOTHING", XapianJNI.Weight_ABSOLUTE_DISCOUNT_SMOOTHING_get());
62     public final static Weight.type_smoothing JELINEK_MERCER_SMOOTHING = new Weight.type_smoothing("JELINEK_MERCER_SMOOTHING", XapianJNI.Weight_JELINEK_MERCER_SMOOTHING_get());
63     public final static Weight.type_smoothing DIRICHLET_PLUS_SMOOTHING = new Weight.type_smoothing("DIRICHLET_PLUS_SMOOTHING", XapianJNI.Weight_DIRICHLET_PLUS_SMOOTHING_get());
64 
swigValue()65     public final int swigValue() {
66       return swigValue;
67     }
68 
toString()69     public String toString() {
70       return swigName;
71     }
72 
swigToEnum(int swigValue)73     public static type_smoothing swigToEnum(int swigValue) {
74       if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
75         return swigValues[swigValue];
76       for (int i = 0; i < swigValues.length; i++)
77         if (swigValues[i].swigValue == swigValue)
78           return swigValues[i];
79       throw new IllegalArgumentException("No enum " + type_smoothing.class + " with value " + swigValue);
80     }
81 
type_smoothing(String swigName)82     private type_smoothing(String swigName) {
83       this.swigName = swigName;
84       this.swigValue = swigNext++;
85     }
86 
type_smoothing(String swigName, int swigValue)87     private type_smoothing(String swigName, int swigValue) {
88       this.swigName = swigName;
89       this.swigValue = swigValue;
90       swigNext = swigValue+1;
91     }
92 
type_smoothing(String swigName, type_smoothing swigEnum)93     private type_smoothing(String swigName, type_smoothing swigEnum) {
94       this.swigName = swigName;
95       this.swigValue = swigEnum.swigValue;
96       swigNext = this.swigValue+1;
97     }
98 
99     private static type_smoothing[] swigValues = { TWO_STAGE_SMOOTHING, DIRICHLET_SMOOTHING, ABSOLUTE_DISCOUNT_SMOOTHING, JELINEK_MERCER_SMOOTHING, DIRICHLET_PLUS_SMOOTHING };
100     private static int swigNext = 0;
101     private final int swigValue;
102     private final String swigName;
103   }
104 
105 }
106