net.sourceforge.sconman
Class IndexManager.SearchResults

java.lang.Object
  extended by net.sourceforge.sconman.IndexManager.SearchResults
All Implemented Interfaces:
ISearchResults
Enclosing class:
IndexManager

public static class IndexManager.SearchResults
extends java.lang.Object
implements ISearchResults

Default ISearchResultsimplementation

Author:
mballesteros

Field Summary
(package private) static java.text.NumberFormat nf
           
(package private)  Project prj
           
(package private)  net.sf.sconman.index.IResultSet rset
           
 
Constructor Summary
IndexManager.SearchResults(Project prj, net.sf.sconman.index.IResultSet rset)
           
 
Method Summary
 void close()
          Closes the search
(package private)  Content getContent(int index)
           
 Content getContent(User user, int index)
          Returns the content at the index position of the results list.
 int getLength()
          Returns the total amount of matching contents
 int getOriginalLength()
          (Optional) Returns the original total amount of matching contents when paging
 float getScore(int index)
          Returns the search score for the content index in the results list
 java.lang.String getScoreAsPercentile(int index, int decimals)
           
 long getSearchTime()
          Returns the time to perform the search
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nf

static java.text.NumberFormat nf

prj

Project prj

rset

net.sf.sconman.index.IResultSet rset
Constructor Detail

IndexManager.SearchResults

IndexManager.SearchResults(Project prj,
                           net.sf.sconman.index.IResultSet rset)
Method Detail

getSearchTime

public long getSearchTime()
Description copied from interface: ISearchResults
Returns the time to perform the search

Specified by:
getSearchTime in interface ISearchResults
Returns:
Search time in milliseconds

getLength

public int getLength()
Description copied from interface: ISearchResults
Returns the total amount of matching contents

Specified by:
getLength in interface ISearchResults
Returns:
The number of contents returned by this object

getOriginalLength

public int getOriginalLength()
Description copied from interface: ISearchResults
(Optional) Returns the original total amount of matching contents when paging

Specified by:
getOriginalLength in interface ISearchResults
Returns:
The original total number of contents returned by this object

getContent

public Content getContent(User user,
                          int index)
                   throws SCMStorageException
Description copied from interface: ISearchResults
Returns the content at the index position of the results list.

Specified by:
getContent in interface ISearchResults
Parameters:
user - The user that requests the content
index - Content index in the results list, between 0 and ISearchResults.getLength()
Returns:
The requested content
Throws:
SCMStorageException - Thrown if there's a problem retrieving the content description from the index.

getContent

Content getContent(int index)
             throws SCMStorageException
Throws:
SCMStorageException

getScore

public float getScore(int index)
               throws SCMStorageException
Description copied from interface: ISearchResults
Returns the search score for the content index in the results list

Specified by:
getScore in interface ISearchResults
Parameters:
index - Content index in the results list, between 0 and ISearchResults.getLength()
Returns:
The search score (float from 0.0 to 1.0)
Throws:
SCMStorageException - Thrown if there's a problem retrieving the score from the index.

getScoreAsPercentile

public java.lang.String getScoreAsPercentile(int index,
                                             int decimals)
                                      throws SCMStorageException
Specified by:
getScoreAsPercentile in interface ISearchResults
Throws:
SCMStorageException

close

public void close()
           throws SCMStorageException
Description copied from interface: ISearchResults
Closes the search

Specified by:
close in interface ISearchResults
Throws:
SCMStorageException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright null null. All Rights Reserved.