├── .gitignore
├── README.md
├── anserini-export-guide.md
├── design-rationale.md
├── pom.xml
└── src
└── main
├── java
└── io
│ └── osirrc
│ └── ciff
│ ├── CommonIndexFileFormat.java
│ ├── CommonIndexFileFormatConstants.java
│ ├── ReadCIFF.java
│ └── lucene
│ └── ExportAnseriniLuceneIndex.java
├── protobuf
└── CommonIndexFileFormat.proto
└── resources
├── cw12b-queries.lucene-analyzed.txt
├── cw12b-tokens.lucene-analyzed.txt
├── robust04-queries.lucene-analyzed.txt
└── robust04-tokens.lucene-analyzed.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | .DS_Store
3 | target/
4 | .idea/
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Common Index File Format
2 |
3 | The Common Index File Format (CIFF) represents an attempt to build a binary data exchange format for open-source search engines to interoperate by sharing index structures.
4 | For more details, check out:
5 |
6 | + Jimmy Lin, Joel Mackenzie, Chris Kamphuis, Craig Macdonald, Antonio Mallia, Michał Siedlaczek, Andrew Trotman, Arjen de Vries. [Supporting Interoperability Between Open-Source Search Engines with the Common Index File Format](https://arxiv.org/abs/2003.08276). _arXiv:2003.08276_.
7 |
8 | All data are contained in a single file, with the extension `.ciff`.
9 | The file comprises a sequence of [delimited](https://developers.google.com/protocol-buffers/docs/techniques) protobuf messages defined [here](src/main/protobuf/CommonIndexFileFormat.proto), exactly as follows:
10 |
11 | + A `Header`
12 | + Exactly the number of `PostingsList` messages specified in the `num_postings_lists` field of the `Header`
13 | + Exactly the number of `DocRecord` messages specified in the `num_docs` field of the `Header`
14 |
15 | See [our design rationale](design-rationale.md) for additional discussion.
16 |
17 | Explained in terms of xkcd, we're trying to avoid [this](https://xkcd.com/927/).
18 | Instead, CIFF aims to be [this](https://xkcd.com/1406/).
19 |
20 | ## Getting Started
21 |
22 | After cloning this repo, build CIFF with Maven:
23 |
24 | ```
25 | mvn clean package appassembler:assemble
26 | ```
27 |
28 | ## Reference Lucene Indexes
29 |
30 | Currently, this repo provides an utility to export CIFF from Lucene, via [Anserini](http://anserini.io/).
31 | For reference, we provide exports from the [Robust04](https://github.com/castorini/anserini/blob/master/docs/regressions-robust04.md) and [ClueWeb12-B13](https://github.com/castorini/anserini/blob/master/docs/regressions-cw12b13.md) collections:
32 |
33 | | Collection | Configuration | Size | MD5 | Download |
34 | |:-----------|:--------------|-----:|-----|:---------|
35 | | Robust04 | CIFF export, complete | 162M | `01ce3b9ebfd664b48ffad072fbcae076` | [[Dropbox]](https://www.dropbox.com/s/rph6udiqs2k7bfo/robust04-complete-20200306.ciff.gz?dl=0) |
36 | | Robust04 | CIFF export, queries only | 16M | `0a8ea07b6a262639e44ec959c4f53d44` | [[Dropbox]](https://www.dropbox.com/s/02i308p4fe2bqh6/robust04-queries-20200306.ciff.gz?dl=0) | [[Dropbox]]
37 | | Robust04 | Source Lucene index | 135M | `b993045adb24bcbe292d6ed73d5d47b6` | [[Dropbox]](https://www.dropbox.com/s/omh95m1pe5gwhaj/lucene-index-ciff.robust04.20200306.tar.gz?dl=0)
38 | | ClueWeb12-B13 | CIFF export, complete | 25G | `8fff3a57b9625eca94a286a61062ac82` | [[Dropbox]](https://www.dropbox.com/s/nbxpieqqp5z737h/cw12b-complete-20200309.ciff.gz?dl=0)
39 | | ClueWeb12-B13 | CIFF export, queries only | 1.2G | `45063400bd5823b7f7fec2bc5cbb2d36` | [[Dropbox]](https://www.dropbox.com/s/bx82uwx2mdzm8jy/cw12b-queries-20200309.ciff.gz?dl=0)
40 | | ClueWeb12-B13 | Source Lucene index |21G | `6ad327c9c837787f7d9508462e5aa822` | [[Dropbox]](https://www.dropbox.com/s/33lnfrbvr88b999/lucene-index-ciff.cw12b.20200309.tar.gz?dl=0)
41 |
42 | The follow invocation can be used to examine an export:
43 |
44 | ```bash
45 | target/appassembler/bin/ReadCIFF -input robust04-complete-20200306.ciff.gz
46 | ```
47 |
48 | We provide a full guide on how to replicate the above results [here](anserini-export-guide.md).
49 |
50 | ## CIFF Importers
51 |
52 | A CIFF export can be ingested into a number of different search systems.
53 |
54 | + [JASSv2](https://github.com/andrewtrotman/JASSv2) via the tool [ciff_to_JASS](https://github.com/andrewtrotman/JASSv2/tree/master/tools).
55 | + [PISA](https://github.com/pisa-engine/pisa) via the [PISA CIFF Binaries](https://github.com/pisa-engine/ciff).
56 | + [OldDog](https://github.com/chriskamphuis/olddog) by [creating csv files through CIFF](https://github.com/Chriskamphuis/olddog/blob/master/src/main/java/nl/ru/convert/CiffToCsv.java)
57 | + [Terrier](http://terrier.org) via the [Terrier-CIFF plugin](https://github.com/terrierteam/terrier-ciff)
58 |
59 | ## Tips for writing your own CIFF Importer / Exporter
60 |
61 | The systems above all provide concrete examples of taking an existing CIFF structure and converting it into a different (internal) index format.
62 | Most of the data/structures within the CIFF are quite straightforward and self-documenting. However, there are a few important details which
63 | should be noted.
64 |
65 | 1. The default CIFF exports come from Anserini. Those exports are engineered to encode document identifiers *as deltas (d-gaps).* Hence, when decoding a CIFF structure, care needs to be taken to recover the original identifiers by computing a prefix sum across each postings list. See the discussion [here](https://github.com/osirrc/ciff/issues/19).
66 |
67 | 2. Since Anserini is based on Lucene, it is important to note that document lengths are encoded in a lossy manner. This means that the document lengths recorded in the `DocRecord` structure are *approximate* - see the discussion [here](https://github.com/osirrc/ciff/issues/21).
68 |
69 | 3. Multiple records are stored in a single file using Java protobuf's parseDelimitedFrom() and writeDelimitedTo() methods. Unfortunately, these methods are not available in the bindings for other languages. These can be trivially reimplemented be reading/writing the bytesize of the record using varint - see the discussion [here](https://github.com/osirrc/ciff/issues/27).
70 |
--------------------------------------------------------------------------------
/anserini-export-guide.md:
--------------------------------------------------------------------------------
1 | # Anserini Export Guide
2 |
3 | For replicability, we provide detailed instructions for generating the exports on the main page with [Anserini](http://anserini.io/).
4 |
5 | ## Robust04
6 |
7 | The source index was constructed with the following command, based on [Anserini](http://anserini.io/) v0.7.2 (as tagged in the repo):
8 |
9 | ```bash
10 | sh target/appassembler/bin/IndexCollection -collection ClueWeb12Collection \
11 | -input /tuna1/collections/web/ClueWeb12-B13/ -index lucene-index-ciff.cw12b.20200309 \
12 | -generator JsoupGenerator -threads 8 -optimize
13 | ```
14 |
15 | Note that `-optimize` must be specified to merge the index down to a single segment.
16 |
17 | The follow two invocations created the exports:
18 |
19 | ```bash
20 | target/appassembler/bin/ExportAnseriniLuceneIndex -output robust04-complete-20200306.ciff \
21 | -index lucene-index-ciff.robust04.20200306 -description "Anserini v0.7.2, Robust04 regression"
22 |
23 | target/appassembler/bin/ExportAnseriniLuceneIndex -index lucene-index-ciff.robust04.20200306 \
24 | -output robust04-queries-20200306.ciff -termsFile src/main/resources/robust04-tokens.lucene-analyzed.txt \
25 | -description "Anserini v0.7.2, Robust04 regression"
26 | ```
27 |
28 | ## ClueWeb12-B13
29 |
30 | The source index was constructed with the following command, based on [Anserini](http://anserini.io/) v0.7.2 (as tagged in the repo):
31 |
32 | ```bash
33 | sh target/appassembler/bin/IndexCollection -collection ClueWeb12Collection \
34 | -input /tuna1/collections/web/ClueWeb12-B13/ -index lucene-index-ciff.cw12b.20200309 \
35 | -generator JsoupGenerator -threads 8 -optimize
36 | ```
37 |
38 | Note that `-optimize` must be specified to merge the index down to a single segment.
39 |
40 | The follow two invocations created the exports:
41 |
42 | ```bash
43 | target/appassembler/bin/ExportAnseriniLuceneIndex -output cw12b-complete-20200309.ciff.gz
44 | -index lucene-index-ciff.cw12b.20200309 -description "Anserini v0.7.2, ClueWeb12-B13 regression"
45 |
46 | target/appassembler/bin/ExportAnseriniLuceneIndex -output cw12b-queries-20200309.ciff.gz \
47 | -index lucene-index-ciff.cw12b.20200309 -description "Anserini v0.7.2, ClueWeb12-B13 regression" \
48 | -termsFile src/main/resources/cw12b-tokens.lucene-analyzed.txt \
49 | ```
50 |
51 | On a modern desktop with an SSD, the complete export takes a bit less than 3 hours to complete.
52 | The export with queries only takes about 10 minutes.
53 |
--------------------------------------------------------------------------------
/design-rationale.md:
--------------------------------------------------------------------------------
1 | # CIFF Design Rationale
2 |
3 | Instead of the design we actually adopted, one might have considered an alternative design comprising of a single protobuf message (e.g., the postings lists and doc records are contained in the header).
4 | In this case, the entire specification of CIFF would be captured in a single protobuf definition.
5 | This design was considered and rejected because it seems to run counter to [best practices suggested by Google](https://developers.google.com/protocol-buffers/docs/techniques): individual protobuf messages shouldn't be that large.
6 | Furthermore, Google's automatically-generated code bindings appear to manipulate individual protobuf messages in memory, which would not be practical in our use case for large collections if the entire index were a single protobuf message.
7 |
8 | Yet another alternative was a separate file for each type of protobuf message, and thus CIFF would be a bundle of files.
9 | Ultimately, we decided on a single-file approach.
10 |
11 | Additional discussion is captured in this [pull request](https://github.com/osirrc/ciff/pull/6).
12 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
23 | * Version. 24 | *25 | * 26 | *
int32 version = 1;
27 | */
28 | int getVersion();
29 |
30 | /**
31 | * 32 | * Exactly the number of PostingsList messages that follow the Header. 33 | *34 | * 35 | *
int32 num_postings_lists = 2;
36 | */
37 | int getNumPostingsLists();
38 |
39 | /**
40 | * 41 | * Exactly the number of DocRecord messages that follow the PostingsList messages. 42 | *43 | * 44 | *
int32 num_docs = 3;
45 | */
46 | int getNumDocs();
47 |
48 | /**
49 | * 50 | * The total number of postings lists in the collection; the vocabulary size. This might differ from 51 | * num_postings_lists, for example, because we only export the postings lists of query terms. 52 | *53 | * 54 | *
int32 total_postings_lists = 4;
55 | */
56 | int getTotalPostingsLists();
57 |
58 | /**
59 | * 60 | * The total number of documents in the collection; might differ from num_doc_records for a similar reason as above. 61 | *62 | * 63 | *
int32 total_docs = 5;
64 | */
65 | int getTotalDocs();
66 |
67 | /**
68 | * 69 | * The total number of terms in the entire collection. This is the sum of all document lengths of all documents in 70 | * the collection. 71 | *72 | * 73 | *
int64 total_terms_in_collection = 6;
74 | */
75 | long getTotalTermsInCollection();
76 |
77 | /**
78 | * 79 | * The average document length. We store this value explicitly in case the exporting application wants a particular 80 | * level of precision. 81 | *82 | * 83 | *
double average_doclength = 7;
84 | */
85 | double getAverageDoclength();
86 |
87 | /**
88 | * 89 | * Description of this index, meant for human consumption. Describing, for example, the exporting application, 90 | * document processing and tokenization pipeline, etc. 91 | *92 | * 93 | *
string description = 8;
94 | */
95 | java.lang.String getDescription();
96 | /**
97 | * 98 | * Description of this index, meant for human consumption. Describing, for example, the exporting application, 99 | * document processing and tokenization pipeline, etc. 100 | *101 | * 102 | *
string description = 8;
103 | */
104 | com.google.protobuf.ByteString
105 | getDescriptionBytes();
106 | }
107 | /**
108 | * 109 | * This is the CIFF header. It always comes first. 110 | *111 | * 112 | * Protobuf type {@code io.osirrc.ciff.Header} 113 | */ 114 | public static final class Header extends 115 | com.google.protobuf.GeneratedMessageV3 implements 116 | // @@protoc_insertion_point(message_implements:io.osirrc.ciff.Header) 117 | HeaderOrBuilder { 118 | private static final long serialVersionUID = 0L; 119 | // Use Header.newBuilder() to construct. 120 | private Header(com.google.protobuf.GeneratedMessageV3.Builder> builder) { 121 | super(builder); 122 | } 123 | private Header() { 124 | description_ = ""; 125 | } 126 | 127 | @java.lang.Override 128 | @SuppressWarnings({"unused"}) 129 | protected java.lang.Object newInstance( 130 | UnusedPrivateParameter unused) { 131 | return new Header(); 132 | } 133 | 134 | @java.lang.Override 135 | public final com.google.protobuf.UnknownFieldSet 136 | getUnknownFields() { 137 | return this.unknownFields; 138 | } 139 | private Header( 140 | com.google.protobuf.CodedInputStream input, 141 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 142 | throws com.google.protobuf.InvalidProtocolBufferException { 143 | this(); 144 | if (extensionRegistry == null) { 145 | throw new java.lang.NullPointerException(); 146 | } 147 | com.google.protobuf.UnknownFieldSet.Builder unknownFields = 148 | com.google.protobuf.UnknownFieldSet.newBuilder(); 149 | try { 150 | boolean done = false; 151 | while (!done) { 152 | int tag = input.readTag(); 153 | switch (tag) { 154 | case 0: 155 | done = true; 156 | break; 157 | case 8: { 158 | 159 | version_ = input.readInt32(); 160 | break; 161 | } 162 | case 16: { 163 | 164 | numPostingsLists_ = input.readInt32(); 165 | break; 166 | } 167 | case 24: { 168 | 169 | numDocs_ = input.readInt32(); 170 | break; 171 | } 172 | case 32: { 173 | 174 | totalPostingsLists_ = input.readInt32(); 175 | break; 176 | } 177 | case 40: { 178 | 179 | totalDocs_ = input.readInt32(); 180 | break; 181 | } 182 | case 48: { 183 | 184 | totalTermsInCollection_ = input.readInt64(); 185 | break; 186 | } 187 | case 57: { 188 | 189 | averageDoclength_ = input.readDouble(); 190 | break; 191 | } 192 | case 66: { 193 | java.lang.String s = input.readStringRequireUtf8(); 194 | 195 | description_ = s; 196 | break; 197 | } 198 | default: { 199 | if (!parseUnknownField( 200 | input, unknownFields, extensionRegistry, tag)) { 201 | done = true; 202 | } 203 | break; 204 | } 205 | } 206 | } 207 | } catch (com.google.protobuf.InvalidProtocolBufferException e) { 208 | throw e.setUnfinishedMessage(this); 209 | } catch (java.io.IOException e) { 210 | throw new com.google.protobuf.InvalidProtocolBufferException( 211 | e).setUnfinishedMessage(this); 212 | } finally { 213 | this.unknownFields = unknownFields.build(); 214 | makeExtensionsImmutable(); 215 | } 216 | } 217 | public static final com.google.protobuf.Descriptors.Descriptor 218 | getDescriptor() { 219 | return io.osirrc.ciff.CommonIndexFileFormat.internal_static_io_osirrc_ciff_Header_descriptor; 220 | } 221 | 222 | @java.lang.Override 223 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 224 | internalGetFieldAccessorTable() { 225 | return io.osirrc.ciff.CommonIndexFileFormat.internal_static_io_osirrc_ciff_Header_fieldAccessorTable 226 | .ensureFieldAccessorsInitialized( 227 | io.osirrc.ciff.CommonIndexFileFormat.Header.class, io.osirrc.ciff.CommonIndexFileFormat.Header.Builder.class); 228 | } 229 | 230 | public static final int VERSION_FIELD_NUMBER = 1; 231 | private int version_; 232 | /** 233 | *
234 | * Version. 235 | *236 | * 237 | *
int32 version = 1;
238 | */
239 | public int getVersion() {
240 | return version_;
241 | }
242 |
243 | public static final int NUM_POSTINGS_LISTS_FIELD_NUMBER = 2;
244 | private int numPostingsLists_;
245 | /**
246 | * 247 | * Exactly the number of PostingsList messages that follow the Header. 248 | *249 | * 250 | *
int32 num_postings_lists = 2;
251 | */
252 | public int getNumPostingsLists() {
253 | return numPostingsLists_;
254 | }
255 |
256 | public static final int NUM_DOCS_FIELD_NUMBER = 3;
257 | private int numDocs_;
258 | /**
259 | * 260 | * Exactly the number of DocRecord messages that follow the PostingsList messages. 261 | *262 | * 263 | *
int32 num_docs = 3;
264 | */
265 | public int getNumDocs() {
266 | return numDocs_;
267 | }
268 |
269 | public static final int TOTAL_POSTINGS_LISTS_FIELD_NUMBER = 4;
270 | private int totalPostingsLists_;
271 | /**
272 | * 273 | * The total number of postings lists in the collection; the vocabulary size. This might differ from 274 | * num_postings_lists, for example, because we only export the postings lists of query terms. 275 | *276 | * 277 | *
int32 total_postings_lists = 4;
278 | */
279 | public int getTotalPostingsLists() {
280 | return totalPostingsLists_;
281 | }
282 |
283 | public static final int TOTAL_DOCS_FIELD_NUMBER = 5;
284 | private int totalDocs_;
285 | /**
286 | * 287 | * The total number of documents in the collection; might differ from num_doc_records for a similar reason as above. 288 | *289 | * 290 | *
int32 total_docs = 5;
291 | */
292 | public int getTotalDocs() {
293 | return totalDocs_;
294 | }
295 |
296 | public static final int TOTAL_TERMS_IN_COLLECTION_FIELD_NUMBER = 6;
297 | private long totalTermsInCollection_;
298 | /**
299 | * 300 | * The total number of terms in the entire collection. This is the sum of all document lengths of all documents in 301 | * the collection. 302 | *303 | * 304 | *
int64 total_terms_in_collection = 6;
305 | */
306 | public long getTotalTermsInCollection() {
307 | return totalTermsInCollection_;
308 | }
309 |
310 | public static final int AVERAGE_DOCLENGTH_FIELD_NUMBER = 7;
311 | private double averageDoclength_;
312 | /**
313 | * 314 | * The average document length. We store this value explicitly in case the exporting application wants a particular 315 | * level of precision. 316 | *317 | * 318 | *
double average_doclength = 7;
319 | */
320 | public double getAverageDoclength() {
321 | return averageDoclength_;
322 | }
323 |
324 | public static final int DESCRIPTION_FIELD_NUMBER = 8;
325 | private volatile java.lang.Object description_;
326 | /**
327 | * 328 | * Description of this index, meant for human consumption. Describing, for example, the exporting application, 329 | * document processing and tokenization pipeline, etc. 330 | *331 | * 332 | *
string description = 8;
333 | */
334 | public java.lang.String getDescription() {
335 | java.lang.Object ref = description_;
336 | if (ref instanceof java.lang.String) {
337 | return (java.lang.String) ref;
338 | } else {
339 | com.google.protobuf.ByteString bs =
340 | (com.google.protobuf.ByteString) ref;
341 | java.lang.String s = bs.toStringUtf8();
342 | description_ = s;
343 | return s;
344 | }
345 | }
346 | /**
347 | * 348 | * Description of this index, meant for human consumption. Describing, for example, the exporting application, 349 | * document processing and tokenization pipeline, etc. 350 | *351 | * 352 | *
string description = 8;
353 | */
354 | public com.google.protobuf.ByteString
355 | getDescriptionBytes() {
356 | java.lang.Object ref = description_;
357 | if (ref instanceof java.lang.String) {
358 | com.google.protobuf.ByteString b =
359 | com.google.protobuf.ByteString.copyFromUtf8(
360 | (java.lang.String) ref);
361 | description_ = b;
362 | return b;
363 | } else {
364 | return (com.google.protobuf.ByteString) ref;
365 | }
366 | }
367 |
368 | private byte memoizedIsInitialized = -1;
369 | @java.lang.Override
370 | public final boolean isInitialized() {
371 | byte isInitialized = memoizedIsInitialized;
372 | if (isInitialized == 1) return true;
373 | if (isInitialized == 0) return false;
374 |
375 | memoizedIsInitialized = 1;
376 | return true;
377 | }
378 |
379 | @java.lang.Override
380 | public void writeTo(com.google.protobuf.CodedOutputStream output)
381 | throws java.io.IOException {
382 | if (version_ != 0) {
383 | output.writeInt32(1, version_);
384 | }
385 | if (numPostingsLists_ != 0) {
386 | output.writeInt32(2, numPostingsLists_);
387 | }
388 | if (numDocs_ != 0) {
389 | output.writeInt32(3, numDocs_);
390 | }
391 | if (totalPostingsLists_ != 0) {
392 | output.writeInt32(4, totalPostingsLists_);
393 | }
394 | if (totalDocs_ != 0) {
395 | output.writeInt32(5, totalDocs_);
396 | }
397 | if (totalTermsInCollection_ != 0L) {
398 | output.writeInt64(6, totalTermsInCollection_);
399 | }
400 | if (averageDoclength_ != 0D) {
401 | output.writeDouble(7, averageDoclength_);
402 | }
403 | if (!getDescriptionBytes().isEmpty()) {
404 | com.google.protobuf.GeneratedMessageV3.writeString(output, 8, description_);
405 | }
406 | unknownFields.writeTo(output);
407 | }
408 |
409 | @java.lang.Override
410 | public int getSerializedSize() {
411 | int size = memoizedSize;
412 | if (size != -1) return size;
413 |
414 | size = 0;
415 | if (version_ != 0) {
416 | size += com.google.protobuf.CodedOutputStream
417 | .computeInt32Size(1, version_);
418 | }
419 | if (numPostingsLists_ != 0) {
420 | size += com.google.protobuf.CodedOutputStream
421 | .computeInt32Size(2, numPostingsLists_);
422 | }
423 | if (numDocs_ != 0) {
424 | size += com.google.protobuf.CodedOutputStream
425 | .computeInt32Size(3, numDocs_);
426 | }
427 | if (totalPostingsLists_ != 0) {
428 | size += com.google.protobuf.CodedOutputStream
429 | .computeInt32Size(4, totalPostingsLists_);
430 | }
431 | if (totalDocs_ != 0) {
432 | size += com.google.protobuf.CodedOutputStream
433 | .computeInt32Size(5, totalDocs_);
434 | }
435 | if (totalTermsInCollection_ != 0L) {
436 | size += com.google.protobuf.CodedOutputStream
437 | .computeInt64Size(6, totalTermsInCollection_);
438 | }
439 | if (averageDoclength_ != 0D) {
440 | size += com.google.protobuf.CodedOutputStream
441 | .computeDoubleSize(7, averageDoclength_);
442 | }
443 | if (!getDescriptionBytes().isEmpty()) {
444 | size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, description_);
445 | }
446 | size += unknownFields.getSerializedSize();
447 | memoizedSize = size;
448 | return size;
449 | }
450 |
451 | @java.lang.Override
452 | public boolean equals(final java.lang.Object obj) {
453 | if (obj == this) {
454 | return true;
455 | }
456 | if (!(obj instanceof io.osirrc.ciff.CommonIndexFileFormat.Header)) {
457 | return super.equals(obj);
458 | }
459 | io.osirrc.ciff.CommonIndexFileFormat.Header other = (io.osirrc.ciff.CommonIndexFileFormat.Header) obj;
460 |
461 | if (getVersion()
462 | != other.getVersion()) return false;
463 | if (getNumPostingsLists()
464 | != other.getNumPostingsLists()) return false;
465 | if (getNumDocs()
466 | != other.getNumDocs()) return false;
467 | if (getTotalPostingsLists()
468 | != other.getTotalPostingsLists()) return false;
469 | if (getTotalDocs()
470 | != other.getTotalDocs()) return false;
471 | if (getTotalTermsInCollection()
472 | != other.getTotalTermsInCollection()) return false;
473 | if (java.lang.Double.doubleToLongBits(getAverageDoclength())
474 | != java.lang.Double.doubleToLongBits(
475 | other.getAverageDoclength())) return false;
476 | if (!getDescription()
477 | .equals(other.getDescription())) return false;
478 | if (!unknownFields.equals(other.unknownFields)) return false;
479 | return true;
480 | }
481 |
482 | @java.lang.Override
483 | public int hashCode() {
484 | if (memoizedHashCode != 0) {
485 | return memoizedHashCode;
486 | }
487 | int hash = 41;
488 | hash = (19 * hash) + getDescriptor().hashCode();
489 | hash = (37 * hash) + VERSION_FIELD_NUMBER;
490 | hash = (53 * hash) + getVersion();
491 | hash = (37 * hash) + NUM_POSTINGS_LISTS_FIELD_NUMBER;
492 | hash = (53 * hash) + getNumPostingsLists();
493 | hash = (37 * hash) + NUM_DOCS_FIELD_NUMBER;
494 | hash = (53 * hash) + getNumDocs();
495 | hash = (37 * hash) + TOTAL_POSTINGS_LISTS_FIELD_NUMBER;
496 | hash = (53 * hash) + getTotalPostingsLists();
497 | hash = (37 * hash) + TOTAL_DOCS_FIELD_NUMBER;
498 | hash = (53 * hash) + getTotalDocs();
499 | hash = (37 * hash) + TOTAL_TERMS_IN_COLLECTION_FIELD_NUMBER;
500 | hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
501 | getTotalTermsInCollection());
502 | hash = (37 * hash) + AVERAGE_DOCLENGTH_FIELD_NUMBER;
503 | hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
504 | java.lang.Double.doubleToLongBits(getAverageDoclength()));
505 | hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
506 | hash = (53 * hash) + getDescription().hashCode();
507 | hash = (29 * hash) + unknownFields.hashCode();
508 | memoizedHashCode = hash;
509 | return hash;
510 | }
511 |
512 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseFrom(
513 | java.nio.ByteBuffer data)
514 | throws com.google.protobuf.InvalidProtocolBufferException {
515 | return PARSER.parseFrom(data);
516 | }
517 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseFrom(
518 | java.nio.ByteBuffer data,
519 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
520 | throws com.google.protobuf.InvalidProtocolBufferException {
521 | return PARSER.parseFrom(data, extensionRegistry);
522 | }
523 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseFrom(
524 | com.google.protobuf.ByteString data)
525 | throws com.google.protobuf.InvalidProtocolBufferException {
526 | return PARSER.parseFrom(data);
527 | }
528 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseFrom(
529 | com.google.protobuf.ByteString data,
530 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
531 | throws com.google.protobuf.InvalidProtocolBufferException {
532 | return PARSER.parseFrom(data, extensionRegistry);
533 | }
534 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseFrom(byte[] data)
535 | throws com.google.protobuf.InvalidProtocolBufferException {
536 | return PARSER.parseFrom(data);
537 | }
538 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseFrom(
539 | byte[] data,
540 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
541 | throws com.google.protobuf.InvalidProtocolBufferException {
542 | return PARSER.parseFrom(data, extensionRegistry);
543 | }
544 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseFrom(java.io.InputStream input)
545 | throws java.io.IOException {
546 | return com.google.protobuf.GeneratedMessageV3
547 | .parseWithIOException(PARSER, input);
548 | }
549 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseFrom(
550 | java.io.InputStream input,
551 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
552 | throws java.io.IOException {
553 | return com.google.protobuf.GeneratedMessageV3
554 | .parseWithIOException(PARSER, input, extensionRegistry);
555 | }
556 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseDelimitedFrom(java.io.InputStream input)
557 | throws java.io.IOException {
558 | return com.google.protobuf.GeneratedMessageV3
559 | .parseDelimitedWithIOException(PARSER, input);
560 | }
561 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseDelimitedFrom(
562 | java.io.InputStream input,
563 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
564 | throws java.io.IOException {
565 | return com.google.protobuf.GeneratedMessageV3
566 | .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
567 | }
568 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseFrom(
569 | com.google.protobuf.CodedInputStream input)
570 | throws java.io.IOException {
571 | return com.google.protobuf.GeneratedMessageV3
572 | .parseWithIOException(PARSER, input);
573 | }
574 | public static io.osirrc.ciff.CommonIndexFileFormat.Header parseFrom(
575 | com.google.protobuf.CodedInputStream input,
576 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
577 | throws java.io.IOException {
578 | return com.google.protobuf.GeneratedMessageV3
579 | .parseWithIOException(PARSER, input, extensionRegistry);
580 | }
581 |
582 | @java.lang.Override
583 | public Builder newBuilderForType() { return newBuilder(); }
584 | public static Builder newBuilder() {
585 | return DEFAULT_INSTANCE.toBuilder();
586 | }
587 | public static Builder newBuilder(io.osirrc.ciff.CommonIndexFileFormat.Header prototype) {
588 | return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
589 | }
590 | @java.lang.Override
591 | public Builder toBuilder() {
592 | return this == DEFAULT_INSTANCE
593 | ? new Builder() : new Builder().mergeFrom(this);
594 | }
595 |
596 | @java.lang.Override
597 | protected Builder newBuilderForType(
598 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
599 | Builder builder = new Builder(parent);
600 | return builder;
601 | }
602 | /**
603 | * 604 | * This is the CIFF header. It always comes first. 605 | *606 | * 607 | * Protobuf type {@code io.osirrc.ciff.Header} 608 | */ 609 | public static final class Builder extends 610 | com.google.protobuf.GeneratedMessageV3.Builder
799 | * Version. 800 | *801 | * 802 | *
int32 version = 1;
803 | */
804 | public int getVersion() {
805 | return version_;
806 | }
807 | /**
808 | * 809 | * Version. 810 | *811 | * 812 | *
int32 version = 1;
813 | */
814 | public Builder setVersion(int value) {
815 |
816 | version_ = value;
817 | onChanged();
818 | return this;
819 | }
820 | /**
821 | * 822 | * Version. 823 | *824 | * 825 | *
int32 version = 1;
826 | */
827 | public Builder clearVersion() {
828 |
829 | version_ = 0;
830 | onChanged();
831 | return this;
832 | }
833 |
834 | private int numPostingsLists_ ;
835 | /**
836 | * 837 | * Exactly the number of PostingsList messages that follow the Header. 838 | *839 | * 840 | *
int32 num_postings_lists = 2;
841 | */
842 | public int getNumPostingsLists() {
843 | return numPostingsLists_;
844 | }
845 | /**
846 | * 847 | * Exactly the number of PostingsList messages that follow the Header. 848 | *849 | * 850 | *
int32 num_postings_lists = 2;
851 | */
852 | public Builder setNumPostingsLists(int value) {
853 |
854 | numPostingsLists_ = value;
855 | onChanged();
856 | return this;
857 | }
858 | /**
859 | * 860 | * Exactly the number of PostingsList messages that follow the Header. 861 | *862 | * 863 | *
int32 num_postings_lists = 2;
864 | */
865 | public Builder clearNumPostingsLists() {
866 |
867 | numPostingsLists_ = 0;
868 | onChanged();
869 | return this;
870 | }
871 |
872 | private int numDocs_ ;
873 | /**
874 | * 875 | * Exactly the number of DocRecord messages that follow the PostingsList messages. 876 | *877 | * 878 | *
int32 num_docs = 3;
879 | */
880 | public int getNumDocs() {
881 | return numDocs_;
882 | }
883 | /**
884 | * 885 | * Exactly the number of DocRecord messages that follow the PostingsList messages. 886 | *887 | * 888 | *
int32 num_docs = 3;
889 | */
890 | public Builder setNumDocs(int value) {
891 |
892 | numDocs_ = value;
893 | onChanged();
894 | return this;
895 | }
896 | /**
897 | * 898 | * Exactly the number of DocRecord messages that follow the PostingsList messages. 899 | *900 | * 901 | *
int32 num_docs = 3;
902 | */
903 | public Builder clearNumDocs() {
904 |
905 | numDocs_ = 0;
906 | onChanged();
907 | return this;
908 | }
909 |
910 | private int totalPostingsLists_ ;
911 | /**
912 | * 913 | * The total number of postings lists in the collection; the vocabulary size. This might differ from 914 | * num_postings_lists, for example, because we only export the postings lists of query terms. 915 | *916 | * 917 | *
int32 total_postings_lists = 4;
918 | */
919 | public int getTotalPostingsLists() {
920 | return totalPostingsLists_;
921 | }
922 | /**
923 | * 924 | * The total number of postings lists in the collection; the vocabulary size. This might differ from 925 | * num_postings_lists, for example, because we only export the postings lists of query terms. 926 | *927 | * 928 | *
int32 total_postings_lists = 4;
929 | */
930 | public Builder setTotalPostingsLists(int value) {
931 |
932 | totalPostingsLists_ = value;
933 | onChanged();
934 | return this;
935 | }
936 | /**
937 | * 938 | * The total number of postings lists in the collection; the vocabulary size. This might differ from 939 | * num_postings_lists, for example, because we only export the postings lists of query terms. 940 | *941 | * 942 | *
int32 total_postings_lists = 4;
943 | */
944 | public Builder clearTotalPostingsLists() {
945 |
946 | totalPostingsLists_ = 0;
947 | onChanged();
948 | return this;
949 | }
950 |
951 | private int totalDocs_ ;
952 | /**
953 | * 954 | * The total number of documents in the collection; might differ from num_doc_records for a similar reason as above. 955 | *956 | * 957 | *
int32 total_docs = 5;
958 | */
959 | public int getTotalDocs() {
960 | return totalDocs_;
961 | }
962 | /**
963 | * 964 | * The total number of documents in the collection; might differ from num_doc_records for a similar reason as above. 965 | *966 | * 967 | *
int32 total_docs = 5;
968 | */
969 | public Builder setTotalDocs(int value) {
970 |
971 | totalDocs_ = value;
972 | onChanged();
973 | return this;
974 | }
975 | /**
976 | * 977 | * The total number of documents in the collection; might differ from num_doc_records for a similar reason as above. 978 | *979 | * 980 | *
int32 total_docs = 5;
981 | */
982 | public Builder clearTotalDocs() {
983 |
984 | totalDocs_ = 0;
985 | onChanged();
986 | return this;
987 | }
988 |
989 | private long totalTermsInCollection_ ;
990 | /**
991 | * 992 | * The total number of terms in the entire collection. This is the sum of all document lengths of all documents in 993 | * the collection. 994 | *995 | * 996 | *
int64 total_terms_in_collection = 6;
997 | */
998 | public long getTotalTermsInCollection() {
999 | return totalTermsInCollection_;
1000 | }
1001 | /**
1002 | * 1003 | * The total number of terms in the entire collection. This is the sum of all document lengths of all documents in 1004 | * the collection. 1005 | *1006 | * 1007 | *
int64 total_terms_in_collection = 6;
1008 | */
1009 | public Builder setTotalTermsInCollection(long value) {
1010 |
1011 | totalTermsInCollection_ = value;
1012 | onChanged();
1013 | return this;
1014 | }
1015 | /**
1016 | * 1017 | * The total number of terms in the entire collection. This is the sum of all document lengths of all documents in 1018 | * the collection. 1019 | *1020 | * 1021 | *
int64 total_terms_in_collection = 6;
1022 | */
1023 | public Builder clearTotalTermsInCollection() {
1024 |
1025 | totalTermsInCollection_ = 0L;
1026 | onChanged();
1027 | return this;
1028 | }
1029 |
1030 | private double averageDoclength_ ;
1031 | /**
1032 | * 1033 | * The average document length. We store this value explicitly in case the exporting application wants a particular 1034 | * level of precision. 1035 | *1036 | * 1037 | *
double average_doclength = 7;
1038 | */
1039 | public double getAverageDoclength() {
1040 | return averageDoclength_;
1041 | }
1042 | /**
1043 | * 1044 | * The average document length. We store this value explicitly in case the exporting application wants a particular 1045 | * level of precision. 1046 | *1047 | * 1048 | *
double average_doclength = 7;
1049 | */
1050 | public Builder setAverageDoclength(double value) {
1051 |
1052 | averageDoclength_ = value;
1053 | onChanged();
1054 | return this;
1055 | }
1056 | /**
1057 | * 1058 | * The average document length. We store this value explicitly in case the exporting application wants a particular 1059 | * level of precision. 1060 | *1061 | * 1062 | *
double average_doclength = 7;
1063 | */
1064 | public Builder clearAverageDoclength() {
1065 |
1066 | averageDoclength_ = 0D;
1067 | onChanged();
1068 | return this;
1069 | }
1070 |
1071 | private java.lang.Object description_ = "";
1072 | /**
1073 | * 1074 | * Description of this index, meant for human consumption. Describing, for example, the exporting application, 1075 | * document processing and tokenization pipeline, etc. 1076 | *1077 | * 1078 | *
string description = 8;
1079 | */
1080 | public java.lang.String getDescription() {
1081 | java.lang.Object ref = description_;
1082 | if (!(ref instanceof java.lang.String)) {
1083 | com.google.protobuf.ByteString bs =
1084 | (com.google.protobuf.ByteString) ref;
1085 | java.lang.String s = bs.toStringUtf8();
1086 | description_ = s;
1087 | return s;
1088 | } else {
1089 | return (java.lang.String) ref;
1090 | }
1091 | }
1092 | /**
1093 | * 1094 | * Description of this index, meant for human consumption. Describing, for example, the exporting application, 1095 | * document processing and tokenization pipeline, etc. 1096 | *1097 | * 1098 | *
string description = 8;
1099 | */
1100 | public com.google.protobuf.ByteString
1101 | getDescriptionBytes() {
1102 | java.lang.Object ref = description_;
1103 | if (ref instanceof String) {
1104 | com.google.protobuf.ByteString b =
1105 | com.google.protobuf.ByteString.copyFromUtf8(
1106 | (java.lang.String) ref);
1107 | description_ = b;
1108 | return b;
1109 | } else {
1110 | return (com.google.protobuf.ByteString) ref;
1111 | }
1112 | }
1113 | /**
1114 | * 1115 | * Description of this index, meant for human consumption. Describing, for example, the exporting application, 1116 | * document processing and tokenization pipeline, etc. 1117 | *1118 | * 1119 | *
string description = 8;
1120 | */
1121 | public Builder setDescription(
1122 | java.lang.String value) {
1123 | if (value == null) {
1124 | throw new NullPointerException();
1125 | }
1126 |
1127 | description_ = value;
1128 | onChanged();
1129 | return this;
1130 | }
1131 | /**
1132 | * 1133 | * Description of this index, meant for human consumption. Describing, for example, the exporting application, 1134 | * document processing and tokenization pipeline, etc. 1135 | *1136 | * 1137 | *
string description = 8;
1138 | */
1139 | public Builder clearDescription() {
1140 |
1141 | description_ = getDefaultInstance().getDescription();
1142 | onChanged();
1143 | return this;
1144 | }
1145 | /**
1146 | * 1147 | * Description of this index, meant for human consumption. Describing, for example, the exporting application, 1148 | * document processing and tokenization pipeline, etc. 1149 | *1150 | * 1151 | *
string description = 8;
1152 | */
1153 | public Builder setDescriptionBytes(
1154 | com.google.protobuf.ByteString value) {
1155 | if (value == null) {
1156 | throw new NullPointerException();
1157 | }
1158 | checkByteStringIsUtf8(value);
1159 |
1160 | description_ = value;
1161 | onChanged();
1162 | return this;
1163 | }
1164 | @java.lang.Override
1165 | public final Builder setUnknownFields(
1166 | final com.google.protobuf.UnknownFieldSet unknownFields) {
1167 | return super.setUnknownFields(unknownFields);
1168 | }
1169 |
1170 | @java.lang.Override
1171 | public final Builder mergeUnknownFields(
1172 | final com.google.protobuf.UnknownFieldSet unknownFields) {
1173 | return super.mergeUnknownFields(unknownFields);
1174 | }
1175 |
1176 |
1177 | // @@protoc_insertion_point(builder_scope:io.osirrc.ciff.Header)
1178 | }
1179 |
1180 | // @@protoc_insertion_point(class_scope:io.osirrc.ciff.Header)
1181 | private static final io.osirrc.ciff.CommonIndexFileFormat.Header DEFAULT_INSTANCE;
1182 | static {
1183 | DEFAULT_INSTANCE = new io.osirrc.ciff.CommonIndexFileFormat.Header();
1184 | }
1185 |
1186 | public static io.osirrc.ciff.CommonIndexFileFormat.Header getDefaultInstance() {
1187 | return DEFAULT_INSTANCE;
1188 | }
1189 |
1190 | private static final com.google.protobuf.Parserint32 docid = 1;
1223 | */
1224 | int getDocid();
1225 |
1226 | /**
1227 | * int32 tf = 2;
1228 | */
1229 | int getTf();
1230 | }
1231 | /**
1232 | * 1233 | * An individual posting. 1234 | *1235 | * 1236 | * Protobuf type {@code io.osirrc.ciff.Posting} 1237 | */ 1238 | public static final class Posting extends 1239 | com.google.protobuf.GeneratedMessageV3 implements 1240 | // @@protoc_insertion_point(message_implements:io.osirrc.ciff.Posting) 1241 | PostingOrBuilder { 1242 | private static final long serialVersionUID = 0L; 1243 | // Use Posting.newBuilder() to construct. 1244 | private Posting(com.google.protobuf.GeneratedMessageV3.Builder> builder) { 1245 | super(builder); 1246 | } 1247 | private Posting() { 1248 | } 1249 | 1250 | @java.lang.Override 1251 | @SuppressWarnings({"unused"}) 1252 | protected java.lang.Object newInstance( 1253 | UnusedPrivateParameter unused) { 1254 | return new Posting(); 1255 | } 1256 | 1257 | @java.lang.Override 1258 | public final com.google.protobuf.UnknownFieldSet 1259 | getUnknownFields() { 1260 | return this.unknownFields; 1261 | } 1262 | private Posting( 1263 | com.google.protobuf.CodedInputStream input, 1264 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1265 | throws com.google.protobuf.InvalidProtocolBufferException { 1266 | this(); 1267 | if (extensionRegistry == null) { 1268 | throw new java.lang.NullPointerException(); 1269 | } 1270 | com.google.protobuf.UnknownFieldSet.Builder unknownFields = 1271 | com.google.protobuf.UnknownFieldSet.newBuilder(); 1272 | try { 1273 | boolean done = false; 1274 | while (!done) { 1275 | int tag = input.readTag(); 1276 | switch (tag) { 1277 | case 0: 1278 | done = true; 1279 | break; 1280 | case 8: { 1281 | 1282 | docid_ = input.readInt32(); 1283 | break; 1284 | } 1285 | case 16: { 1286 | 1287 | tf_ = input.readInt32(); 1288 | break; 1289 | } 1290 | default: { 1291 | if (!parseUnknownField( 1292 | input, unknownFields, extensionRegistry, tag)) { 1293 | done = true; 1294 | } 1295 | break; 1296 | } 1297 | } 1298 | } 1299 | } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1300 | throw e.setUnfinishedMessage(this); 1301 | } catch (java.io.IOException e) { 1302 | throw new com.google.protobuf.InvalidProtocolBufferException( 1303 | e).setUnfinishedMessage(this); 1304 | } finally { 1305 | this.unknownFields = unknownFields.build(); 1306 | makeExtensionsImmutable(); 1307 | } 1308 | } 1309 | public static final com.google.protobuf.Descriptors.Descriptor 1310 | getDescriptor() { 1311 | return io.osirrc.ciff.CommonIndexFileFormat.internal_static_io_osirrc_ciff_Posting_descriptor; 1312 | } 1313 | 1314 | @java.lang.Override 1315 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 1316 | internalGetFieldAccessorTable() { 1317 | return io.osirrc.ciff.CommonIndexFileFormat.internal_static_io_osirrc_ciff_Posting_fieldAccessorTable 1318 | .ensureFieldAccessorsInitialized( 1319 | io.osirrc.ciff.CommonIndexFileFormat.Posting.class, io.osirrc.ciff.CommonIndexFileFormat.Posting.Builder.class); 1320 | } 1321 | 1322 | public static final int DOCID_FIELD_NUMBER = 1; 1323 | private int docid_; 1324 | /** 1325 | *
int32 docid = 1;
1326 | */
1327 | public int getDocid() {
1328 | return docid_;
1329 | }
1330 |
1331 | public static final int TF_FIELD_NUMBER = 2;
1332 | private int tf_;
1333 | /**
1334 | * int32 tf = 2;
1335 | */
1336 | public int getTf() {
1337 | return tf_;
1338 | }
1339 |
1340 | private byte memoizedIsInitialized = -1;
1341 | @java.lang.Override
1342 | public final boolean isInitialized() {
1343 | byte isInitialized = memoizedIsInitialized;
1344 | if (isInitialized == 1) return true;
1345 | if (isInitialized == 0) return false;
1346 |
1347 | memoizedIsInitialized = 1;
1348 | return true;
1349 | }
1350 |
1351 | @java.lang.Override
1352 | public void writeTo(com.google.protobuf.CodedOutputStream output)
1353 | throws java.io.IOException {
1354 | if (docid_ != 0) {
1355 | output.writeInt32(1, docid_);
1356 | }
1357 | if (tf_ != 0) {
1358 | output.writeInt32(2, tf_);
1359 | }
1360 | unknownFields.writeTo(output);
1361 | }
1362 |
1363 | @java.lang.Override
1364 | public int getSerializedSize() {
1365 | int size = memoizedSize;
1366 | if (size != -1) return size;
1367 |
1368 | size = 0;
1369 | if (docid_ != 0) {
1370 | size += com.google.protobuf.CodedOutputStream
1371 | .computeInt32Size(1, docid_);
1372 | }
1373 | if (tf_ != 0) {
1374 | size += com.google.protobuf.CodedOutputStream
1375 | .computeInt32Size(2, tf_);
1376 | }
1377 | size += unknownFields.getSerializedSize();
1378 | memoizedSize = size;
1379 | return size;
1380 | }
1381 |
1382 | @java.lang.Override
1383 | public boolean equals(final java.lang.Object obj) {
1384 | if (obj == this) {
1385 | return true;
1386 | }
1387 | if (!(obj instanceof io.osirrc.ciff.CommonIndexFileFormat.Posting)) {
1388 | return super.equals(obj);
1389 | }
1390 | io.osirrc.ciff.CommonIndexFileFormat.Posting other = (io.osirrc.ciff.CommonIndexFileFormat.Posting) obj;
1391 |
1392 | if (getDocid()
1393 | != other.getDocid()) return false;
1394 | if (getTf()
1395 | != other.getTf()) return false;
1396 | if (!unknownFields.equals(other.unknownFields)) return false;
1397 | return true;
1398 | }
1399 |
1400 | @java.lang.Override
1401 | public int hashCode() {
1402 | if (memoizedHashCode != 0) {
1403 | return memoizedHashCode;
1404 | }
1405 | int hash = 41;
1406 | hash = (19 * hash) + getDescriptor().hashCode();
1407 | hash = (37 * hash) + DOCID_FIELD_NUMBER;
1408 | hash = (53 * hash) + getDocid();
1409 | hash = (37 * hash) + TF_FIELD_NUMBER;
1410 | hash = (53 * hash) + getTf();
1411 | hash = (29 * hash) + unknownFields.hashCode();
1412 | memoizedHashCode = hash;
1413 | return hash;
1414 | }
1415 |
1416 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseFrom(
1417 | java.nio.ByteBuffer data)
1418 | throws com.google.protobuf.InvalidProtocolBufferException {
1419 | return PARSER.parseFrom(data);
1420 | }
1421 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseFrom(
1422 | java.nio.ByteBuffer data,
1423 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1424 | throws com.google.protobuf.InvalidProtocolBufferException {
1425 | return PARSER.parseFrom(data, extensionRegistry);
1426 | }
1427 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseFrom(
1428 | com.google.protobuf.ByteString data)
1429 | throws com.google.protobuf.InvalidProtocolBufferException {
1430 | return PARSER.parseFrom(data);
1431 | }
1432 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseFrom(
1433 | com.google.protobuf.ByteString data,
1434 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1435 | throws com.google.protobuf.InvalidProtocolBufferException {
1436 | return PARSER.parseFrom(data, extensionRegistry);
1437 | }
1438 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseFrom(byte[] data)
1439 | throws com.google.protobuf.InvalidProtocolBufferException {
1440 | return PARSER.parseFrom(data);
1441 | }
1442 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseFrom(
1443 | byte[] data,
1444 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1445 | throws com.google.protobuf.InvalidProtocolBufferException {
1446 | return PARSER.parseFrom(data, extensionRegistry);
1447 | }
1448 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseFrom(java.io.InputStream input)
1449 | throws java.io.IOException {
1450 | return com.google.protobuf.GeneratedMessageV3
1451 | .parseWithIOException(PARSER, input);
1452 | }
1453 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseFrom(
1454 | java.io.InputStream input,
1455 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1456 | throws java.io.IOException {
1457 | return com.google.protobuf.GeneratedMessageV3
1458 | .parseWithIOException(PARSER, input, extensionRegistry);
1459 | }
1460 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseDelimitedFrom(java.io.InputStream input)
1461 | throws java.io.IOException {
1462 | return com.google.protobuf.GeneratedMessageV3
1463 | .parseDelimitedWithIOException(PARSER, input);
1464 | }
1465 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseDelimitedFrom(
1466 | java.io.InputStream input,
1467 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1468 | throws java.io.IOException {
1469 | return com.google.protobuf.GeneratedMessageV3
1470 | .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
1471 | }
1472 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseFrom(
1473 | com.google.protobuf.CodedInputStream input)
1474 | throws java.io.IOException {
1475 | return com.google.protobuf.GeneratedMessageV3
1476 | .parseWithIOException(PARSER, input);
1477 | }
1478 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting parseFrom(
1479 | com.google.protobuf.CodedInputStream input,
1480 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1481 | throws java.io.IOException {
1482 | return com.google.protobuf.GeneratedMessageV3
1483 | .parseWithIOException(PARSER, input, extensionRegistry);
1484 | }
1485 |
1486 | @java.lang.Override
1487 | public Builder newBuilderForType() { return newBuilder(); }
1488 | public static Builder newBuilder() {
1489 | return DEFAULT_INSTANCE.toBuilder();
1490 | }
1491 | public static Builder newBuilder(io.osirrc.ciff.CommonIndexFileFormat.Posting prototype) {
1492 | return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
1493 | }
1494 | @java.lang.Override
1495 | public Builder toBuilder() {
1496 | return this == DEFAULT_INSTANCE
1497 | ? new Builder() : new Builder().mergeFrom(this);
1498 | }
1499 |
1500 | @java.lang.Override
1501 | protected Builder newBuilderForType(
1502 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1503 | Builder builder = new Builder(parent);
1504 | return builder;
1505 | }
1506 | /**
1507 | * 1508 | * An individual posting. 1509 | *1510 | * 1511 | * Protobuf type {@code io.osirrc.ciff.Posting} 1512 | */ 1513 | public static final class Builder extends 1514 | com.google.protobuf.GeneratedMessageV3.Builder
int32 docid = 1;
1666 | */
1667 | public int getDocid() {
1668 | return docid_;
1669 | }
1670 | /**
1671 | * int32 docid = 1;
1672 | */
1673 | public Builder setDocid(int value) {
1674 |
1675 | docid_ = value;
1676 | onChanged();
1677 | return this;
1678 | }
1679 | /**
1680 | * int32 docid = 1;
1681 | */
1682 | public Builder clearDocid() {
1683 |
1684 | docid_ = 0;
1685 | onChanged();
1686 | return this;
1687 | }
1688 |
1689 | private int tf_ ;
1690 | /**
1691 | * int32 tf = 2;
1692 | */
1693 | public int getTf() {
1694 | return tf_;
1695 | }
1696 | /**
1697 | * int32 tf = 2;
1698 | */
1699 | public Builder setTf(int value) {
1700 |
1701 | tf_ = value;
1702 | onChanged();
1703 | return this;
1704 | }
1705 | /**
1706 | * int32 tf = 2;
1707 | */
1708 | public Builder clearTf() {
1709 |
1710 | tf_ = 0;
1711 | onChanged();
1712 | return this;
1713 | }
1714 | @java.lang.Override
1715 | public final Builder setUnknownFields(
1716 | final com.google.protobuf.UnknownFieldSet unknownFields) {
1717 | return super.setUnknownFields(unknownFields);
1718 | }
1719 |
1720 | @java.lang.Override
1721 | public final Builder mergeUnknownFields(
1722 | final com.google.protobuf.UnknownFieldSet unknownFields) {
1723 | return super.mergeUnknownFields(unknownFields);
1724 | }
1725 |
1726 |
1727 | // @@protoc_insertion_point(builder_scope:io.osirrc.ciff.Posting)
1728 | }
1729 |
1730 | // @@protoc_insertion_point(class_scope:io.osirrc.ciff.Posting)
1731 | private static final io.osirrc.ciff.CommonIndexFileFormat.Posting DEFAULT_INSTANCE;
1732 | static {
1733 | DEFAULT_INSTANCE = new io.osirrc.ciff.CommonIndexFileFormat.Posting();
1734 | }
1735 |
1736 | public static io.osirrc.ciff.CommonIndexFileFormat.Posting getDefaultInstance() {
1737 | return DEFAULT_INSTANCE;
1738 | }
1739 |
1740 | private static final com.google.protobuf.Parser1773 | * The term. 1774 | *1775 | * 1776 | *
string term = 1;
1777 | */
1778 | java.lang.String getTerm();
1779 | /**
1780 | * 1781 | * The term. 1782 | *1783 | * 1784 | *
string term = 1;
1785 | */
1786 | com.google.protobuf.ByteString
1787 | getTermBytes();
1788 |
1789 | /**
1790 | * 1791 | * The document frequency. 1792 | *1793 | * 1794 | *
int64 df = 2;
1795 | */
1796 | long getDf();
1797 |
1798 | /**
1799 | * 1800 | * The collection frequency. 1801 | *1802 | * 1803 | *
int64 cf = 3;
1804 | */
1805 | long getCf();
1806 |
1807 | /**
1808 | * repeated .io.osirrc.ciff.Posting postings = 4;
1809 | */
1810 | java.util.Listrepeated .io.osirrc.ciff.Posting postings = 4;
1814 | */
1815 | io.osirrc.ciff.CommonIndexFileFormat.Posting getPostings(int index);
1816 | /**
1817 | * repeated .io.osirrc.ciff.Posting postings = 4;
1818 | */
1819 | int getPostingsCount();
1820 | /**
1821 | * repeated .io.osirrc.ciff.Posting postings = 4;
1822 | */
1823 | java.util.List extends io.osirrc.ciff.CommonIndexFileFormat.PostingOrBuilder>
1824 | getPostingsOrBuilderList();
1825 | /**
1826 | * repeated .io.osirrc.ciff.Posting postings = 4;
1827 | */
1828 | io.osirrc.ciff.CommonIndexFileFormat.PostingOrBuilder getPostingsOrBuilder(
1829 | int index);
1830 | }
1831 | /**
1832 | * 1833 | * A postings list, comprised of one ore more postings. 1834 | *1835 | * 1836 | * Protobuf type {@code io.osirrc.ciff.PostingsList} 1837 | */ 1838 | public static final class PostingsList extends 1839 | com.google.protobuf.GeneratedMessageV3 implements 1840 | // @@protoc_insertion_point(message_implements:io.osirrc.ciff.PostingsList) 1841 | PostingsListOrBuilder { 1842 | private static final long serialVersionUID = 0L; 1843 | // Use PostingsList.newBuilder() to construct. 1844 | private PostingsList(com.google.protobuf.GeneratedMessageV3.Builder> builder) { 1845 | super(builder); 1846 | } 1847 | private PostingsList() { 1848 | term_ = ""; 1849 | postings_ = java.util.Collections.emptyList(); 1850 | } 1851 | 1852 | @java.lang.Override 1853 | @SuppressWarnings({"unused"}) 1854 | protected java.lang.Object newInstance( 1855 | UnusedPrivateParameter unused) { 1856 | return new PostingsList(); 1857 | } 1858 | 1859 | @java.lang.Override 1860 | public final com.google.protobuf.UnknownFieldSet 1861 | getUnknownFields() { 1862 | return this.unknownFields; 1863 | } 1864 | private PostingsList( 1865 | com.google.protobuf.CodedInputStream input, 1866 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1867 | throws com.google.protobuf.InvalidProtocolBufferException { 1868 | this(); 1869 | if (extensionRegistry == null) { 1870 | throw new java.lang.NullPointerException(); 1871 | } 1872 | int mutable_bitField0_ = 0; 1873 | com.google.protobuf.UnknownFieldSet.Builder unknownFields = 1874 | com.google.protobuf.UnknownFieldSet.newBuilder(); 1875 | try { 1876 | boolean done = false; 1877 | while (!done) { 1878 | int tag = input.readTag(); 1879 | switch (tag) { 1880 | case 0: 1881 | done = true; 1882 | break; 1883 | case 10: { 1884 | java.lang.String s = input.readStringRequireUtf8(); 1885 | 1886 | term_ = s; 1887 | break; 1888 | } 1889 | case 16: { 1890 | 1891 | df_ = input.readInt64(); 1892 | break; 1893 | } 1894 | case 24: { 1895 | 1896 | cf_ = input.readInt64(); 1897 | break; 1898 | } 1899 | case 34: { 1900 | if (!((mutable_bitField0_ & 0x00000001) != 0)) { 1901 | postings_ = new java.util.ArrayList
1947 | * The term. 1948 | *1949 | * 1950 | *
string term = 1;
1951 | */
1952 | public java.lang.String getTerm() {
1953 | java.lang.Object ref = term_;
1954 | if (ref instanceof java.lang.String) {
1955 | return (java.lang.String) ref;
1956 | } else {
1957 | com.google.protobuf.ByteString bs =
1958 | (com.google.protobuf.ByteString) ref;
1959 | java.lang.String s = bs.toStringUtf8();
1960 | term_ = s;
1961 | return s;
1962 | }
1963 | }
1964 | /**
1965 | * 1966 | * The term. 1967 | *1968 | * 1969 | *
string term = 1;
1970 | */
1971 | public com.google.protobuf.ByteString
1972 | getTermBytes() {
1973 | java.lang.Object ref = term_;
1974 | if (ref instanceof java.lang.String) {
1975 | com.google.protobuf.ByteString b =
1976 | com.google.protobuf.ByteString.copyFromUtf8(
1977 | (java.lang.String) ref);
1978 | term_ = b;
1979 | return b;
1980 | } else {
1981 | return (com.google.protobuf.ByteString) ref;
1982 | }
1983 | }
1984 |
1985 | public static final int DF_FIELD_NUMBER = 2;
1986 | private long df_;
1987 | /**
1988 | * 1989 | * The document frequency. 1990 | *1991 | * 1992 | *
int64 df = 2;
1993 | */
1994 | public long getDf() {
1995 | return df_;
1996 | }
1997 |
1998 | public static final int CF_FIELD_NUMBER = 3;
1999 | private long cf_;
2000 | /**
2001 | * 2002 | * The collection frequency. 2003 | *2004 | * 2005 | *
int64 cf = 3;
2006 | */
2007 | public long getCf() {
2008 | return cf_;
2009 | }
2010 |
2011 | public static final int POSTINGS_FIELD_NUMBER = 4;
2012 | private java.util.Listrepeated .io.osirrc.ciff.Posting postings = 4;
2015 | */
2016 | public java.util.Listrepeated .io.osirrc.ciff.Posting postings = 4;
2021 | */
2022 | public java.util.List extends io.osirrc.ciff.CommonIndexFileFormat.PostingOrBuilder>
2023 | getPostingsOrBuilderList() {
2024 | return postings_;
2025 | }
2026 | /**
2027 | * repeated .io.osirrc.ciff.Posting postings = 4;
2028 | */
2029 | public int getPostingsCount() {
2030 | return postings_.size();
2031 | }
2032 | /**
2033 | * repeated .io.osirrc.ciff.Posting postings = 4;
2034 | */
2035 | public io.osirrc.ciff.CommonIndexFileFormat.Posting getPostings(int index) {
2036 | return postings_.get(index);
2037 | }
2038 | /**
2039 | * repeated .io.osirrc.ciff.Posting postings = 4;
2040 | */
2041 | public io.osirrc.ciff.CommonIndexFileFormat.PostingOrBuilder getPostingsOrBuilder(
2042 | int index) {
2043 | return postings_.get(index);
2044 | }
2045 |
2046 | private byte memoizedIsInitialized = -1;
2047 | @java.lang.Override
2048 | public final boolean isInitialized() {
2049 | byte isInitialized = memoizedIsInitialized;
2050 | if (isInitialized == 1) return true;
2051 | if (isInitialized == 0) return false;
2052 |
2053 | memoizedIsInitialized = 1;
2054 | return true;
2055 | }
2056 |
2057 | @java.lang.Override
2058 | public void writeTo(com.google.protobuf.CodedOutputStream output)
2059 | throws java.io.IOException {
2060 | if (!getTermBytes().isEmpty()) {
2061 | com.google.protobuf.GeneratedMessageV3.writeString(output, 1, term_);
2062 | }
2063 | if (df_ != 0L) {
2064 | output.writeInt64(2, df_);
2065 | }
2066 | if (cf_ != 0L) {
2067 | output.writeInt64(3, cf_);
2068 | }
2069 | for (int i = 0; i < postings_.size(); i++) {
2070 | output.writeMessage(4, postings_.get(i));
2071 | }
2072 | unknownFields.writeTo(output);
2073 | }
2074 |
2075 | @java.lang.Override
2076 | public int getSerializedSize() {
2077 | int size = memoizedSize;
2078 | if (size != -1) return size;
2079 |
2080 | size = 0;
2081 | if (!getTermBytes().isEmpty()) {
2082 | size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, term_);
2083 | }
2084 | if (df_ != 0L) {
2085 | size += com.google.protobuf.CodedOutputStream
2086 | .computeInt64Size(2, df_);
2087 | }
2088 | if (cf_ != 0L) {
2089 | size += com.google.protobuf.CodedOutputStream
2090 | .computeInt64Size(3, cf_);
2091 | }
2092 | for (int i = 0; i < postings_.size(); i++) {
2093 | size += com.google.protobuf.CodedOutputStream
2094 | .computeMessageSize(4, postings_.get(i));
2095 | }
2096 | size += unknownFields.getSerializedSize();
2097 | memoizedSize = size;
2098 | return size;
2099 | }
2100 |
2101 | @java.lang.Override
2102 | public boolean equals(final java.lang.Object obj) {
2103 | if (obj == this) {
2104 | return true;
2105 | }
2106 | if (!(obj instanceof io.osirrc.ciff.CommonIndexFileFormat.PostingsList)) {
2107 | return super.equals(obj);
2108 | }
2109 | io.osirrc.ciff.CommonIndexFileFormat.PostingsList other = (io.osirrc.ciff.CommonIndexFileFormat.PostingsList) obj;
2110 |
2111 | if (!getTerm()
2112 | .equals(other.getTerm())) return false;
2113 | if (getDf()
2114 | != other.getDf()) return false;
2115 | if (getCf()
2116 | != other.getCf()) return false;
2117 | if (!getPostingsList()
2118 | .equals(other.getPostingsList())) return false;
2119 | if (!unknownFields.equals(other.unknownFields)) return false;
2120 | return true;
2121 | }
2122 |
2123 | @java.lang.Override
2124 | public int hashCode() {
2125 | if (memoizedHashCode != 0) {
2126 | return memoizedHashCode;
2127 | }
2128 | int hash = 41;
2129 | hash = (19 * hash) + getDescriptor().hashCode();
2130 | hash = (37 * hash) + TERM_FIELD_NUMBER;
2131 | hash = (53 * hash) + getTerm().hashCode();
2132 | hash = (37 * hash) + DF_FIELD_NUMBER;
2133 | hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
2134 | getDf());
2135 | hash = (37 * hash) + CF_FIELD_NUMBER;
2136 | hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
2137 | getCf());
2138 | if (getPostingsCount() > 0) {
2139 | hash = (37 * hash) + POSTINGS_FIELD_NUMBER;
2140 | hash = (53 * hash) + getPostingsList().hashCode();
2141 | }
2142 | hash = (29 * hash) + unknownFields.hashCode();
2143 | memoizedHashCode = hash;
2144 | return hash;
2145 | }
2146 |
2147 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseFrom(
2148 | java.nio.ByteBuffer data)
2149 | throws com.google.protobuf.InvalidProtocolBufferException {
2150 | return PARSER.parseFrom(data);
2151 | }
2152 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseFrom(
2153 | java.nio.ByteBuffer data,
2154 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2155 | throws com.google.protobuf.InvalidProtocolBufferException {
2156 | return PARSER.parseFrom(data, extensionRegistry);
2157 | }
2158 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseFrom(
2159 | com.google.protobuf.ByteString data)
2160 | throws com.google.protobuf.InvalidProtocolBufferException {
2161 | return PARSER.parseFrom(data);
2162 | }
2163 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseFrom(
2164 | com.google.protobuf.ByteString data,
2165 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2166 | throws com.google.protobuf.InvalidProtocolBufferException {
2167 | return PARSER.parseFrom(data, extensionRegistry);
2168 | }
2169 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseFrom(byte[] data)
2170 | throws com.google.protobuf.InvalidProtocolBufferException {
2171 | return PARSER.parseFrom(data);
2172 | }
2173 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseFrom(
2174 | byte[] data,
2175 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2176 | throws com.google.protobuf.InvalidProtocolBufferException {
2177 | return PARSER.parseFrom(data, extensionRegistry);
2178 | }
2179 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseFrom(java.io.InputStream input)
2180 | throws java.io.IOException {
2181 | return com.google.protobuf.GeneratedMessageV3
2182 | .parseWithIOException(PARSER, input);
2183 | }
2184 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseFrom(
2185 | java.io.InputStream input,
2186 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2187 | throws java.io.IOException {
2188 | return com.google.protobuf.GeneratedMessageV3
2189 | .parseWithIOException(PARSER, input, extensionRegistry);
2190 | }
2191 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseDelimitedFrom(java.io.InputStream input)
2192 | throws java.io.IOException {
2193 | return com.google.protobuf.GeneratedMessageV3
2194 | .parseDelimitedWithIOException(PARSER, input);
2195 | }
2196 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseDelimitedFrom(
2197 | java.io.InputStream input,
2198 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2199 | throws java.io.IOException {
2200 | return com.google.protobuf.GeneratedMessageV3
2201 | .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
2202 | }
2203 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseFrom(
2204 | com.google.protobuf.CodedInputStream input)
2205 | throws java.io.IOException {
2206 | return com.google.protobuf.GeneratedMessageV3
2207 | .parseWithIOException(PARSER, input);
2208 | }
2209 | public static io.osirrc.ciff.CommonIndexFileFormat.PostingsList parseFrom(
2210 | com.google.protobuf.CodedInputStream input,
2211 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2212 | throws java.io.IOException {
2213 | return com.google.protobuf.GeneratedMessageV3
2214 | .parseWithIOException(PARSER, input, extensionRegistry);
2215 | }
2216 |
2217 | @java.lang.Override
2218 | public Builder newBuilderForType() { return newBuilder(); }
2219 | public static Builder newBuilder() {
2220 | return DEFAULT_INSTANCE.toBuilder();
2221 | }
2222 | public static Builder newBuilder(io.osirrc.ciff.CommonIndexFileFormat.PostingsList prototype) {
2223 | return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
2224 | }
2225 | @java.lang.Override
2226 | public Builder toBuilder() {
2227 | return this == DEFAULT_INSTANCE
2228 | ? new Builder() : new Builder().mergeFrom(this);
2229 | }
2230 |
2231 | @java.lang.Override
2232 | protected Builder newBuilderForType(
2233 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
2234 | Builder builder = new Builder(parent);
2235 | return builder;
2236 | }
2237 | /**
2238 | * 2239 | * A postings list, comprised of one ore more postings. 2240 | *2241 | * 2242 | * Protobuf type {@code io.osirrc.ciff.PostingsList} 2243 | */ 2244 | public static final class Builder extends 2245 | com.google.protobuf.GeneratedMessageV3.Builder
2448 | * The term. 2449 | *2450 | * 2451 | *
string term = 1;
2452 | */
2453 | public java.lang.String getTerm() {
2454 | java.lang.Object ref = term_;
2455 | if (!(ref instanceof java.lang.String)) {
2456 | com.google.protobuf.ByteString bs =
2457 | (com.google.protobuf.ByteString) ref;
2458 | java.lang.String s = bs.toStringUtf8();
2459 | term_ = s;
2460 | return s;
2461 | } else {
2462 | return (java.lang.String) ref;
2463 | }
2464 | }
2465 | /**
2466 | * 2467 | * The term. 2468 | *2469 | * 2470 | *
string term = 1;
2471 | */
2472 | public com.google.protobuf.ByteString
2473 | getTermBytes() {
2474 | java.lang.Object ref = term_;
2475 | if (ref instanceof String) {
2476 | com.google.protobuf.ByteString b =
2477 | com.google.protobuf.ByteString.copyFromUtf8(
2478 | (java.lang.String) ref);
2479 | term_ = b;
2480 | return b;
2481 | } else {
2482 | return (com.google.protobuf.ByteString) ref;
2483 | }
2484 | }
2485 | /**
2486 | * 2487 | * The term. 2488 | *2489 | * 2490 | *
string term = 1;
2491 | */
2492 | public Builder setTerm(
2493 | java.lang.String value) {
2494 | if (value == null) {
2495 | throw new NullPointerException();
2496 | }
2497 |
2498 | term_ = value;
2499 | onChanged();
2500 | return this;
2501 | }
2502 | /**
2503 | * 2504 | * The term. 2505 | *2506 | * 2507 | *
string term = 1;
2508 | */
2509 | public Builder clearTerm() {
2510 |
2511 | term_ = getDefaultInstance().getTerm();
2512 | onChanged();
2513 | return this;
2514 | }
2515 | /**
2516 | * 2517 | * The term. 2518 | *2519 | * 2520 | *
string term = 1;
2521 | */
2522 | public Builder setTermBytes(
2523 | com.google.protobuf.ByteString value) {
2524 | if (value == null) {
2525 | throw new NullPointerException();
2526 | }
2527 | checkByteStringIsUtf8(value);
2528 |
2529 | term_ = value;
2530 | onChanged();
2531 | return this;
2532 | }
2533 |
2534 | private long df_ ;
2535 | /**
2536 | * 2537 | * The document frequency. 2538 | *2539 | * 2540 | *
int64 df = 2;
2541 | */
2542 | public long getDf() {
2543 | return df_;
2544 | }
2545 | /**
2546 | * 2547 | * The document frequency. 2548 | *2549 | * 2550 | *
int64 df = 2;
2551 | */
2552 | public Builder setDf(long value) {
2553 |
2554 | df_ = value;
2555 | onChanged();
2556 | return this;
2557 | }
2558 | /**
2559 | * 2560 | * The document frequency. 2561 | *2562 | * 2563 | *
int64 df = 2;
2564 | */
2565 | public Builder clearDf() {
2566 |
2567 | df_ = 0L;
2568 | onChanged();
2569 | return this;
2570 | }
2571 |
2572 | private long cf_ ;
2573 | /**
2574 | * 2575 | * The collection frequency. 2576 | *2577 | * 2578 | *
int64 cf = 3;
2579 | */
2580 | public long getCf() {
2581 | return cf_;
2582 | }
2583 | /**
2584 | * 2585 | * The collection frequency. 2586 | *2587 | * 2588 | *
int64 cf = 3;
2589 | */
2590 | public Builder setCf(long value) {
2591 |
2592 | cf_ = value;
2593 | onChanged();
2594 | return this;
2595 | }
2596 | /**
2597 | * 2598 | * The collection frequency. 2599 | *2600 | * 2601 | *
int64 cf = 3;
2602 | */
2603 | public Builder clearCf() {
2604 |
2605 | cf_ = 0L;
2606 | onChanged();
2607 | return this;
2608 | }
2609 |
2610 | private java.util.Listrepeated .io.osirrc.ciff.Posting postings = 4;
2624 | */
2625 | public java.util.Listrepeated .io.osirrc.ciff.Posting postings = 4;
2634 | */
2635 | public int getPostingsCount() {
2636 | if (postingsBuilder_ == null) {
2637 | return postings_.size();
2638 | } else {
2639 | return postingsBuilder_.getCount();
2640 | }
2641 | }
2642 | /**
2643 | * repeated .io.osirrc.ciff.Posting postings = 4;
2644 | */
2645 | public io.osirrc.ciff.CommonIndexFileFormat.Posting getPostings(int index) {
2646 | if (postingsBuilder_ == null) {
2647 | return postings_.get(index);
2648 | } else {
2649 | return postingsBuilder_.getMessage(index);
2650 | }
2651 | }
2652 | /**
2653 | * repeated .io.osirrc.ciff.Posting postings = 4;
2654 | */
2655 | public Builder setPostings(
2656 | int index, io.osirrc.ciff.CommonIndexFileFormat.Posting value) {
2657 | if (postingsBuilder_ == null) {
2658 | if (value == null) {
2659 | throw new NullPointerException();
2660 | }
2661 | ensurePostingsIsMutable();
2662 | postings_.set(index, value);
2663 | onChanged();
2664 | } else {
2665 | postingsBuilder_.setMessage(index, value);
2666 | }
2667 | return this;
2668 | }
2669 | /**
2670 | * repeated .io.osirrc.ciff.Posting postings = 4;
2671 | */
2672 | public Builder setPostings(
2673 | int index, io.osirrc.ciff.CommonIndexFileFormat.Posting.Builder builderForValue) {
2674 | if (postingsBuilder_ == null) {
2675 | ensurePostingsIsMutable();
2676 | postings_.set(index, builderForValue.build());
2677 | onChanged();
2678 | } else {
2679 | postingsBuilder_.setMessage(index, builderForValue.build());
2680 | }
2681 | return this;
2682 | }
2683 | /**
2684 | * repeated .io.osirrc.ciff.Posting postings = 4;
2685 | */
2686 | public Builder addPostings(io.osirrc.ciff.CommonIndexFileFormat.Posting value) {
2687 | if (postingsBuilder_ == null) {
2688 | if (value == null) {
2689 | throw new NullPointerException();
2690 | }
2691 | ensurePostingsIsMutable();
2692 | postings_.add(value);
2693 | onChanged();
2694 | } else {
2695 | postingsBuilder_.addMessage(value);
2696 | }
2697 | return this;
2698 | }
2699 | /**
2700 | * repeated .io.osirrc.ciff.Posting postings = 4;
2701 | */
2702 | public Builder addPostings(
2703 | int index, io.osirrc.ciff.CommonIndexFileFormat.Posting value) {
2704 | if (postingsBuilder_ == null) {
2705 | if (value == null) {
2706 | throw new NullPointerException();
2707 | }
2708 | ensurePostingsIsMutable();
2709 | postings_.add(index, value);
2710 | onChanged();
2711 | } else {
2712 | postingsBuilder_.addMessage(index, value);
2713 | }
2714 | return this;
2715 | }
2716 | /**
2717 | * repeated .io.osirrc.ciff.Posting postings = 4;
2718 | */
2719 | public Builder addPostings(
2720 | io.osirrc.ciff.CommonIndexFileFormat.Posting.Builder builderForValue) {
2721 | if (postingsBuilder_ == null) {
2722 | ensurePostingsIsMutable();
2723 | postings_.add(builderForValue.build());
2724 | onChanged();
2725 | } else {
2726 | postingsBuilder_.addMessage(builderForValue.build());
2727 | }
2728 | return this;
2729 | }
2730 | /**
2731 | * repeated .io.osirrc.ciff.Posting postings = 4;
2732 | */
2733 | public Builder addPostings(
2734 | int index, io.osirrc.ciff.CommonIndexFileFormat.Posting.Builder builderForValue) {
2735 | if (postingsBuilder_ == null) {
2736 | ensurePostingsIsMutable();
2737 | postings_.add(index, builderForValue.build());
2738 | onChanged();
2739 | } else {
2740 | postingsBuilder_.addMessage(index, builderForValue.build());
2741 | }
2742 | return this;
2743 | }
2744 | /**
2745 | * repeated .io.osirrc.ciff.Posting postings = 4;
2746 | */
2747 | public Builder addAllPostings(
2748 | java.lang.Iterable extends io.osirrc.ciff.CommonIndexFileFormat.Posting> values) {
2749 | if (postingsBuilder_ == null) {
2750 | ensurePostingsIsMutable();
2751 | com.google.protobuf.AbstractMessageLite.Builder.addAll(
2752 | values, postings_);
2753 | onChanged();
2754 | } else {
2755 | postingsBuilder_.addAllMessages(values);
2756 | }
2757 | return this;
2758 | }
2759 | /**
2760 | * repeated .io.osirrc.ciff.Posting postings = 4;
2761 | */
2762 | public Builder clearPostings() {
2763 | if (postingsBuilder_ == null) {
2764 | postings_ = java.util.Collections.emptyList();
2765 | bitField0_ = (bitField0_ & ~0x00000001);
2766 | onChanged();
2767 | } else {
2768 | postingsBuilder_.clear();
2769 | }
2770 | return this;
2771 | }
2772 | /**
2773 | * repeated .io.osirrc.ciff.Posting postings = 4;
2774 | */
2775 | public Builder removePostings(int index) {
2776 | if (postingsBuilder_ == null) {
2777 | ensurePostingsIsMutable();
2778 | postings_.remove(index);
2779 | onChanged();
2780 | } else {
2781 | postingsBuilder_.remove(index);
2782 | }
2783 | return this;
2784 | }
2785 | /**
2786 | * repeated .io.osirrc.ciff.Posting postings = 4;
2787 | */
2788 | public io.osirrc.ciff.CommonIndexFileFormat.Posting.Builder getPostingsBuilder(
2789 | int index) {
2790 | return getPostingsFieldBuilder().getBuilder(index);
2791 | }
2792 | /**
2793 | * repeated .io.osirrc.ciff.Posting postings = 4;
2794 | */
2795 | public io.osirrc.ciff.CommonIndexFileFormat.PostingOrBuilder getPostingsOrBuilder(
2796 | int index) {
2797 | if (postingsBuilder_ == null) {
2798 | return postings_.get(index); } else {
2799 | return postingsBuilder_.getMessageOrBuilder(index);
2800 | }
2801 | }
2802 | /**
2803 | * repeated .io.osirrc.ciff.Posting postings = 4;
2804 | */
2805 | public java.util.List extends io.osirrc.ciff.CommonIndexFileFormat.PostingOrBuilder>
2806 | getPostingsOrBuilderList() {
2807 | if (postingsBuilder_ != null) {
2808 | return postingsBuilder_.getMessageOrBuilderList();
2809 | } else {
2810 | return java.util.Collections.unmodifiableList(postings_);
2811 | }
2812 | }
2813 | /**
2814 | * repeated .io.osirrc.ciff.Posting postings = 4;
2815 | */
2816 | public io.osirrc.ciff.CommonIndexFileFormat.Posting.Builder addPostingsBuilder() {
2817 | return getPostingsFieldBuilder().addBuilder(
2818 | io.osirrc.ciff.CommonIndexFileFormat.Posting.getDefaultInstance());
2819 | }
2820 | /**
2821 | * repeated .io.osirrc.ciff.Posting postings = 4;
2822 | */
2823 | public io.osirrc.ciff.CommonIndexFileFormat.Posting.Builder addPostingsBuilder(
2824 | int index) {
2825 | return getPostingsFieldBuilder().addBuilder(
2826 | index, io.osirrc.ciff.CommonIndexFileFormat.Posting.getDefaultInstance());
2827 | }
2828 | /**
2829 | * repeated .io.osirrc.ciff.Posting postings = 4;
2830 | */
2831 | public java.util.List2908 | * Refers to the docid in the postings lists. 2909 | *2910 | * 2911 | *
int32 docid = 1;
2912 | */
2913 | int getDocid();
2914 |
2915 | /**
2916 | * 2917 | * Refers to a docid in the external collection. 2918 | *2919 | * 2920 | *
string collection_docid = 2;
2921 | */
2922 | java.lang.String getCollectionDocid();
2923 | /**
2924 | * 2925 | * Refers to a docid in the external collection. 2926 | *2927 | * 2928 | *
string collection_docid = 2;
2929 | */
2930 | com.google.protobuf.ByteString
2931 | getCollectionDocidBytes();
2932 |
2933 | /**
2934 | * 2935 | * Length of this document. 2936 | *2937 | * 2938 | *
int32 doclength = 3;
2939 | */
2940 | int getDoclength();
2941 | }
2942 | /**
2943 | * 2944 | * A record containing metadata about an individual document. 2945 | *2946 | * 2947 | * Protobuf type {@code io.osirrc.ciff.DocRecord} 2948 | */ 2949 | public static final class DocRecord extends 2950 | com.google.protobuf.GeneratedMessageV3 implements 2951 | // @@protoc_insertion_point(message_implements:io.osirrc.ciff.DocRecord) 2952 | DocRecordOrBuilder { 2953 | private static final long serialVersionUID = 0L; 2954 | // Use DocRecord.newBuilder() to construct. 2955 | private DocRecord(com.google.protobuf.GeneratedMessageV3.Builder> builder) { 2956 | super(builder); 2957 | } 2958 | private DocRecord() { 2959 | collectionDocid_ = ""; 2960 | } 2961 | 2962 | @java.lang.Override 2963 | @SuppressWarnings({"unused"}) 2964 | protected java.lang.Object newInstance( 2965 | UnusedPrivateParameter unused) { 2966 | return new DocRecord(); 2967 | } 2968 | 2969 | @java.lang.Override 2970 | public final com.google.protobuf.UnknownFieldSet 2971 | getUnknownFields() { 2972 | return this.unknownFields; 2973 | } 2974 | private DocRecord( 2975 | com.google.protobuf.CodedInputStream input, 2976 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2977 | throws com.google.protobuf.InvalidProtocolBufferException { 2978 | this(); 2979 | if (extensionRegistry == null) { 2980 | throw new java.lang.NullPointerException(); 2981 | } 2982 | com.google.protobuf.UnknownFieldSet.Builder unknownFields = 2983 | com.google.protobuf.UnknownFieldSet.newBuilder(); 2984 | try { 2985 | boolean done = false; 2986 | while (!done) { 2987 | int tag = input.readTag(); 2988 | switch (tag) { 2989 | case 0: 2990 | done = true; 2991 | break; 2992 | case 8: { 2993 | 2994 | docid_ = input.readInt32(); 2995 | break; 2996 | } 2997 | case 18: { 2998 | java.lang.String s = input.readStringRequireUtf8(); 2999 | 3000 | collectionDocid_ = s; 3001 | break; 3002 | } 3003 | case 24: { 3004 | 3005 | doclength_ = input.readInt32(); 3006 | break; 3007 | } 3008 | default: { 3009 | if (!parseUnknownField( 3010 | input, unknownFields, extensionRegistry, tag)) { 3011 | done = true; 3012 | } 3013 | break; 3014 | } 3015 | } 3016 | } 3017 | } catch (com.google.protobuf.InvalidProtocolBufferException e) { 3018 | throw e.setUnfinishedMessage(this); 3019 | } catch (java.io.IOException e) { 3020 | throw new com.google.protobuf.InvalidProtocolBufferException( 3021 | e).setUnfinishedMessage(this); 3022 | } finally { 3023 | this.unknownFields = unknownFields.build(); 3024 | makeExtensionsImmutable(); 3025 | } 3026 | } 3027 | public static final com.google.protobuf.Descriptors.Descriptor 3028 | getDescriptor() { 3029 | return io.osirrc.ciff.CommonIndexFileFormat.internal_static_io_osirrc_ciff_DocRecord_descriptor; 3030 | } 3031 | 3032 | @java.lang.Override 3033 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 3034 | internalGetFieldAccessorTable() { 3035 | return io.osirrc.ciff.CommonIndexFileFormat.internal_static_io_osirrc_ciff_DocRecord_fieldAccessorTable 3036 | .ensureFieldAccessorsInitialized( 3037 | io.osirrc.ciff.CommonIndexFileFormat.DocRecord.class, io.osirrc.ciff.CommonIndexFileFormat.DocRecord.Builder.class); 3038 | } 3039 | 3040 | public static final int DOCID_FIELD_NUMBER = 1; 3041 | private int docid_; 3042 | /** 3043 | *
3044 | * Refers to the docid in the postings lists. 3045 | *3046 | * 3047 | *
int32 docid = 1;
3048 | */
3049 | public int getDocid() {
3050 | return docid_;
3051 | }
3052 |
3053 | public static final int COLLECTION_DOCID_FIELD_NUMBER = 2;
3054 | private volatile java.lang.Object collectionDocid_;
3055 | /**
3056 | * 3057 | * Refers to a docid in the external collection. 3058 | *3059 | * 3060 | *
string collection_docid = 2;
3061 | */
3062 | public java.lang.String getCollectionDocid() {
3063 | java.lang.Object ref = collectionDocid_;
3064 | if (ref instanceof java.lang.String) {
3065 | return (java.lang.String) ref;
3066 | } else {
3067 | com.google.protobuf.ByteString bs =
3068 | (com.google.protobuf.ByteString) ref;
3069 | java.lang.String s = bs.toStringUtf8();
3070 | collectionDocid_ = s;
3071 | return s;
3072 | }
3073 | }
3074 | /**
3075 | * 3076 | * Refers to a docid in the external collection. 3077 | *3078 | * 3079 | *
string collection_docid = 2;
3080 | */
3081 | public com.google.protobuf.ByteString
3082 | getCollectionDocidBytes() {
3083 | java.lang.Object ref = collectionDocid_;
3084 | if (ref instanceof java.lang.String) {
3085 | com.google.protobuf.ByteString b =
3086 | com.google.protobuf.ByteString.copyFromUtf8(
3087 | (java.lang.String) ref);
3088 | collectionDocid_ = b;
3089 | return b;
3090 | } else {
3091 | return (com.google.protobuf.ByteString) ref;
3092 | }
3093 | }
3094 |
3095 | public static final int DOCLENGTH_FIELD_NUMBER = 3;
3096 | private int doclength_;
3097 | /**
3098 | * 3099 | * Length of this document. 3100 | *3101 | * 3102 | *
int32 doclength = 3;
3103 | */
3104 | public int getDoclength() {
3105 | return doclength_;
3106 | }
3107 |
3108 | private byte memoizedIsInitialized = -1;
3109 | @java.lang.Override
3110 | public final boolean isInitialized() {
3111 | byte isInitialized = memoizedIsInitialized;
3112 | if (isInitialized == 1) return true;
3113 | if (isInitialized == 0) return false;
3114 |
3115 | memoizedIsInitialized = 1;
3116 | return true;
3117 | }
3118 |
3119 | @java.lang.Override
3120 | public void writeTo(com.google.protobuf.CodedOutputStream output)
3121 | throws java.io.IOException {
3122 | if (docid_ != 0) {
3123 | output.writeInt32(1, docid_);
3124 | }
3125 | if (!getCollectionDocidBytes().isEmpty()) {
3126 | com.google.protobuf.GeneratedMessageV3.writeString(output, 2, collectionDocid_);
3127 | }
3128 | if (doclength_ != 0) {
3129 | output.writeInt32(3, doclength_);
3130 | }
3131 | unknownFields.writeTo(output);
3132 | }
3133 |
3134 | @java.lang.Override
3135 | public int getSerializedSize() {
3136 | int size = memoizedSize;
3137 | if (size != -1) return size;
3138 |
3139 | size = 0;
3140 | if (docid_ != 0) {
3141 | size += com.google.protobuf.CodedOutputStream
3142 | .computeInt32Size(1, docid_);
3143 | }
3144 | if (!getCollectionDocidBytes().isEmpty()) {
3145 | size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, collectionDocid_);
3146 | }
3147 | if (doclength_ != 0) {
3148 | size += com.google.protobuf.CodedOutputStream
3149 | .computeInt32Size(3, doclength_);
3150 | }
3151 | size += unknownFields.getSerializedSize();
3152 | memoizedSize = size;
3153 | return size;
3154 | }
3155 |
3156 | @java.lang.Override
3157 | public boolean equals(final java.lang.Object obj) {
3158 | if (obj == this) {
3159 | return true;
3160 | }
3161 | if (!(obj instanceof io.osirrc.ciff.CommonIndexFileFormat.DocRecord)) {
3162 | return super.equals(obj);
3163 | }
3164 | io.osirrc.ciff.CommonIndexFileFormat.DocRecord other = (io.osirrc.ciff.CommonIndexFileFormat.DocRecord) obj;
3165 |
3166 | if (getDocid()
3167 | != other.getDocid()) return false;
3168 | if (!getCollectionDocid()
3169 | .equals(other.getCollectionDocid())) return false;
3170 | if (getDoclength()
3171 | != other.getDoclength()) return false;
3172 | if (!unknownFields.equals(other.unknownFields)) return false;
3173 | return true;
3174 | }
3175 |
3176 | @java.lang.Override
3177 | public int hashCode() {
3178 | if (memoizedHashCode != 0) {
3179 | return memoizedHashCode;
3180 | }
3181 | int hash = 41;
3182 | hash = (19 * hash) + getDescriptor().hashCode();
3183 | hash = (37 * hash) + DOCID_FIELD_NUMBER;
3184 | hash = (53 * hash) + getDocid();
3185 | hash = (37 * hash) + COLLECTION_DOCID_FIELD_NUMBER;
3186 | hash = (53 * hash) + getCollectionDocid().hashCode();
3187 | hash = (37 * hash) + DOCLENGTH_FIELD_NUMBER;
3188 | hash = (53 * hash) + getDoclength();
3189 | hash = (29 * hash) + unknownFields.hashCode();
3190 | memoizedHashCode = hash;
3191 | return hash;
3192 | }
3193 |
3194 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseFrom(
3195 | java.nio.ByteBuffer data)
3196 | throws com.google.protobuf.InvalidProtocolBufferException {
3197 | return PARSER.parseFrom(data);
3198 | }
3199 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseFrom(
3200 | java.nio.ByteBuffer data,
3201 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3202 | throws com.google.protobuf.InvalidProtocolBufferException {
3203 | return PARSER.parseFrom(data, extensionRegistry);
3204 | }
3205 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseFrom(
3206 | com.google.protobuf.ByteString data)
3207 | throws com.google.protobuf.InvalidProtocolBufferException {
3208 | return PARSER.parseFrom(data);
3209 | }
3210 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseFrom(
3211 | com.google.protobuf.ByteString data,
3212 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3213 | throws com.google.protobuf.InvalidProtocolBufferException {
3214 | return PARSER.parseFrom(data, extensionRegistry);
3215 | }
3216 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseFrom(byte[] data)
3217 | throws com.google.protobuf.InvalidProtocolBufferException {
3218 | return PARSER.parseFrom(data);
3219 | }
3220 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseFrom(
3221 | byte[] data,
3222 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3223 | throws com.google.protobuf.InvalidProtocolBufferException {
3224 | return PARSER.parseFrom(data, extensionRegistry);
3225 | }
3226 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseFrom(java.io.InputStream input)
3227 | throws java.io.IOException {
3228 | return com.google.protobuf.GeneratedMessageV3
3229 | .parseWithIOException(PARSER, input);
3230 | }
3231 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseFrom(
3232 | java.io.InputStream input,
3233 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3234 | throws java.io.IOException {
3235 | return com.google.protobuf.GeneratedMessageV3
3236 | .parseWithIOException(PARSER, input, extensionRegistry);
3237 | }
3238 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseDelimitedFrom(java.io.InputStream input)
3239 | throws java.io.IOException {
3240 | return com.google.protobuf.GeneratedMessageV3
3241 | .parseDelimitedWithIOException(PARSER, input);
3242 | }
3243 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseDelimitedFrom(
3244 | java.io.InputStream input,
3245 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3246 | throws java.io.IOException {
3247 | return com.google.protobuf.GeneratedMessageV3
3248 | .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
3249 | }
3250 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseFrom(
3251 | com.google.protobuf.CodedInputStream input)
3252 | throws java.io.IOException {
3253 | return com.google.protobuf.GeneratedMessageV3
3254 | .parseWithIOException(PARSER, input);
3255 | }
3256 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord parseFrom(
3257 | com.google.protobuf.CodedInputStream input,
3258 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3259 | throws java.io.IOException {
3260 | return com.google.protobuf.GeneratedMessageV3
3261 | .parseWithIOException(PARSER, input, extensionRegistry);
3262 | }
3263 |
3264 | @java.lang.Override
3265 | public Builder newBuilderForType() { return newBuilder(); }
3266 | public static Builder newBuilder() {
3267 | return DEFAULT_INSTANCE.toBuilder();
3268 | }
3269 | public static Builder newBuilder(io.osirrc.ciff.CommonIndexFileFormat.DocRecord prototype) {
3270 | return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
3271 | }
3272 | @java.lang.Override
3273 | public Builder toBuilder() {
3274 | return this == DEFAULT_INSTANCE
3275 | ? new Builder() : new Builder().mergeFrom(this);
3276 | }
3277 |
3278 | @java.lang.Override
3279 | protected Builder newBuilderForType(
3280 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
3281 | Builder builder = new Builder(parent);
3282 | return builder;
3283 | }
3284 | /**
3285 | * 3286 | * A record containing metadata about an individual document. 3287 | *3288 | * 3289 | * Protobuf type {@code io.osirrc.ciff.DocRecord} 3290 | */ 3291 | public static final class Builder extends 3292 | com.google.protobuf.GeneratedMessageV3.Builder
3451 | * Refers to the docid in the postings lists. 3452 | *3453 | * 3454 | *
int32 docid = 1;
3455 | */
3456 | public int getDocid() {
3457 | return docid_;
3458 | }
3459 | /**
3460 | * 3461 | * Refers to the docid in the postings lists. 3462 | *3463 | * 3464 | *
int32 docid = 1;
3465 | */
3466 | public Builder setDocid(int value) {
3467 |
3468 | docid_ = value;
3469 | onChanged();
3470 | return this;
3471 | }
3472 | /**
3473 | * 3474 | * Refers to the docid in the postings lists. 3475 | *3476 | * 3477 | *
int32 docid = 1;
3478 | */
3479 | public Builder clearDocid() {
3480 |
3481 | docid_ = 0;
3482 | onChanged();
3483 | return this;
3484 | }
3485 |
3486 | private java.lang.Object collectionDocid_ = "";
3487 | /**
3488 | * 3489 | * Refers to a docid in the external collection. 3490 | *3491 | * 3492 | *
string collection_docid = 2;
3493 | */
3494 | public java.lang.String getCollectionDocid() {
3495 | java.lang.Object ref = collectionDocid_;
3496 | if (!(ref instanceof java.lang.String)) {
3497 | com.google.protobuf.ByteString bs =
3498 | (com.google.protobuf.ByteString) ref;
3499 | java.lang.String s = bs.toStringUtf8();
3500 | collectionDocid_ = s;
3501 | return s;
3502 | } else {
3503 | return (java.lang.String) ref;
3504 | }
3505 | }
3506 | /**
3507 | * 3508 | * Refers to a docid in the external collection. 3509 | *3510 | * 3511 | *
string collection_docid = 2;
3512 | */
3513 | public com.google.protobuf.ByteString
3514 | getCollectionDocidBytes() {
3515 | java.lang.Object ref = collectionDocid_;
3516 | if (ref instanceof String) {
3517 | com.google.protobuf.ByteString b =
3518 | com.google.protobuf.ByteString.copyFromUtf8(
3519 | (java.lang.String) ref);
3520 | collectionDocid_ = b;
3521 | return b;
3522 | } else {
3523 | return (com.google.protobuf.ByteString) ref;
3524 | }
3525 | }
3526 | /**
3527 | * 3528 | * Refers to a docid in the external collection. 3529 | *3530 | * 3531 | *
string collection_docid = 2;
3532 | */
3533 | public Builder setCollectionDocid(
3534 | java.lang.String value) {
3535 | if (value == null) {
3536 | throw new NullPointerException();
3537 | }
3538 |
3539 | collectionDocid_ = value;
3540 | onChanged();
3541 | return this;
3542 | }
3543 | /**
3544 | * 3545 | * Refers to a docid in the external collection. 3546 | *3547 | * 3548 | *
string collection_docid = 2;
3549 | */
3550 | public Builder clearCollectionDocid() {
3551 |
3552 | collectionDocid_ = getDefaultInstance().getCollectionDocid();
3553 | onChanged();
3554 | return this;
3555 | }
3556 | /**
3557 | * 3558 | * Refers to a docid in the external collection. 3559 | *3560 | * 3561 | *
string collection_docid = 2;
3562 | */
3563 | public Builder setCollectionDocidBytes(
3564 | com.google.protobuf.ByteString value) {
3565 | if (value == null) {
3566 | throw new NullPointerException();
3567 | }
3568 | checkByteStringIsUtf8(value);
3569 |
3570 | collectionDocid_ = value;
3571 | onChanged();
3572 | return this;
3573 | }
3574 |
3575 | private int doclength_ ;
3576 | /**
3577 | * 3578 | * Length of this document. 3579 | *3580 | * 3581 | *
int32 doclength = 3;
3582 | */
3583 | public int getDoclength() {
3584 | return doclength_;
3585 | }
3586 | /**
3587 | * 3588 | * Length of this document. 3589 | *3590 | * 3591 | *
int32 doclength = 3;
3592 | */
3593 | public Builder setDoclength(int value) {
3594 |
3595 | doclength_ = value;
3596 | onChanged();
3597 | return this;
3598 | }
3599 | /**
3600 | * 3601 | * Length of this document. 3602 | *3603 | * 3604 | *
int32 doclength = 3;
3605 | */
3606 | public Builder clearDoclength() {
3607 |
3608 | doclength_ = 0;
3609 | onChanged();
3610 | return this;
3611 | }
3612 | @java.lang.Override
3613 | public final Builder setUnknownFields(
3614 | final com.google.protobuf.UnknownFieldSet unknownFields) {
3615 | return super.setUnknownFields(unknownFields);
3616 | }
3617 |
3618 | @java.lang.Override
3619 | public final Builder mergeUnknownFields(
3620 | final com.google.protobuf.UnknownFieldSet unknownFields) {
3621 | return super.mergeUnknownFields(unknownFields);
3622 | }
3623 |
3624 |
3625 | // @@protoc_insertion_point(builder_scope:io.osirrc.ciff.DocRecord)
3626 | }
3627 |
3628 | // @@protoc_insertion_point(class_scope:io.osirrc.ciff.DocRecord)
3629 | private static final io.osirrc.ciff.CommonIndexFileFormat.DocRecord DEFAULT_INSTANCE;
3630 | static {
3631 | DEFAULT_INSTANCE = new io.osirrc.ciff.CommonIndexFileFormat.DocRecord();
3632 | }
3633 |
3634 | public static io.osirrc.ciff.CommonIndexFileFormat.DocRecord getDefaultInstance() {
3635 | return DEFAULT_INSTANCE;
3636 | }
3637 |
3638 | private static final com.google.protobuf.Parser