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 Compactor {
12   private transient long swigCPtr;
13   protected transient boolean swigCMemOwn;
14 
Compactor(long cPtr, boolean cMemoryOwn)15   protected Compactor(long cPtr, boolean cMemoryOwn) {
16     swigCMemOwn = cMemoryOwn;
17     swigCPtr = cPtr;
18   }
19 
getCPtr(Compactor obj)20   protected static long getCPtr(Compactor 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_Compactor(swigCPtr);
33       }
34       swigCPtr = 0;
35     }
36   }
37 
swigDirectorDisconnect()38   protected void swigDirectorDisconnect() {
39     swigCMemOwn = false;
40     delete();
41   }
42 
swigReleaseOwnership()43   public void swigReleaseOwnership() {
44     swigCMemOwn = false;
45     XapianJNI.Compactor_change_ownership(this, swigCPtr, false);
46   }
47 
swigTakeOwnership()48   public void swigTakeOwnership() {
49     swigCMemOwn = true;
50     XapianJNI.Compactor_change_ownership(this, swigCPtr, true);
51   }
52 
Compactor()53   public Compactor() {
54     this(XapianJNI.new_Compactor(), true);
55     XapianJNI.Compactor_director_connect(this, swigCPtr, swigCMemOwn, true);
56   }
57 
setBlockSize(long block_size)58   public void setBlockSize(long block_size) {
59     XapianJNI.Compactor_setBlockSize(swigCPtr, this, block_size);
60   }
61 
setRenumber(boolean renumber)62   public void setRenumber(boolean renumber) {
63     XapianJNI.Compactor_setRenumber(swigCPtr, this, renumber);
64   }
65 
setMultipass(boolean multipass)66   public void setMultipass(boolean multipass) {
67     XapianJNI.Compactor_setMultipass(swigCPtr, this, multipass);
68   }
69 
setCompactionLevel(Compactor.compaction_level compaction)70   public void setCompactionLevel(Compactor.compaction_level compaction) {
71     XapianJNI.Compactor_setCompactionLevel(swigCPtr, this, compaction.swigValue());
72   }
73 
setDestdir(String destdir)74   public void setDestdir(String destdir) {
75     XapianJNI.Compactor_setDestdir(swigCPtr, this, destdir);
76   }
77 
addSource(String srcdir)78   public void addSource(String srcdir) {
79     XapianJNI.Compactor_addSource(swigCPtr, this, srcdir);
80   }
81 
compact()82   public void compact() {
83     XapianJNI.Compactor_compact(swigCPtr, this);
84   }
85 
setStatus(String table, String status)86   public void setStatus(String table, String status) {
87     if (getClass() == Compactor.class) XapianJNI.Compactor_setStatus(swigCPtr, this, table, status); else XapianJNI.Compactor_setStatusSwigExplicitCompactor(swigCPtr, this, table, status);
88   }
89 
resolveDuplicateMetadata(String key, long num_tags, SWIGTYPE_p_std__string tags)90   public String resolveDuplicateMetadata(String key, long num_tags, SWIGTYPE_p_std__string tags) {
91     return (getClass() == Compactor.class) ? XapianJNI.Compactor_resolveDuplicateMetadata(swigCPtr, this, key, num_tags, SWIGTYPE_p_std__string.getCPtr(tags)) : XapianJNI.Compactor_resolveDuplicateMetadataSwigExplicitCompactor(swigCPtr, this, key, num_tags, SWIGTYPE_p_std__string.getCPtr(tags));
92   }
93 
94   public final static class compaction_level {
95     public final static Compactor.compaction_level STANDARD = new Compactor.compaction_level("STANDARD", XapianJNI.Compactor_STANDARD_get());
96     public final static Compactor.compaction_level FULL = new Compactor.compaction_level("FULL", XapianJNI.Compactor_FULL_get());
97     public final static Compactor.compaction_level FULLER = new Compactor.compaction_level("FULLER", XapianJNI.Compactor_FULLER_get());
98 
swigValue()99     public final int swigValue() {
100       return swigValue;
101     }
102 
toString()103     public String toString() {
104       return swigName;
105     }
106 
swigToEnum(int swigValue)107     public static compaction_level swigToEnum(int swigValue) {
108       if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
109         return swigValues[swigValue];
110       for (int i = 0; i < swigValues.length; i++)
111         if (swigValues[i].swigValue == swigValue)
112           return swigValues[i];
113       throw new IllegalArgumentException("No enum " + compaction_level.class + " with value " + swigValue);
114     }
115 
compaction_level(String swigName)116     private compaction_level(String swigName) {
117       this.swigName = swigName;
118       this.swigValue = swigNext++;
119     }
120 
compaction_level(String swigName, int swigValue)121     private compaction_level(String swigName, int swigValue) {
122       this.swigName = swigName;
123       this.swigValue = swigValue;
124       swigNext = swigValue+1;
125     }
126 
compaction_level(String swigName, compaction_level swigEnum)127     private compaction_level(String swigName, compaction_level swigEnum) {
128       this.swigName = swigName;
129       this.swigValue = swigEnum.swigValue;
130       swigNext = this.swigValue+1;
131     }
132 
133     private static compaction_level[] swigValues = { STANDARD, FULL, FULLER };
134     private static int swigNext = 0;
135     private final int swigValue;
136     private final String swigName;
137   }
138 
139 }
140