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 Document {
12   private transient long swigCPtr;
13   protected transient boolean swigCMemOwn;
14 
Document(long cPtr, boolean cMemoryOwn)15   protected Document(long cPtr, boolean cMemoryOwn) {
16     swigCMemOwn = cMemoryOwn;
17     swigCPtr = cPtr;
18   }
19 
getCPtr(Document obj)20   protected static long getCPtr(Document 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_Document(swigCPtr);
33       }
34       swigCPtr = 0;
35     }
36   }
37 
Document()38   public Document() {
39     this(XapianJNI.new_Document(), true);
40   }
41 
getValue(int slot)42   public byte[] getValue(int slot) {
43     return XapianJNI.Document_getValue(swigCPtr, this, slot);
44   }
45 
addValue(int slot, byte[] value)46   public void addValue(int slot, byte[] value) {
47     XapianJNI.Document_addValue(swigCPtr, this, slot, value);
48   }
49 
removeValue(int slot)50   public void removeValue(int slot) {
51     XapianJNI.Document_removeValue(swigCPtr, this, slot);
52   }
53 
clearValues()54   public void clearValues() {
55     XapianJNI.Document_clearValues(swigCPtr, this);
56   }
57 
getData()58   public String getData() {
59     return XapianJNI.Document_getData(swigCPtr, this);
60   }
61 
setData(String data)62   public void setData(String data) {
63     XapianJNI.Document_setData(swigCPtr, this, data);
64   }
65 
addPosting(String tname, long tpos, long wdfinc)66   public void addPosting(String tname, long tpos, long wdfinc) {
67     XapianJNI.Document_addPosting__SWIG_0(swigCPtr, this, tname, tpos, wdfinc);
68   }
69 
addPosting(String tname, long tpos)70   public void addPosting(String tname, long tpos) {
71     XapianJNI.Document_addPosting__SWIG_1(swigCPtr, this, tname, tpos);
72   }
73 
addTerm(String tname, long wdfinc)74   public void addTerm(String tname, long wdfinc) {
75     XapianJNI.Document_addTerm__SWIG_0(swigCPtr, this, tname, wdfinc);
76   }
77 
addTerm(String tname)78   public void addTerm(String tname) {
79     XapianJNI.Document_addTerm__SWIG_1(swigCPtr, this, tname);
80   }
81 
addBooleanTerm(String term)82   public void addBooleanTerm(String term) {
83     XapianJNI.Document_addBooleanTerm(swigCPtr, this, term);
84   }
85 
removePosting(String tname, long tpos, long wdfdec)86   public void removePosting(String tname, long tpos, long wdfdec) {
87     XapianJNI.Document_removePosting__SWIG_0(swigCPtr, this, tname, tpos, wdfdec);
88   }
89 
removePosting(String tname, long tpos)90   public void removePosting(String tname, long tpos) {
91     XapianJNI.Document_removePosting__SWIG_1(swigCPtr, this, tname, tpos);
92   }
93 
removePostings(String term, long term_pos_first, long term_pos_last, long wdf_dec)94   public long removePostings(String term, long term_pos_first, long term_pos_last, long wdf_dec) {
95     return XapianJNI.Document_removePostings__SWIG_0(swigCPtr, this, term, term_pos_first, term_pos_last, wdf_dec);
96   }
97 
removePostings(String term, long term_pos_first, long term_pos_last)98   public long removePostings(String term, long term_pos_first, long term_pos_last) {
99     return XapianJNI.Document_removePostings__SWIG_1(swigCPtr, this, term, term_pos_first, term_pos_last);
100   }
101 
removeTerm(String tname)102   public void removeTerm(String tname) {
103     XapianJNI.Document_removeTerm(swigCPtr, this, tname);
104   }
105 
clearTerms()106   public void clearTerms() {
107     XapianJNI.Document_clearTerms(swigCPtr, this);
108   }
109 
termListCount()110   public long termListCount() {
111     return XapianJNI.Document_termListCount(swigCPtr, this);
112   }
113 
termListBegin()114   public TermIterator termListBegin() {
115     return new TermIterator(XapianJNI.Document_termListBegin(swigCPtr, this), true);
116   }
117 
termListEnd()118   public TermIterator termListEnd() {
119     return new TermIterator(XapianJNI.Document_termListEnd(swigCPtr, this), true);
120   }
121 
valuesCount()122   public long valuesCount() {
123     return XapianJNI.Document_valuesCount(swigCPtr, this);
124   }
125 
valuesBegin()126   public ValueIterator valuesBegin() {
127     return new ValueIterator(XapianJNI.Document_valuesBegin(swigCPtr, this), true);
128   }
129 
valuesEnd()130   public ValueIterator valuesEnd() {
131     return new ValueIterator(XapianJNI.Document_valuesEnd(swigCPtr, this), true);
132   }
133 
getDocId()134   public long getDocId() {
135     return XapianJNI.Document_getDocId(swigCPtr, this);
136   }
137 
serialise()138   public byte[] serialise() {
139     return XapianJNI.Document_serialise(swigCPtr, this);
140   }
141 
unserialise(byte[] serialised)142   public static Document unserialise(byte[] serialised) {
143     return new Document(XapianJNI.Document_unserialise(serialised), true);
144   }
145 
toString()146   public String toString() {
147     return XapianJNI.Document_toString(swigCPtr, this);
148   }
149 
150 }
151