|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This report was generated with an evaluation server license. Purchase Clover or configure your license. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SearchHit | Line # 43 | 16 | 0% | 10 | 0 | 100% |
1.0
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (22) | |||
| Result | |||
|
1.0
|
net.sourceforge.pebble.search.SearchHitTest.testConstruction
net.sourceforge.pebble.search.SearchHitTest.testConstruction
|
1 PASS | |
|
1.0
|
net.sourceforge.pebble.search.SearchHitTest.testConstruction
net.sourceforge.pebble.search.SearchHitTest.testConstruction
|
1 PASS | |
|
0.46153846
|
net.sourceforge.pebble.comparator.SearchHitByScoreComparatorTest.testCompare
net.sourceforge.pebble.comparator.SearchHitByScoreComparatorTest.testCompare
|
1 PASS | |
|
0.46153846
|
net.sourceforge.pebble.search.SearchResultsTest.testSortByScore
net.sourceforge.pebble.search.SearchResultsTest.testSortByScore
|
1 PASS | |
|
0.46153846
|
net.sourceforge.pebble.search.SearchResultsTest.testSortByScore
net.sourceforge.pebble.search.SearchResultsTest.testSortByScore
|
1 PASS | |
|
0.46153846
|
net.sourceforge.pebble.comparator.SearchHitByScoreComparatorTest.testCompare
net.sourceforge.pebble.comparator.SearchHitByScoreComparatorTest.testCompare
|
1 PASS | |
|
0.46153846
|
net.sourceforge.pebble.search.SearchResultsTest.testSortByDate
net.sourceforge.pebble.search.SearchResultsTest.testSortByDate
|
1 PASS | |
|
0.46153846
|
net.sourceforge.pebble.search.SearchResultsTest.testSortByDate
net.sourceforge.pebble.search.SearchResultsTest.testSortByDate
|
1 PASS | |
|
0.3846154
|
net.sourceforge.pebble.comparator.SearchHitByDateComparatorTest.testCompare
net.sourceforge.pebble.comparator.SearchHitByDateComparatorTest.testCompare
|
1 PASS | |
|
0.3846154
|
net.sourceforge.pebble.comparator.SearchHitByDateComparatorTest.testCompare
net.sourceforge.pebble.comparator.SearchHitByDateComparatorTest.testCompare
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnComments
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnComments
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnCategory
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnCategory
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnComments
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnComments
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnRemovedBlogEntry
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnRemovedBlogEntry
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.search.SearchResultsTest.testHits
net.sourceforge.pebble.search.SearchResultsTest.testHits
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnBody
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnBody
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnTitle
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnTitle
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.search.SearchResultsTest.testHits
net.sourceforge.pebble.search.SearchResultsTest.testHits
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnRemovedBlogEntry
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnRemovedBlogEntry
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnCategory
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnCategory
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnTitle
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnTitle
|
1 PASS | |
|
0.30769232
|
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnBody
net.sourceforge.pebble.index.SearchIndexTest.testSearchOnBody
|
1 PASS | |
| 1 | /* | |
| 2 | * Copyright (c) 2003-2006, Simon Brown | |
| 3 | * All rights reserved. | |
| 4 | * | |
| 5 | * Redistribution and use in source and binary forms, with or without | |
| 6 | * modification, are permitted provided that the following conditions are met: | |
| 7 | * | |
| 8 | * - Redistributions of source code must retain the above copyright | |
| 9 | * notice, this list of conditions and the following disclaimer. | |
| 10 | * | |
| 11 | * - Redistributions in binary form must reproduce the above copyright | |
| 12 | * notice, this list of conditions and the following disclaimer in | |
| 13 | * the documentation and/or other materials provided with the | |
| 14 | * distribution. | |
| 15 | * | |
| 16 | * - Neither the name of Pebble nor the names of its contributors may | |
| 17 | * be used to endorse or promote products derived from this software | |
| 18 | * without specific prior written permission. | |
| 19 | * | |
| 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
| 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
| 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | |
| 24 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
| 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
| 26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
| 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
| 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
| 29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 30 | * POSSIBILITY OF SUCH DAMAGE. | |
| 31 | */ | |
| 32 | package net.sourceforge.pebble.search; | |
| 33 | ||
| 34 | import net.sourceforge.pebble.domain.Blog; | |
| 35 | ||
| 36 | import java.util.Date; | |
| 37 | ||
| 38 | /** | |
| 39 | * A container for the results of a search (a search hit). | |
| 40 | * | |
| 41 | * @author Simon Brown | |
| 42 | */ | |
| 43 | public class SearchHit { | |
| 44 | ||
| 45 | /** the blog to which the result belongs */ | |
| 46 | private Blog blog; | |
| 47 | ||
| 48 | /** the id of the blog entry that matched the search query */ | |
| 49 | private String id; | |
| 50 | ||
| 51 | /** the permalink of the blog entry that matched the search query */ | |
| 52 | private String permalink; | |
| 53 | ||
| 54 | /** the title of the blog entry that matched the search query */ | |
| 55 | private String title; | |
| 56 | ||
| 57 | /** the excerpt of the blog entry that matched the search query */ | |
| 58 | private String excerpt; | |
| 59 | ||
| 60 | /** the date of the blog entry */ | |
| 61 | private Date date; | |
| 62 | ||
| 63 | /** the score of the matched */ | |
| 64 | private float score; | |
| 65 | ||
| 66 | /** the number of this result */ | |
| 67 | private int number; | |
| 68 | ||
| 69 | /** | |
| 70 | * Creates a new instance with the specified message. | |
| 71 | */ | |
| 72 | 40 |
public SearchHit(Blog blog, String id, String permalink, String title, String excerpt, Date date, float score) { |
| 73 | 40 | this.blog = blog; |
| 74 | 40 | this.id = id; |
| 75 | 40 | this.permalink = permalink; |
| 76 | 40 | this.title = title; |
| 77 | 40 | this.excerpt = excerpt; |
| 78 | 40 | this.date = date; |
| 79 | 40 | this.score = score; |
| 80 | } | |
| 81 | ||
| 82 | /** | |
| 83 | * Gets the blog for the matching blog entry. | |
| 84 | * | |
| 85 | * @return the owning Blog instance | |
| 86 | */ | |
| 87 | 2 |
public Blog getBlog() { |
| 88 | 2 | return this.blog; |
| 89 | } | |
| 90 | ||
| 91 | /** | |
| 92 | * Gets the id for the matching blog entry. | |
| 93 | * | |
| 94 | * @return the id as a String | |
| 95 | */ | |
| 96 | 2 |
public String getId() { |
| 97 | 2 | return this.id; |
| 98 | } | |
| 99 | ||
| 100 | /** | |
| 101 | * Gets the permalink for the matching blog entry. | |
| 102 | * | |
| 103 | * @return a permalink as a String | |
| 104 | */ | |
| 105 | 2 |
public String getPermalink() { |
| 106 | 2 | return this.permalink; |
| 107 | } | |
| 108 | ||
| 109 | /** | |
| 110 | * Gets the title for the matching blog entry. | |
| 111 | * | |
| 112 | * @return a title as a String | |
| 113 | */ | |
| 114 | 2 |
public String getTitle() { |
| 115 | 2 | return title; |
| 116 | } | |
| 117 | ||
| 118 | /** | |
| 119 | * Gets the excerpt for the matching blog entry. | |
| 120 | * | |
| 121 | * @return a excerpt as a String | |
| 122 | */ | |
| 123 | 2 |
public String getExcerpt() { |
| 124 | 2 | return excerpt; |
| 125 | } | |
| 126 | ||
| 127 | /** | |
| 128 | * Gets the date of the matching blog entry. | |
| 129 | * | |
| 130 | * @return the date as a Date | |
| 131 | */ | |
| 132 | 34 |
public Date getDate() { |
| 133 | 34 | return this.date; |
| 134 | } | |
| 135 | ||
| 136 | /** | |
| 137 | * Gets the score for the matching blog entry. | |
| 138 | * | |
| 139 | * @return a score as a float | |
| 140 | */ | |
| 141 | 30 |
public float getScore() { |
| 142 | 30 | return this.score; |
| 143 | } | |
| 144 | ||
| 145 | /** | |
| 146 | * Gets the number of this result. | |
| 147 | * | |
| 148 | * @return the number as an int | |
| 149 | */ | |
| 150 | 2 |
public int getNumber() { |
| 151 | 2 | return this.number; |
| 152 | } | |
| 153 | ||
| 154 | /** | |
| 155 | * Sets the number of this result. | |
| 156 | * | |
| 157 | * @param n the number as an int | |
| 158 | */ | |
| 159 | 14 |
public void setNumber(int n) { |
| 160 | 14 | this.number = n; |
| 161 | } | |
| 162 | ||
| 163 | } | |
|
||||||||||||