net.sourceforge.pebble.search
Class SearchResults

java.lang.Object
  extended by net.sourceforge.pebble.search.SearchResults

public class SearchResults
extends java.lang.Object

A container for the results (hits) of a search.

Author:
Simon Brown

Constructor Summary
SearchResults()
           
 
Method Summary
 void add(SearchHit hit)
          Adds a hit to the collection of hits.
 java.util.List getHits()
          Gets a collection containing all of the hits.
 java.lang.String getMessage()
          Gets the message associated with these results.
 int getNumberOfHits()
          Gets the number of hits that the query returned.
 java.lang.String getQuery()
          Gets the query that was used to generate these results.
 void setMessage(java.lang.String s)
          Gets the message associated with these results.
 void setQuery(java.lang.String s)
          Sets the query that was used to generate these results.
 void sortByDateDescending()
          Sorts the search results by date, in reverse order.
 void sortByScoreDescending()
          Sorts the search results by score, in reverse order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchResults

public SearchResults()
Method Detail

getQuery

public java.lang.String getQuery()
Gets the query that was used to generate these results.

Returns:
the original query

setQuery

public void setQuery(java.lang.String s)
Sets the query that was used to generate these results.

Parameters:
s - the original query

getMessage

public java.lang.String getMessage()
Gets the message associated with these results. This may contain information or an error message.

Returns:
the message (can be null)

setMessage

public void setMessage(java.lang.String s)
Gets the message associated with these results. This may contain information or an error message.

Parameters:
s - the message (can be null)

add

public void add(SearchHit hit)
Adds a hit to the collection of hits.

Parameters:
hit - a SearchHit instance

getNumberOfHits

public int getNumberOfHits()
Gets the number of hits that the query returned.

Returns:
the number of hits as an int

getHits

public java.util.List getHits()
Gets a collection containing all of the hits.

Returns:
a Collection of SearchHit instances

sortByScoreDescending

public void sortByScoreDescending()
Sorts the search results by score, in reverse order.


sortByDateDescending

public void sortByDateDescending()
Sorts the search results by date, in reverse order.



Copyright © 2003-2006, Simon Brown. All Rights Reserved.