source: SRUClient/tags/SRUClient-0.9.5/src/main/java/eu/clarin/sru/client/SRUScanResponse.java @ 6079

Last change on this file since 6079 was 6079, checked in by Oliver Schonefeld, 9 years ago
  • tag version 0.9.5
  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1/**
2 * This software is copyright (c) 2012-2014 by
3 *  - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de)
4 * This is free software. You can redistribute it
5 * and/or modify it under the terms described in
6 * the GNU General Public License v3 of which you
7 * should have received a copy. Otherwise you can download
8 * it from
9 *
10 *   http://www.gnu.org/licenses/gpl-3.0.txt
11 *
12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de)
13 *
14 * @license http://www.gnu.org/licenses/gpl-3.0.txt
15 *  GNU General Public License v3
16 */
17package eu.clarin.sru.client;
18
19import java.util.Collections;
20import java.util.List;
21
22
23
24/**
25 * A response to a <em>scan</em> request.
26 */
27public final class SRUScanResponse extends SRUAbstractResponse<SRUScanRequest> {
28    private final List<SRUTerm> terms;
29
30
31    SRUScanResponse(SRUScanRequest request,
32            List<SRUDiagnostic> diagnostics,
33            List<SRUExtraResponseData> extraResponseData,
34            int totalBytesTransferred,
35            long timeTotal,
36            long timeQueued,
37            long timeNetwork,
38            long timeProcessing,
39            List<SRUTerm> terms) {
40        super(request, diagnostics, extraResponseData, totalBytesTransferred,
41                timeTotal, timeQueued, timeNetwork, timeProcessing);
42        this.terms = ((terms != null) && !terms.isEmpty())
43                ? Collections.unmodifiableList(terms)
44                : null;
45    }
46
47
48    /**
49     * Get list of terms matched by the request.
50     *
51     * @return a list of terms or <code>null</code> if no terms matched the
52     *         request.
53     */
54    public List<SRUTerm> getTerms() {
55        return terms;
56    }
57
58
59    /**
60     * Check, if response contains any terms.
61     *
62     * @return <code>true</code> of response contains terms, <code>false</code>
63     *         otherwise
64     */
65    public boolean hasTerms() {
66        return terms != null;
67    }
68
69} // class SRUScanResponse
Note: See TracBrowser for help on using the repository browser.