MtasTerms.java.html
6.96 KB
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
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>MtasTerms.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">MTAS</a> > <a href="index.source.html" class="el_package">mtas.codec</a> > <span class="el_source">MtasTerms.java</span></div><h1>MtasTerms.java</h1><pre class="source lang-java linenums">package mtas.codec;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map.Entry;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.store.IndexInput;
/**
* The Class MtasTerms.
*/
public class MtasTerms extends Terms {
/** The index input list. */
HashMap<String, IndexInput> indexInputList;
/** The index input offset list. */
HashMap<String, Long> indexInputOffsetList;
/** The version. */
int version;
/** The delegate terms. */
Terms delegateTerms;
/**
* Instantiates a new mtas terms.
*
* @param terms the terms
* @param indexInputList the index input list
* @param indexInputOffsetList the index input offset list
* @param version the version
*/
public MtasTerms(Terms terms, HashMap<String, IndexInput> indexInputList,
<span class="fc" id="L37"> HashMap<String, Long> indexInputOffsetList, int version) {</span>
<span class="fc" id="L38"> delegateTerms = terms;</span>
<span class="fc" id="L39"> this.indexInputList = indexInputList;</span>
<span class="fc" id="L40"> this.indexInputOffsetList = indexInputOffsetList;</span>
<span class="fc" id="L41"> this.version = version;</span>
<span class="fc" id="L42"> }</span>
/*
* (non-Javadoc)
*
* @see org.apache.lucene.index.Terms#iterator()
*/
@Override
public TermsEnum iterator() throws IOException {
<span class="pc bpc" id="L51" title="1 of 2 branches missed."> if (delegateTerms != null) {</span>
<span class="fc" id="L52"> return delegateTerms.iterator();</span>
} else {
<span class="nc" id="L54"> return TermsEnum.EMPTY;</span>
}
}
/*
* (non-Javadoc)
*
* @see org.apache.lucene.index.Terms#size()
*/
@Override
public long size() throws IOException {
<span class="pc bpc" id="L65" title="1 of 2 branches missed."> if (delegateTerms != null) {</span>
<span class="fc" id="L66"> return delegateTerms.size();</span>
} else {
<span class="nc" id="L68"> return -1;</span>
}
}
/*
* (non-Javadoc)
*
* @see org.apache.lucene.index.Terms#getSumTotalTermFreq()
*/
@Override
public long getSumTotalTermFreq() throws IOException {
<span class="pc bpc" id="L79" title="1 of 2 branches missed."> if (delegateTerms != null) {</span>
<span class="fc" id="L80"> return delegateTerms.getSumTotalTermFreq();</span>
} else {
<span class="nc" id="L82"> return -1;</span>
}
}
/*
* (non-Javadoc)
*
* @see org.apache.lucene.index.Terms#getSumDocFreq()
*/
@Override
public long getSumDocFreq() throws IOException {
<span class="pc bpc" id="L93" title="1 of 2 branches missed."> if (delegateTerms != null) {</span>
<span class="fc" id="L94"> return delegateTerms.getSumDocFreq();</span>
} else {
<span class="nc" id="L96"> return -1;</span>
}
}
/*
* (non-Javadoc)
*
* @see org.apache.lucene.index.Terms#getDocCount()
*/
@Override
public int getDocCount() throws IOException {
<span class="pc bpc" id="L107" title="1 of 2 branches missed."> if (delegateTerms != null) {</span>
<span class="fc" id="L108"> return delegateTerms.getDocCount();</span>
} else {
<span class="nc" id="L110"> return -1;</span>
}
}
/*
* (non-Javadoc)
*
* @see org.apache.lucene.index.Terms#hasFreqs()
*/
@Override
public boolean hasFreqs() {
<span class="pc bpc" id="L121" title="1 of 2 branches missed."> if (delegateTerms != null) {</span>
<span class="fc" id="L122"> return delegateTerms.hasFreqs();</span>
} else {
<span class="nc" id="L124"> return false;</span>
}
}
/*
* (non-Javadoc)
*
* @see org.apache.lucene.index.Terms#hasOffsets()
*/
@Override
public boolean hasOffsets() {
<span class="pc bpc" id="L135" title="1 of 2 branches missed."> if (delegateTerms != null) {</span>
<span class="fc" id="L136"> return delegateTerms.hasOffsets();</span>
} else {
<span class="nc" id="L138"> return false;</span>
}
}
/*
* (non-Javadoc)
*
* @see org.apache.lucene.index.Terms#hasPositions()
*/
@Override
public boolean hasPositions() {
<span class="pc bpc" id="L149" title="1 of 2 branches missed."> if (delegateTerms != null) {</span>
<span class="fc" id="L150"> return delegateTerms.hasPositions();</span>
} else {
<span class="nc" id="L152"> return false;</span>
}
}
/*
* (non-Javadoc)
*
* @see org.apache.lucene.index.Terms#hasPayloads()
*/
@Override
public boolean hasPayloads() {
<span class="pc bpc" id="L163" title="1 of 2 branches missed."> if (delegateTerms != null) {</span>
<span class="fc" id="L164"> return delegateTerms.hasPayloads();</span>
} else {
<span class="nc" id="L166"> return false;</span>
}
}
/**
* Gets the version.
*
* @return the version
*/
public int getVersion() {
<span class="fc" id="L176"> return version;</span>
}
/**
* Gets the index input list.
*
* @return the index input list
*/
public HashMap<String, IndexInput> getIndexInputList() {
<span class="fc" id="L185"> HashMap<String, IndexInput> clonedIndexInputList = new HashMap<String, IndexInput>();</span>
<span class="fc bfc" id="L186" title="All 2 branches covered."> for (Entry<String, IndexInput> entry : indexInputList.entrySet()) {</span>
<span class="fc" id="L187"> clonedIndexInputList.put(entry.getKey(), entry.getValue().clone());</span>
<span class="fc" id="L188"> }</span>
<span class="fc" id="L189"> return clonedIndexInputList;</span>
}
/**
* Gets the index input offset list.
*
* @return the index input offset list
*/
public HashMap<String, Long> getIndexInputOffsetList() {
<span class="fc" id="L198"> return indexInputOffsetList;</span>
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155</span></div></body></html>