File: Database.java

package info (click to toggle)
xapian-bindings 1.4.31-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,456 kB
  • sloc: cpp: 379,927; python: 10,780; cs: 9,529; java: 6,949; sh: 5,017; perl: 4,435; makefile: 1,277; ruby: 1,028; php: 586; tcl: 246
file content (339 lines) | stat: -rw-r--r-- 10,396 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.3.0
 *
 * 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 Database {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

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

  protected static long swigRelease(Database obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  @SuppressWarnings({"deprecation", "removal"})
  protected void finalize() {
    delete();
  }

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

  public void addDatabase(Database database) {
    XapianJNI.Database_addDatabase(swigCPtr, this, Database.getCPtr(database), database);
  }

  public long size() {
    return XapianJNI.Database_size(swigCPtr, this);
  }

  public Database() {
    this(XapianJNI.new_Database__SWIG_0(), true);
  }

  public Database(String path, int flags) {
    this(XapianJNI.new_Database__SWIG_1(path, flags), true);
  }

  public Database(String path) {
    this(XapianJNI.new_Database__SWIG_2(path), true);
  }

  public Database(int fd, int flags) {
    this(XapianJNI.new_Database__SWIG_3(fd, flags), true);
  }

  public Database(int fd) {
    this(XapianJNI.new_Database__SWIG_4(fd), true);
  }

  public boolean reopen() {
    return XapianJNI.Database_reopen(swigCPtr, this);
  }

  public void close() {
    XapianJNI.Database_close(swigCPtr, this);
  }

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

  public PostingIterator postListBegin(String tname) {
    return new PostingIterator(XapianJNI.Database_postListBegin(swigCPtr, this, tname), true);
  }

  public PostingIterator postListEnd(String arg0) {
    return new PostingIterator(XapianJNI.Database_postListEnd(swigCPtr, this, arg0), true);
  }

  public TermIterator termListBegin(long did) {
    return new TermIterator(XapianJNI.Database_termListBegin(swigCPtr, this, did), true);
  }

  public TermIterator termListEnd(long arg0) {
    return new TermIterator(XapianJNI.Database_termListEnd(swigCPtr, this, arg0), true);
  }

  public boolean hasPositions() {
    return XapianJNI.Database_hasPositions(swigCPtr, this);
  }

  public PositionIterator positionListBegin(long did, String tname) {
    return new PositionIterator(XapianJNI.Database_positionListBegin(swigCPtr, this, did, tname), true);
  }

  public PositionIterator positionListEnd(long arg0, String arg1) {
    return new PositionIterator(XapianJNI.Database_positionListEnd(swigCPtr, this, arg0, arg1), true);
  }

  public TermIterator allTermsBegin(String prefix) {
    return new TermIterator(XapianJNI.Database_allTermsBegin__SWIG_0(swigCPtr, this, prefix), true);
  }

  public TermIterator allTermsBegin() {
    return new TermIterator(XapianJNI.Database_allTermsBegin__SWIG_1(swigCPtr, this), true);
  }

  public TermIterator allTermsEnd(String arg0) {
    return new TermIterator(XapianJNI.Database_allTermsEnd__SWIG_0(swigCPtr, this, arg0), true);
  }

  public TermIterator allTermsEnd() {
    return new TermIterator(XapianJNI.Database_allTermsEnd__SWIG_1(swigCPtr, this), true);
  }

  public long getDocCount() {
    return XapianJNI.Database_getDocCount(swigCPtr, this);
  }

  public long getLastDocId() {
    return XapianJNI.Database_getLastDocId(swigCPtr, this);
  }

  public double getAvLength() {
    return XapianJNI.Database_getAvLength(swigCPtr, this);
  }

  public double getAverageLength() {
    return XapianJNI.Database_getAverageLength(swigCPtr, this);
  }

  public long getTotalLength() {
    return XapianJNI.Database_getTotalLength(swigCPtr, this);
  }

  public long getTermFreq(String tname) {
    return XapianJNI.Database_getTermFreq(swigCPtr, this, tname);
  }

  public boolean termExists(String tname) {
    return XapianJNI.Database_termExists(swigCPtr, this, tname);
  }

  public long getCollectionFreq(String tname) {
    return XapianJNI.Database_getCollectionFreq(swigCPtr, this, tname);
  }

  public long getValueFreq(int slot) {
    return XapianJNI.Database_getValueFreq(swigCPtr, this, slot);
  }

  public byte[] getValueLowerBound(int slot) {
    return XapianJNI.Database_getValueLowerBound(swigCPtr, this, slot);
  }

  public byte[] getValueUpperBound(int slot) {
    return XapianJNI.Database_getValueUpperBound(swigCPtr, this, slot);
  }

  public long getDoclengthLowerBound() {
    return XapianJNI.Database_getDoclengthLowerBound(swigCPtr, this);
  }

  public long getDoclengthUpperBound() {
    return XapianJNI.Database_getDoclengthUpperBound(swigCPtr, this);
  }

  public long getWdfUpperBound(String term) {
    return XapianJNI.Database_getWdfUpperBound(swigCPtr, this, term);
  }

  public ValueIterator valuestreamBegin(int slot) {
    return new ValueIterator(XapianJNI.Database_valuestreamBegin(swigCPtr, this, slot), true);
  }

  public ValueIterator valuestreamEnd(int arg0) {
    return new ValueIterator(XapianJNI.Database_valuestreamEnd(swigCPtr, this, arg0), true);
  }

  public long getDocLength(long did) {
    return XapianJNI.Database_getDocLength(swigCPtr, this, did);
  }

  public long getUniqueTerms(long did) {
    return XapianJNI.Database_getUniqueTerms(swigCPtr, this, did);
  }

  public void keepAlive() {
    XapianJNI.Database_keepAlive(swigCPtr, this);
  }

  public Document getDocument(long did) {
    return new Document(XapianJNI.Database_getDocument__SWIG_0(swigCPtr, this, did), true);
  }

  public Document getDocument(long did, long flags) {
    return new Document(XapianJNI.Database_getDocument__SWIG_1(swigCPtr, this, did, flags), true);
  }

  public String getSpellingSuggestion(String word, long max_edit_distance) {
    return XapianJNI.Database_getSpellingSuggestion__SWIG_0(swigCPtr, this, word, max_edit_distance);
  }

  public String getSpellingSuggestion(String word) {
    return XapianJNI.Database_getSpellingSuggestion__SWIG_1(swigCPtr, this, word);
  }

  public TermIterator spellingsBegin() {
    return new TermIterator(XapianJNI.Database_spellingsBegin(swigCPtr, this), true);
  }

  public TermIterator spellingsEnd() {
    return new TermIterator(XapianJNI.Database_spellingsEnd(swigCPtr, this), true);
  }

  public TermIterator synonymsBegin(String term) {
    return new TermIterator(XapianJNI.Database_synonymsBegin(swigCPtr, this, term), true);
  }

  public TermIterator synonymsEnd(String arg0) {
    return new TermIterator(XapianJNI.Database_synonymsEnd(swigCPtr, this, arg0), true);
  }

  public TermIterator synonymKeysBegin(String prefix) {
    return new TermIterator(XapianJNI.Database_synonymKeysBegin__SWIG_0(swigCPtr, this, prefix), true);
  }

  public TermIterator synonymKeysBegin() {
    return new TermIterator(XapianJNI.Database_synonymKeysBegin__SWIG_1(swigCPtr, this), true);
  }

  public TermIterator synonymKeysEnd(String arg0) {
    return new TermIterator(XapianJNI.Database_synonymKeysEnd__SWIG_0(swigCPtr, this, arg0), true);
  }

  public TermIterator synonymKeysEnd() {
    return new TermIterator(XapianJNI.Database_synonymKeysEnd__SWIG_1(swigCPtr, this), true);
  }

  public String getMetadata(String key) {
    return XapianJNI.Database_getMetadata(swigCPtr, this, key);
  }

  public TermIterator metadataKeysBegin(String prefix) {
    return new TermIterator(XapianJNI.Database_metadataKeysBegin__SWIG_0(swigCPtr, this, prefix), true);
  }

  public TermIterator metadataKeysBegin() {
    return new TermIterator(XapianJNI.Database_metadataKeysBegin__SWIG_1(swigCPtr, this), true);
  }

  public TermIterator metadataKeysEnd(String arg0) {
    return new TermIterator(XapianJNI.Database_metadataKeysEnd__SWIG_0(swigCPtr, this, arg0), true);
  }

  public TermIterator metadataKeysEnd() {
    return new TermIterator(XapianJNI.Database_metadataKeysEnd__SWIG_1(swigCPtr, this), true);
  }

  public String getUuid() {
    return XapianJNI.Database_getUuid(swigCPtr, this);
  }

  public boolean locked() {
    return XapianJNI.Database_locked(swigCPtr, this);
  }

  public long getRevision() {
    return XapianJNI.Database_getRevision(swigCPtr, this);
  }

  public static long check(String path, int opts) {
    return XapianJNI.Database_check__SWIG_0(path, opts);
  }

  public static long check(String path) {
    return XapianJNI.Database_check__SWIG_1(path);
  }

  public static long check(int fd, int opts) {
    return XapianJNI.Database_check__SWIG_2(fd, opts);
  }

  public static long check(int fd) {
    return XapianJNI.Database_check__SWIG_3(fd);
  }

  public void compact(String output, long flags, int block_size) {
    XapianJNI.Database_compact__SWIG_0(swigCPtr, this, output, flags, block_size);
  }

  public void compact(String output, long flags) {
    XapianJNI.Database_compact__SWIG_1(swigCPtr, this, output, flags);
  }

  public void compact(String output) {
    XapianJNI.Database_compact__SWIG_2(swigCPtr, this, output);
  }

  public void compact(int fd, long flags, int block_size) {
    XapianJNI.Database_compact__SWIG_3(swigCPtr, this, fd, flags, block_size);
  }

  public void compact(int fd, long flags) {
    XapianJNI.Database_compact__SWIG_4(swigCPtr, this, fd, flags);
  }

  public void compact(int fd) {
    XapianJNI.Database_compact__SWIG_5(swigCPtr, this, fd);
  }

  public void compact(String output, long flags, int block_size, Compactor compactor) {
    XapianJNI.Database_compact__SWIG_6(swigCPtr, this, output, flags, block_size, Compactor.getCPtr(compactor), compactor);
  }

  public void compact(int fd, long flags, int block_size, Compactor compactor) {
    XapianJNI.Database_compact__SWIG_7(swigCPtr, this, fd, flags, block_size, Compactor.getCPtr(compactor), compactor);
  }

}