001: /*
002: * Copyright 2003-2005 Michael Franken, Zilverline.
003: *
004: * The contents of this file, or the files included with this file, are subject to
005: * the current version of ZILVERLINE Collaborative Source License for the
006: * Zilverline Search Engine (the "License"); You may not use this file except in
007: * compliance with the License.
008: *
009: * You may obtain a copy of the License at
010: *
011: * http://www.zilverline.org.
012: *
013: * See the License for the rights, obligations and
014: * limitations governing use of the contents of the file.
015: *
016: * The Original and Upgraded Code is the Zilverline Search Engine. The developer of
017: * the Original and Upgraded Code is Michael Franken. Michael Franken owns the
018: * copyrights in the portions it created. All Rights Reserved.
019: *
020: */
021:
022: package org.zilverline.core;
023:
024: /**
025: * The SearchResult represent the result of a Search. It contains the number of hits and the results, as well as the starting and
026: * ending number of the result. So possibly an Array of 20 results, from 234 hits, results 21 to 40.
027: *
028: * @author Michael Franken
029: * @version $Revision: 1.4 $
030: *
031: * @see org.zilverline.core.FileSystemCollection
032: */
033: public final class SearchResult {
034:
035: /**
036: * Create a SearchResult with the number of hits and the results, as well as the starting and ending number of the result. So
037: * possibly an Array of 20 results, from 234 hits, results 21 to 40.
038: *
039: * @param thisResults the array of Results
040: * @param thisNumberOfHits the total number of Hits, probably larger than the results
041: * @param thisStartAt the first results 'offset' into all hits
042: * @param thisEndAt the last results 'offset' into all hits
043: */
044: public SearchResult(final Result[] this Results,
045: final int this NumberOfHits, final int this StartAt,
046: final int this EndAt) {
047: results = this Results;
048: numberOfHits = this NumberOfHits;
049: startAt = this StartAt;
050: endAt = this EndAt;
051: }
052:
053: /** The results. */
054: private Result[] results;
055:
056: /** The number of results. */
057: private int numberOfHits;
058:
059: /** The first results 'offset' into all hits. */
060: private int endAt;
061:
062: /** The last results 'offset' into all hits. */
063: private int startAt;
064:
065: /**
066: * Returns the the total number of Hits. Probably larger than the size if results
067: *
068: * @return numberOfHits
069: */
070: public int getNumberOfHits() {
071: return numberOfHits;
072: }
073:
074: /**
075: * Returns the results as an Array.
076: *
077: * @return results
078: */
079: public Result[] getResults() {
080: return results;
081: }
082:
083: /**
084: * Returns offset into all Hits of the last Result.
085: *
086: * @return Returns the endAt.
087: */
088: public int getEndAt() {
089: return endAt;
090: }
091:
092: /**
093: * Returns offset into all Hits of the first Result.
094: *
095: * @return Returns the startAt.
096: */
097: public int getStartAt() {
098: return startAt;
099: }
100: }
|